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 classFileReadLockKey.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 Objectaccept(KeyVisitor visitor)booleanequals(Object obj)intgetAffinitySegmentId()This numeric id is used exclusively for storage affinity in Infinispan.StringgetFileName()Get the fileName.StringgetIndexName()Get the indexName.inthashCode()StringtoString()
-
-
-
Method Detail
-
getIndexName
public String getIndexName()
Get the indexName.- Specified by:
getIndexNamein interfaceIndexScopedKey- Returns:
- the indexName.
-
getAffinitySegmentId
public int getAffinitySegmentId()
Description copied from interface:IndexScopedKeyThis numeric id is used exclusively for storage affinity in Infinispan. It is not included in the equals and hashcode implementations!- Specified by:
getAffinitySegmentIdin interfaceAffinityTaggedKey- Specified by:
getAffinitySegmentIdin 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:
acceptin interfaceIndexScopedKey- Throws:
Exception
-
-