Class GridCacheSetProxy<T>
- java.lang.Object
-
- org.apache.ignite.internal.processors.datastructures.GridCacheSetProxy<T>
-
- All Implemented Interfaces:
Closeable,Externalizable,Serializable,AutoCloseable,Iterable<T>,Collection<T>,Set<T>,IgniteSet<T>
public class GridCacheSetProxy<T> extends Object implements IgniteSet<T>, Externalizable
Cache set proxy.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GridCacheSetProxy()Required byExternalizable.GridCacheSetProxy(GridCacheContext cctx, GridCacheSetImpl<T> delegate)
-
Method Summary
All Methods Instance Methods Concrete 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).voidblockOnRemove()Remove callback.voidclear()voidclose()Removes this set.booleancollocated()Returnstrueif this set can be kept on the one node only.booleancontains(Object o)booleancontainsAll(Collection<?> c)GridCacheSetImpldelegate()intgroupId()StringgroupName()booleanisEmpty()Iterator<T>iterator()Stringname()Gets set name.voidneedCheckNotRemoved()voidreadExternal(ObjectInput in)protected ObjectreadResolve()Reconstructs object on unmarshalling.booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanremoved()Gets status of set.booleanretainAll(Collection<?> c)intsize()@NotNull Object[]toArray()<T1> @NotNull T1[]toArray(T1[] a)StringtoString()<T1> IgniteSet<T1>withKeepBinary()Returns Ignite set that operates on binary objects without deserialization.voidwriteExternal(ObjectOutput out)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.Set
equals, hashCode, spliterator
-
-
-
-
Constructor Detail
-
GridCacheSetProxy
public GridCacheSetProxy()
Required byExternalizable.
-
GridCacheSetProxy
public GridCacheSetProxy(GridCacheContext cctx, GridCacheSetImpl<T> delegate)
- Parameters:
cctx- Cache context.delegate- Delegate set.
-
-
Method Detail
-
delegate
public GridCacheSetImpl delegate()
- Returns:
- Set delegate.
-
blockOnRemove
public void blockOnRemove()
Remove callback.
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(Object o)
-
toArray
@NotNull public @NotNull Object[] toArray()
-
toArray
@NotNull public <T1> @NotNull T1[] toArray(T1[] a)
-
add
public boolean add(T t)
-
remove
public boolean remove(Object o)
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<T>- Specified by:
containsAllin interfaceIgniteSet<T>- Specified by:
containsAllin interfaceSet<T>
-
addAll
public boolean addAll(Collection<? extends T> c)
-
retainAll
public boolean retainAll(Collection<?> c)
-
removeAll
public boolean removeAll(Collection<?> c)
-
clear
public void clear()
-
close
public void close()
Removes this set. In order to check the state it is possible to useIgniteSet.removed().
-
name
public String name()
Gets set name.
-
groupName
public String groupName()
- Returns:
- Group name for queue.
-
groupId
public int groupId()
- Returns:
- Group id for queue.
-
collocated
public boolean collocated()
Returnstrueif this set can be kept on the one node only. Returnsfalseif this set can be kept on the many nodes.- Specified by:
collocatedin interfaceIgniteSet<T>- Returns:
Trueif this set is incollocatedmodefalseotherwise.
-
removed
public boolean removed()
Gets status of set. In order to change the status it is possible to useIgniteSet.close()method.
-
affinityRun
public void affinityRun(IgniteRunnable job)
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.
- Specified by:
affinityRunin interfaceIgniteSet<T>- Parameters:
job- Job which will be co-located with the set.
-
affinityCall
public <R> R affinityCall(IgniteCallable<R> job)
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.
- Specified by:
affinityCallin interfaceIgniteSet<T>- Type Parameters:
R- Type of the job result.- Parameters:
job- Job which will be co-located with the set.- Returns:
- Job result.
-
withKeepBinary
public <T1> IgniteSet<T1> withKeepBinary()
Returns Ignite set that operates on binary objects without deserialization.- Specified by:
withKeepBinaryin interfaceIgniteSet<T>- Type Parameters:
T1- Type of binary objects.- Returns:
- New set instance for binary objects.
-
needCheckNotRemoved
public void needCheckNotRemoved()
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
readResolve
protected Object readResolve() throws ObjectStreamException
Reconstructs object on unmarshalling.- Returns:
- Reconstructed object.
- Throws:
ObjectStreamException- Thrown in case of unmarshalling error.
-
-