Package org.infinispan.lucene.directory
Interface BuildContext
-
public interface BuildContext
Building context to set construction parameters of Infinispan Directory instances- Since:
- 5.2
- Author:
- Sanne Grinovero
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BuildContext
affinityLocationIntoSegment(int segmentId)
When set to a positive integer, this will force a specific data distribution: the hashing function will resolve all keys used to store the various entries for the resulting index to be owned by the specified segment id.BuildContext
chunkSize(int bytes)
Sets the chunkSize option for the Directory being created.org.apache.lucene.store.Directory
create()
Creates a Directory instanceBuildContext
deleteOperationsExecutor(Executor executor)
Provides an Executor to handle delete operations in a background threadBuildContext
overrideSegmentReadLocker(SegmentReadLocker srl)
Overrides the default SegmentReadLocker.BuildContext
overrideWriteLocker(org.apache.lucene.store.LockFactory lf)
Overrides the IndexWriter LockFactoryBuildContext
writeFileListAsynchronously(boolean writeFileListAsync)
When set to true, the list of files of the Directory is propagated to other nodes asynchronously.
-
-
-
Method Detail
-
create
org.apache.lucene.store.Directory create()
Creates a Directory instance- Returns:
- the new Directory
- See Also:
Directory
-
chunkSize
BuildContext chunkSize(int bytes)
Sets the chunkSize option for the Directory being created.- Parameters:
bytes
- segments are fragmented in chunkSize bytes; larger values are more efficient for searching but less for distribution and network replication- Returns:
- the same building context to eventually create the Directory instance
-
overrideSegmentReadLocker
BuildContext overrideSegmentReadLocker(SegmentReadLocker srl)
Overrides the default SegmentReadLocker. In some cases you might be able to provide more efficient implementations than the default one by controlling the IndexReader's lifecycle- Parameters:
srl
- the new read locking strategy for fragmented segments- Returns:
- the same building context to eventually create the Directory instance
- See Also:
org.infinispan.lucene.readlocks
-
overrideWriteLocker
BuildContext overrideWriteLocker(org.apache.lucene.store.LockFactory lf)
Overrides the IndexWriter LockFactory- Parameters:
lf
- the LockFactory to be used by IndexWriters.- Returns:
- the same building context to eventually create the Directory instance
- See Also:
org.infinispan.lucene.locking
-
writeFileListAsynchronously
BuildContext writeFileListAsynchronously(boolean writeFileListAsync)
When set to true, the list of files of the Directory is propagated to other nodes asynchronously. This implies that a committed change to the index will not immediately be accessible by searching threads on other nodes, but the gap in time is not longer than the time of a single RPC so this gap should not be measurable unless there is some form of congestion. Currently defaults to false as it's safer.- Parameters:
writeFileListAsync
-- Returns:
- the same building context to eventually create the Directory instance
-
deleteOperationsExecutor
BuildContext deleteOperationsExecutor(Executor executor)
Provides an Executor to handle delete operations in a background thread- Parameters:
executor
-- Returns:
-
affinityLocationIntoSegment
BuildContext affinityLocationIntoSegment(int segmentId)
When set to a positive integer, this will force a specific data distribution: the hashing function will resolve all keys used to store the various entries for the resulting index to be owned by the specified segment id. Use with caution, as this will obviously lead into a severely unbalanced distribution.- Parameters:
segmentId
-- Returns:
-
-