Package org.infinispan.lucene
Class FileReadLockKey
- java.lang.Object
-
- org.infinispan.lucene.FileReadLockKey
-
- All Implemented Interfaces:
AffinityTaggedKey
,IndexScopedKey
public final class FileReadLockKey extends Object implements IndexScopedKey
Lucene's index segment files are chunked, for safe deletion of elements a read lock is implemented so that all chunks are deleted only after the usage counter is decremented to zero. FileReadLockKey is used as a key for the reference counters; a special purpose key was needed to make atomic operation possible.- Since:
- 4.0
- Author:
- Sanne Grinovero
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FileReadLockKey.Externalizer
-
Constructor Summary
Constructors Constructor Description FileReadLockKey(String indexName, String fileName, int affinitySegmentId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
accept(KeyVisitor visitor)
boolean
equals(Object obj)
int
getAffinitySegmentId()
This numeric id is used exclusively for storage affinity in Infinispan.String
getFileName()
Get the fileName.String
getIndexName()
Get the indexName.int
hashCode()
String
toString()
-
-
-
Method Detail
-
getIndexName
public String getIndexName()
Get the indexName.- Specified by:
getIndexName
in interfaceIndexScopedKey
- Returns:
- the indexName.
-
getAffinitySegmentId
public int getAffinitySegmentId()
Description copied from interface:IndexScopedKey
This numeric id is used exclusively for storage affinity in Infinispan. It is not included in the equals and hashcode implementations!- Specified by:
getAffinitySegmentId
in interfaceAffinityTaggedKey
- Specified by:
getAffinitySegmentId
in interfaceIndexScopedKey
- Returns:
- the segment id as defined in
BuildContext.affinityLocationIntoSegment(int)
, or -1 when not explicitly set.
-
getFileName
public String getFileName()
Get the fileName.- Returns:
- the fileName.
-
accept
public Object accept(KeyVisitor visitor) throws Exception
- Specified by:
accept
in interfaceIndexScopedKey
- Throws:
Exception
-
-