Class IOContext

java.lang.Object
org.apache.lucene.store.IOContext

public class IOContext extends Object
IOContext holds additional details on the merge/search context. A IOContext object can never be initialized as null as passed as a parameter to either Directory.openInput(String, IOContext) or Directory.createOutput(String, IOContext)
  • Field Details

    • context

      public final IOContext.Context context
      An object of a enumerator Context type
    • mergeInfo

      public final MergeInfo mergeInfo
    • flushInfo

      public final FlushInfo flushInfo
    • readOnce

      public final boolean readOnce
      This flag indicates that the file will be opened, then fully read sequentially then closed.
    • randomAccess

      public final boolean randomAccess
      This flag indicates that the file will be accessed randomly. If this flag is set, then readOnce will be false.
    • load

      public final boolean load
      This flag is used for files that are a small fraction of the total index size and are expected to be heavily accessed in random-access fashion. Some Directory implementations may choose to load such files into physical memory (e.g. Java heap) as a way to provide stronger guarantees on query latency. If this flag is set, then randomAccess will be true.
    • DEFAULT

      public static final IOContext DEFAULT
    • READONCE

      public static final IOContext READONCE
      This context indicates that the file will be opened, then fully read sequentially then closed.

      The read operations will be performed in the same thread as the thread that opens the underlying storage.

    • READ

      public static final IOContext READ
    • LOAD

      public static final IOContext LOAD
    • RANDOM

      public static final IOContext RANDOM
  • Constructor Details

    • IOContext

      public IOContext()
    • IOContext

      public IOContext(FlushInfo flushInfo)
    • IOContext

      public IOContext(IOContext.Context context)
    • IOContext

      private IOContext(boolean readOnce, boolean load, boolean randomAccess)
    • IOContext

      public IOContext(MergeInfo mergeInfo)
    • IOContext

      private IOContext(IOContext.Context context, MergeInfo mergeInfo)
    • IOContext

      public IOContext(IOContext ctxt, boolean readOnce)
      This constructor is used to initialize a IOContext instance with a new value for the readOnce variable. This automatically sets randomAccess and load to false.
      Parameters:
      ctxt - IOContext object whose information is used to create the new instance except the readOnce variable.
      readOnce - The new IOContext object will use this value for readOnce.
  • Method Details