Package org.apache.lucene.store
Interface IOContext
public interface IOContext
IOContext holds additional details on the merge/search context. An IOContext object can never be
passed as a
null parameter to either Directory.openInput(String, IOContext) or Directory.createOutput(String, IOContext)
Implementations of IOContext are immutable and thread-safe.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumContext is an enumerator which specifies the context in which the Directory is being used.static interfaceImplemented by classes that can specify hints on how the file will be used -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IOContextA default context for normal reads/writes.static final IOContextA default context for reads withReadAdvice.SEQUENTIAL. -
Method Summary
Modifier and TypeMethodDescriptioncontext()TheIOContext.Contextthis context is forstatic IOContextFlush info, ifcontext()isIOContext.Context.FLUSHhints()Any hints on how the file will be openeddefault <T extends IOContext.FileOpenHint>
Stream<T> Finds all hints of typeclsstatic IOContextMerge info, ifcontext()isIOContext.Context.MERGEwithHints(IOContext.FileOpenHint... hints) Returns an IOContext with the given hints, if it makes sense to do so for this specific context.
-
Field Details
-
DEFAULT
A default context for normal reads/writes. UsewithHints(org.apache.lucene.store.IOContext.FileOpenHint...)to specify additional information on how the file is to be used.It will use
ReadAdvice.RANDOMby default, unless set by system propertyorg.apache.lucene.store.defaultReadAdvice. -
READONCE
A default context for reads withReadAdvice.SEQUENTIAL.This context should only be used when the read operations will be performed in the same thread as the thread that opens the underlying storage.
-
-
Method Details
-
merge
-
flush
-
context
IOContext.Context context()TheIOContext.Contextthis context is for -
mergeInfo
MergeInfo mergeInfo()Merge info, ifcontext()isIOContext.Context.MERGE -
flushInfo
FlushInfo flushInfo()Flush info, ifcontext()isIOContext.Context.FLUSH -
hints
Set<IOContext.FileOpenHint> hints()Any hints on how the file will be opened -
hints
Finds all hints of typecls -
withHints
Returns an IOContext with the given hints, if it makes sense to do so for this specific context. Otherwise, returns this context.The returned context has the same
context(),mergeInfo(), andflushInfo()as this context.This instance is immutable and unaffected by this method call.
-