|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.codecs.lucene40.values.Bytes
public final class Bytes
Provides concrete Writer/Reader implementations for byte[] value per
document. There are 6 package-private default implementations of this, for
all combinations of Bytes.Mode.DEREF
/Bytes.Mode.STRAIGHT
x fixed-length/variable-length.
NOTE: Currently the total amount of byte[] data stored (across a single segment) cannot exceed 2GB.
NOTE: Each byte[] must be <= 32768 bytes in length
Nested Class Summary | |
---|---|
static class |
Bytes.Mode
Defines the Writer s store mode. |
Method Summary | |
---|---|
static DocValues |
getValues(Directory dir,
String id,
Bytes.Mode mode,
boolean fixedSize,
int maxDoc,
Comparator<BytesRef> sortComparator,
IOContext context)
Creates a new DocValues instance that provides either memory
resident or iterative access to a per-document stored byte[]
value. |
static DocValuesConsumer |
getWriter(Directory dir,
String id,
Bytes.Mode mode,
boolean fixedSize,
Comparator<BytesRef> sortComparator,
Counter bytesUsed,
IOContext context,
float acceptableOverheadRatio)
Creates a new byte[] Writer instances for the given
directory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static DocValuesConsumer getWriter(Directory dir, String id, Bytes.Mode mode, boolean fixedSize, Comparator<BytesRef> sortComparator, Counter bytesUsed, IOContext context, float acceptableOverheadRatio)
Writer
instances for the given
directory.
dir
- the directory to write the values toid
- the id used to create a unique file name. Usually composed out of
the segment name and a unique id per segment.mode
- the writers store modefixedSize
- true
if all bytes subsequently passed to the
Writer
will have the same lengthsortComparator
- BytesRef
comparator used by sorted variants.
If null
BytesRef.getUTF8SortedAsUnicodeComparator()
is used insteadbytesUsed
- an AtomicLong
instance to track the used bytes within the
Writer
. A call to DocValuesConsumer.finish(int)
will release
all internally used resources and frees the memory tracking
reference.acceptableOverheadRatio
- how to trade space for speed. This option is only applicable for
docvalues of type DocValues.Type.BYTES_FIXED_SORTED
and
DocValues.Type.BYTES_VAR_SORTED
.context
- I/O Context
Writer
instancePackedInts.getReader(org.apache.lucene.store.DataInput)
public static DocValues getValues(Directory dir, String id, Bytes.Mode mode, boolean fixedSize, int maxDoc, Comparator<BytesRef> sortComparator, IOContext context) throws IOException
DocValues
instance that provides either memory
resident or iterative access to a per-document stored byte[]
value. The returned DocValues
instance will be initialized without
consuming a significant amount of memory.
dir
- the directory to load the DocValues
from.id
- the file ID in the Directory
to load the values from.mode
- the mode used to store the valuesfixedSize
- true
iff the values are stored with fixed-size,
otherwise false
maxDoc
- the number of document values stored for the given IDsortComparator
- BytesRef
comparator used by sorted variants.
If null
BytesRef.getUTF8SortedAsUnicodeComparator()
is used instead
DocValues
instance.
IOException
- if an IOException
occurs
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |