Class GridCacheSemaphoreState
- java.lang.Object
-
- org.apache.ignite.internal.processors.datastructures.AtomicDataStructureValue
-
- org.apache.ignite.internal.processors.datastructures.VolatileAtomicDataStructureValue
-
- org.apache.ignite.internal.processors.datastructures.GridCacheSemaphoreState
-
- All Implemented Interfaces:
Externalizable,Serializable,Cloneable,GridCacheInternal
public class GridCacheSemaphoreState extends VolatileAtomicDataStructureValue implements Cloneable
Grid cache semaphore state.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GridCacheSemaphoreState()Empty constructor required forExternalizable.GridCacheSemaphoreState(int cnt, @Nullable Map<UUID,Integer> waiters, boolean failoverSafe, long gridStartTime)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()intgetCount()Map<UUID,Integer>getWaiters()longgridStartTime()booleanisBroken()booleanisFailoverSafe()voidreadExternal(ObjectInput in)voidsetBroken(boolean broken)voidsetCount(int cnt)voidsetWaiters(Map<UUID,Integer> waiters)StringtoString()DataStructureTypetype()voidwriteExternal(ObjectOutput out)
-
-
-
Constructor Detail
-
GridCacheSemaphoreState
public GridCacheSemaphoreState(int cnt, @Nullable @Nullable Map<UUID,Integer> waiters, boolean failoverSafe, long gridStartTime)Constructor.- Parameters:
cnt- Number of permissions.waiters- Waiters map.failoverSafe- Failover safe flag.gridStartTime- Cluster start time.
-
GridCacheSemaphoreState
public GridCacheSemaphoreState()
Empty constructor required forExternalizable.
-
-
Method Detail
-
type
public DataStructureType type()
- Specified by:
typein classAtomicDataStructureValue- Returns:
- Data structure type.
-
gridStartTime
public long gridStartTime()
- Specified by:
gridStartTimein classVolatileAtomicDataStructureValue- Returns:
- Grid start time.
-
setCount
public void setCount(int cnt)
- Parameters:
cnt- New count.
-
getCount
public int getCount()
- Returns:
- Current count.
-
setWaiters
public void setWaiters(Map<UUID,Integer> waiters)
- Parameters:
waiters- Map containing the number of permissions acquired by each node.
-
isFailoverSafe
public boolean isFailoverSafe()
- Returns:
- failoverSafe flag.
-
isBroken
public boolean isBroken()
- Returns:
- broken flag.
-
setBroken
public void setBroken(boolean broken)
- Parameters:
broken- Flag indicating that this semaphore should be no longer used.
-
clone
public Object clone() throws CloneNotSupportedException
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOException
-
-