Package org.apache.ignite
Interface IgniteSet<T>
-
- All Superinterfaces:
AutoCloseable,Closeable,Collection<T>,Iterable<T>,Set<T>
public interface IgniteSet<T> extends Set<T>, Closeable
Set implementation based on on In-Memory Data Grid.Overview
Cache set implementsSetinterface and provides all methods from collections. Note that allCollectionmethods in the set may throwIgniteExceptionin case of failure or if set was removed.Collocated vs Non-collocated
Set items can be placed on one node or distributed throughout grid nodes (governed bycollocatedparameter).Non-collocatedmode is provided only for partitioned caches. Ifcollocatedparameter istrue, then all set items will be collocated on one node, otherwise items will be distributed through all grid nodes.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanadd(T t)booleanaddAll(Collection<? extends T> c)<R> RaffinityCall(IgniteCallable<R> job)Executes given job on collocated set on the node where the set is located (a.k.a. affinity co-location).voidaffinityRun(IgniteRunnable job)Executes given job on collocated set on the node where the set is located (a.k.a. affinity co-location).voidclear()voidclose()Removes this set.booleancollocated()Returnstrueif this set can be kept on the one node only.booleancontains(Object o)booleancontainsAll(Collection<?> c)booleanisEmpty()Iterator<T>iterator()Stringname()Gets set name.booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanremoved()Gets status of set.booleanretainAll(Collection<?> c)intsize()Object[]toArray()<T1> T1[]toArray(T1[] a)<T1> IgniteSet<T1>withKeepBinary()Returns Ignite set that operates on binary objects without deserialization.-
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 t) throws IgniteException
- Specified by:
addin interfaceCollection<T>- Specified by:
addin interfaceSet<T>- Throws:
IgniteException
-
addAll
boolean addAll(Collection<? extends T> c) throws IgniteException
- Specified by:
addAllin interfaceCollection<T>- Specified by:
addAllin interfaceSet<T>- Throws:
IgniteException
-
clear
void clear() throws IgniteException- Specified by:
clearin interfaceCollection<T>- Specified by:
clearin interfaceSet<T>- Throws:
IgniteException
-
contains
boolean contains(Object o) throws IgniteException
- Specified by:
containsin interfaceCollection<T>- Specified by:
containsin interfaceSet<T>- Throws:
IgniteException
-
containsAll
boolean containsAll(Collection<?> c) throws IgniteException
- Specified by:
containsAllin interfaceCollection<T>- Specified by:
containsAllin interfaceSet<T>- Throws:
IgniteException
-
isEmpty
boolean isEmpty() throws IgniteException- Specified by:
isEmptyin interfaceCollection<T>- Specified by:
isEmptyin interfaceSet<T>- Throws:
IgniteException
-
iterator
Iterator<T> iterator() throws IgniteException
- Specified by:
iteratorin interfaceCollection<T>- Specified by:
iteratorin interfaceIterable<T>- Specified by:
iteratorin interfaceSet<T>- Throws:
IgniteException
-
remove
boolean remove(Object o) throws IgniteException
- Specified by:
removein interfaceCollection<T>- Specified by:
removein interfaceSet<T>- Throws:
IgniteException
-
removeAll
boolean removeAll(Collection<?> c) throws IgniteException
- Specified by:
removeAllin interfaceCollection<T>- Specified by:
removeAllin interfaceSet<T>- Throws:
IgniteException
-
retainAll
boolean retainAll(Collection<?> c) throws IgniteException
- Specified by:
retainAllin interfaceCollection<T>- Specified by:
retainAllin interfaceSet<T>- Throws:
IgniteException
-
size
int size() throws IgniteException
- Specified by:
sizein interfaceCollection<T>- Specified by:
sizein interfaceSet<T>- Throws:
IgniteException
-
toArray
Object[] toArray() throws IgniteException
- Specified by:
toArrayin interfaceCollection<T>- Specified by:
toArrayin interfaceSet<T>- Throws:
IgniteException
-
toArray
<T1> T1[] toArray(T1[] a) throws IgniteException- Specified by:
toArrayin interfaceCollection<T>- Specified by:
toArrayin interfaceSet<T>- Throws:
IgniteException
-
close
void close() throws IgniteExceptionRemoves this set. In order to check the state it is possible to useremoved().- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IgniteException- If operation failed.
-
name
String name()
Gets set name.- Returns:
- Set name.
-
collocated
boolean collocated()
Returnstrueif this set can be kept on the one node only. Returnsfalseif this set can be kept on the many nodes.- Returns:
Trueif this set is incollocatedmodefalseotherwise.
-
removed
boolean removed()
Gets status of set. In order to change the status it is possible to useclose()method.- Returns:
Trueif set was removed from cachefalseotherwise.
-
affinityRun
void affinityRun(IgniteRunnable job) throws IgniteException
Executes given job on collocated set on the node where the set is located (a.k.a. affinity co-location).This is not supported for non-collocated sets.
- Parameters:
job- Job which will be co-located with the set.- Throws:
IgniteException- If job failed.
-
affinityCall
<R> R affinityCall(IgniteCallable<R> job) throws IgniteException
Executes given job on collocated set on the node where the set is located (a.k.a. affinity co-location).This is not supported for non-collocated sets.
- Type Parameters:
R- Type of the job result.- Parameters:
job- Job which will be co-located with the set.- Returns:
- Job result.
- Throws:
IgniteException- If job failed.
-
withKeepBinary
<T1> IgniteSet<T1> withKeepBinary()
Returns Ignite set that operates on binary objects without deserialization.- Type Parameters:
T1- Type of binary objects.- Returns:
- New set instance for binary objects.
-
-