Skip to content

Commit 9580d52

Browse files
author
Tim Middleton
committed
Minor updates to speciify grpc v0 api
1 parent aa774cd commit 9580d52

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

coherence/common.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,6 +1884,12 @@ func executeEntrySetFilter[K comparable, V any, E any](ctx context.Context, bc *
18841884
}
18851885

18861886
if comparator != nil {
1887+
if bc.session.GetProtocolVersion() == 0 {
1888+
// feature not available in V0
1889+
ch <- &StreamedEntry[K, V]{Err: fmt.Errorf("this feature is not available in this server version")}
1890+
return ch
1891+
}
1892+
18871893
binComparator, err = serializer.Serialize(comparator)
18881894
if err != nil {
18891895
ch <- &StreamedEntry[K, V]{Err: err}

coherence/doc.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ or [NamedCache] interface, but a function call that takes a [NamedMap] or [Named
295295
Note: the entries are sorted internally on the gRPC proxy to avoid excessive memory usage, but you need to be careful
296296
when running this operation against NamedCaches with large number of entries.
297297
298+
Sorting via a [Comparator] is only available when connecting to Coherence server versions CE 25.03+ and commercial 14.1.2.0+.
299+
298300
# Using entry processors for in-place processing
299301
300302
A Processor is an object that allows you to process (update) one or more [NamedMap] entries on the [NamedMap] itself,

coherence/named_map_client.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,8 @@ func AddIndexWithComparator[K comparable, V, T, E any](ctx context.Context, nm N
333333
//
334334
// Note: the entries are sorted internally on the gRPC proxy to avoid excessive memory usage, but you need to be
335335
// careful when running this operation against NamedCaches with large number of entries.
336+
//
337+
// This feature is only available when connecting to Coherence server versions CE 25.03+ and commercial 14.1.2.0+.
336338
func EntrySetFilterWithComparator[K comparable, V, E any](ctx context.Context, nm NamedMap[K, V], filter filters.Filter, comparator extractors.Comparator[E]) <-chan *StreamedEntry[K, V] {
337339
return executeEntrySetFilter(ctx, nm.getBaseClient(), filter, comparator)
338340
}

test/e2e/standalone/named_map_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,11 @@ func RunTestEntrySetFilterWithComparator(t *testing.T, namedMap coherence.NamedM
866866
ageResultsDescending = []int{44, 33, 20, 12}
867867
)
868868

869+
if namedMap.GetSession().GetProtocolVersion() == 0 {
870+
// skip as not supported in V0
871+
return
872+
}
873+
869874
// populate the cache
870875
populatePeople(g, namedMap)
871876

0 commit comments

Comments
 (0)