mirror of https://github.com/apache/lucene.git
Cleanup Javadocs of IOContext and use simpler ctor for DEFAULT (#13247)
This commit is contained in:
parent
11eb0cc317
commit
ce978d7646
|
@ -20,8 +20,8 @@ import java.util.Arrays;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IOContext holds additional details on the merge/search context. A IOContext object can never be
|
* IOContext holds additional details on the merge/search context. An IOContext object can never be
|
||||||
* initialized as null as passed as a parameter to either {@link
|
* passed as a {@code null} parameter to either {@link
|
||||||
* org.apache.lucene.store.Directory#openInput(String, IOContext)} or {@link
|
* org.apache.lucene.store.Directory#openInput(String, IOContext)} or {@link
|
||||||
* org.apache.lucene.store.Directory#createOutput(String, IOContext)}
|
* org.apache.lucene.store.Directory#createOutput(String, IOContext)}
|
||||||
*
|
*
|
||||||
|
@ -45,9 +45,13 @@ public record IOContext(
|
||||||
DEFAULT
|
DEFAULT
|
||||||
};
|
};
|
||||||
|
|
||||||
public static final IOContext DEFAULT =
|
/**
|
||||||
new IOContext(Context.DEFAULT, null, null, ReadAdvice.NORMAL);
|
* A default context for normal reads/writes. Use {@link #withReadAdvice(ReadAdvice)} to specify
|
||||||
|
* another {@link ReadAdvice}.
|
||||||
|
*/
|
||||||
|
public static final IOContext DEFAULT = new IOContext(ReadAdvice.NORMAL);
|
||||||
|
|
||||||
|
/** A default context for reads with {@link ReadAdvice#SEQUENTIAL}. */
|
||||||
public static final IOContext READONCE = new IOContext(ReadAdvice.SEQUENTIAL);
|
public static final IOContext READONCE = new IOContext(ReadAdvice.SEQUENTIAL);
|
||||||
|
|
||||||
private static final IOContext[] DEFAULT_READADVICE_CACHE =
|
private static final IOContext[] DEFAULT_READADVICE_CACHE =
|
||||||
|
@ -73,16 +77,17 @@ public record IOContext(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Creates a default {@link IOContext} for reading/writing with the given {@link ReadAdvice} */
|
||||||
private IOContext(ReadAdvice accessAdvice) {
|
private IOContext(ReadAdvice accessAdvice) {
|
||||||
this(Context.DEFAULT, null, null, accessAdvice);
|
this(Context.DEFAULT, null, null, accessAdvice);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Creates an IOContext for flushing. */
|
/** Creates an {@link IOContext} for flushing. */
|
||||||
public IOContext(FlushInfo flushInfo) {
|
public IOContext(FlushInfo flushInfo) {
|
||||||
this(Context.FLUSH, null, flushInfo, ReadAdvice.NORMAL);
|
this(Context.FLUSH, null, flushInfo, ReadAdvice.NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Creates an IOContext for merging. */
|
/** Creates an {@link IOContext} for merging. */
|
||||||
public IOContext(MergeInfo mergeInfo) {
|
public IOContext(MergeInfo mergeInfo) {
|
||||||
// Merges read input segments sequentially.
|
// Merges read input segments sequentially.
|
||||||
this(Context.MERGE, mergeInfo, null, ReadAdvice.SEQUENTIAL);
|
this(Context.MERGE, mergeInfo, null, ReadAdvice.SEQUENTIAL);
|
||||||
|
|
Loading…
Reference in New Issue