Interface ClientIgniteSet<T>
-
- All Superinterfaces:
AutoCloseable,Closeable,Collection<T>,Iterable<T>,Set<T>
public interface ClientIgniteSet<T> extends Set<T>, Closeable
Distributed Set.Overview
Cache set implementsSetinterface and provides all methods from collections.Colocated vs Non-colocated
Set items can be placed on one node or distributed across grid nodes (governed byClientCollectionConfiguration.setColocated(boolean)parameter).Non-colocatedmode is provided only for partitioned caches. Ifcolocatedparameter istrue, then all set items will be colocated on one node, otherwise items will be distributed across all grid nodes.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanadd(T o)booleanaddAll(Collection<? extends T> c)voidclear()voidclose()Removes this set.booleancolocated()Gets a value indicating whether all items of this set are stored on a single node.booleancontains(Object o)booleancontainsAll(Collection<?> c)booleanisEmpty()ClientAutoCloseableIterator<T>iterator()Returns an iterator over the elements in this collection.Stringname()Gets set name.intpageSize()Gets the page size to be used for batched network data retrieval initerator()andtoArray().ClientIgniteSet<T>pageSize(int pageSize)Sets the page size to be used for batched network data retrieval initerator()andtoArray().booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanremoved()Gets a value indicating whether this set has been removed (close()was called).booleanretainAll(Collection<?> c)booleanserverKeepBinary()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.intsize()Object[]toArray()<T1> T1[]toArray(T1[] a)-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.Set
equals, hashCode, spliterator
-
-
-
-
Method Detail
-
add
boolean add(T o)
-
addAll
boolean addAll(Collection<? extends T> c)
-
clear
void clear()
-
contains
boolean contains(Object o)
-
containsAll
boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<T>- Specified by:
containsAllin interfaceSet<T>
-
isEmpty
boolean isEmpty()
-
iterator
ClientAutoCloseableIterator<T> iterator()
Returns an iterator over the elements in this collection.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 (seepageSize()) is fetched from the server. WhenIterator.hasNext()returnsfalse, it is guaranteed that the iterator is closed. In other cases (incomplete iteration) the user must close the iterator.
-
remove
boolean remove(Object o)
-
removeAll
boolean removeAll(Collection<?> c)
-
retainAll
boolean retainAll(Collection<?> c)
-
size
int size()
-
toArray
Object[] toArray()
-
toArray
<T1> T1[] toArray(T1[] a)
-
close
void close()
Removes this set.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
name
String name()
Gets set name.- Returns:
- Set name.
-
colocated
boolean colocated()
Gets a value indicating whether all items of this set are stored on a single node.- Returns:
Trueif all items of this set are stored on a single node,falseotherwise.
-
removed
boolean removed()
Gets a value indicating whether this set has been removed (close()was called).- Returns:
Trueif set was removed from cache,falseotherwise.
-
serverKeepBinary
ClientIgniteSet<T> serverKeepBinary(boolean keepBinary)
Sets a value indicating whether user objects should be kept in binary form on the server, or deserialized.Default is
true: does not require classes on server, interoperable with other thin clients, performs better. Suitable for most use cases.Set to
falseif 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"));- Parameters:
keepBinary- Whether to keep objects in binary form on the server.- Returns:
- This set instance (for chaining).
-
serverKeepBinary
boolean serverKeepBinary()
Gets a value indicating whether user objects should be kept in binary form on the server, or deserialized.Default is
true: does not require classes on server, interoperable with other thin clients, performs better. Suitable for most use cases.Set to
falseif 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"));- Returns:
truewhen user objects will be kept in binary form on the server,falseotherwise.
-
pageSize
ClientIgniteSet<T> pageSize(int pageSize)
Sets the page size to be used for batched network data retrieval initerator()andtoArray().- Parameters:
pageSize- Page size.- Returns:
- This set instance (for chaining).
-
pageSize
int pageSize()
Gets the page size to be used for batched network data retrieval initerator()andtoArray().- Returns:
- Page size.
-
-