public interface ClientIgniteSet<T> extends Set<T>, Closeable
Set
interface and provides all methods from collections.
ClientCollectionConfiguration.setColocated(boolean)
parameter).
Non-colocated
mode is provided only for partitioned caches.
If colocated
parameter is true
, then all set items
will be colocated on one node, otherwise items will be distributed across all grid nodes.Modifier and Type | Method and Description |
---|---|
boolean |
add(T o) |
boolean |
addAll(Collection<? extends T> c) |
void |
clear() |
void |
close()
Removes this set.
|
boolean |
colocated()
Gets a value indicating whether all items of this set are stored on a single node.
|
boolean |
contains(Object o) |
boolean |
containsAll(Collection<?> c) |
boolean |
isEmpty() |
ClientAutoCloseableIterator<T> |
iterator()
Returns an iterator over the elements in this collection.
|
String |
name()
Gets set name.
|
int |
pageSize()
Gets the page size to be used for batched network data retrieval in
iterator() and toArray() . |
ClientIgniteSet<T> |
pageSize(int pageSize)
Sets the page size to be used for batched network data retrieval in
iterator() and toArray() . |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
removed()
Gets a value indicating whether this set has been removed (
close() was called). |
boolean |
retainAll(Collection<?> c) |
boolean |
serverKeepBinary()
Gets a value indicating whether user objects should be kept in binary form on the server, or deserialized.
|
ClientIgniteSet<T> |
serverKeepBinary(boolean keepBinary)
Sets a value indicating whether user objects should be kept in binary form on the server, or deserialized.
|
int |
size() |
Object[] |
toArray() |
<T1> T1[] |
toArray(T1[] a) |
equals, hashCode, spliterator
parallelStream, removeIf, stream
boolean add(T o)
boolean addAll(Collection<? extends T> c)
void clear()
boolean contains(Object o)
boolean containsAll(Collection<?> c)
containsAll
in interface Collection<T>
containsAll
in interface Set<T>
boolean isEmpty()
ClientAutoCloseableIterator<T> iterator()
There are no guarantees concerning the order in which the elements are returned.
Returned iterator is AutoCloseable
: it may hold server-side resources and must be closed.
It will close itself when the last page of data (see pageSize()
) is fetched from the server.
When Iterator.hasNext()
returns false
, it is guaranteed that the iterator is closed.
In other cases (incomplete iteration) the user must close the iterator.
boolean remove(Object o)
boolean removeAll(Collection<?> c)
boolean retainAll(Collection<?> c)
int size()
Object[] toArray()
<T1> T1[] toArray(T1[] a)
void close()
close
in interface AutoCloseable
close
in interface Closeable
String name()
boolean colocated()
True
if all items of this set are stored on a single node, false
otherwise.boolean removed()
close()
was called).True
if set was removed from cache, false
otherwise.ClientIgniteSet<T> serverKeepBinary(boolean keepBinary)
Default is true
: does not require classes on server, interoperable with other thin clients, performs better.
Suitable for most use cases.
Set to false
if there is a requirement to use deserialized objects in "thick" API (IgniteSet
)
together with thin client API, like in this scenario:
ClientIgniteSet<UserObj> clientSet = client.set("my-set", new ClientCollectionConfiguration());
clientSet.serverKeepBinary(false);
IgniteSet<UserObj> serverSet = server.set(clientSet.name(), null);
clientSet.add(new UserObj(1, "client"));
assert serverSet.contains(new UserObj(1, "client"));
keepBinary
- Whether to keep objects in binary form on the server.boolean serverKeepBinary()
Default is true
: does not require classes on server, interoperable with other thin clients, performs better.
Suitable for most use cases.
Set to false
if there is a requirement to use deserialized objects in "thick" API (IgniteSet
)
together with thin client API, like in this scenario:
ClientIgniteSet<UserObj> clientSet = client.set("my-set", new ClientCollectionConfiguration());
clientSet.serverKeepBinary(false);
IgniteSet<UserObj> serverSet = server.set(clientSet.name(), null);
clientSet.add(new UserObj(1, "client"));
assert serverSet.contains(new UserObj(1, "client"));
true
when user objects will be kept in binary form on the server, false
otherwise.ClientIgniteSet<T> pageSize(int pageSize)
iterator()
and toArray()
.pageSize
- Page size.int pageSize()
iterator()
and toArray()
.
GridGain In-Memory Computing Platform : ver. 8.9.15 Release Date : December 3 2024