public final class SegmentInfo
extends
Modifier and Type | Field and Description |
---|---|
Directory |
dir
Where this segment resides.
|
|
name
Unique segment name in the directory.
|
static int |
NO
Used by some member fields to mean not present (e.g.,
norms, deletions).
|
static int |
YES
Used by some member fields to mean present (e.g.,
norms, deletions).
|
Constructor and Description |
---|
SegmentInfo(Directory dir,
Version version,
Version minVersion,
name,
int maxDoc,
boolean isCompoundFile,
Codec codec,
<,> diagnostics,
byte[] id,
<,> attributes,
Sort indexSort)
Construct a new complete SegmentInfo instance from input.
|
Modifier and Type | Method and Description |
---|---|
void |
file)
Add this file to the set of files written for this
segment.
|
void |
<> files)
Add these files to the set of files written for this
segment.
|
boolean |
obj)
We consider another SegmentInfo instance equal if it
has the same dir and same name.
|
<> |
files()
Return all files referenced by this SegmentInfo.
|
|
key)
Get a codec attribute value, or null if it does not exist
|
<,> |
getAttributes()
Returns the internal codec attributes map.
|
Codec |
getCodec()
Return
Codec that wrote this segment. |
<,> |
getDiagnostics()
Returns diagnostics saved into the segment when it was
written.
|
byte[] |
getId()
Return the id that uniquely identifies this segment.
|
Sort |
getIndexSort()
Return the sort order of this segment, or null if the index has no sort.
|
Version |
getMinVersion()
Return the minimum Lucene version that contributed documents to this
segment, or
null if it is unknown. |
boolean |
getUseCompoundFile()
Returns true if this segment is stored as a compound
file; else, false.
|
Version |
getVersion()
Returns the version of the code which wrote the segment.
|
int |
hashCode() |
int |
maxDoc()
Returns number of documents in this segment (deletions
are not taken into account).
|
|
key,
value)
Puts a codec attribute value.
|
void |
setCodec(Codec codec)
Can only be called once.
|
void |
<> files)
Sets the files written for this segment.
|
|
toString() |
|
toString(int delCount)
Used for debugging.
|
public static final int NO
public static final int YES
public final name
public final Directory dir
public SegmentInfo(Directory dir, Version version, Version minVersion, name, int maxDoc, boolean isCompoundFile, Codec codec, <,> diagnostics, byte[] id, <,> attributes, Sort indexSort)
Note: this is public only to allow access from the codecs package.
public <,> getDiagnostics()
public boolean getUseCompoundFile()
public void setCodec(Codec codec)
public int maxDoc()
public <> files()
public toString()
in class
public toString(int delCount)
Current format looks like
_a(3.1):c45/4:[sorter=<long: "timestamp">!]
, which means
the segment's name is _a
; it was created with Lucene 3.1 (or
'?' if it's unknown); it's using compound file
format (would be C
if not compound); it
has 45 documents; it has 4 deletions (this part is
left off when there are no deletions); it is sorted by the timestamp field
in descending order (this part is omitted for unsorted segments).
public boolean equals( obj)
in class
public int hashCode()
in class
public Version getVersion()
public Version getMinVersion()
null
if it is unknown.public byte[] getId()
public void setFiles(<> files)
public void addFiles(<> files)
public void addFile( file)
public getAttribute( key)
public putAttribute( key, value)
This is a key-value mapping for the field that the codec can use to store
additional metadata, and will be available to the codec when reading the
segment via getAttribute(String)
If a value already exists for the field, it will be replaced with the new value. This method make a copy on write for every attribute change.
public <,> getAttributes()
public Sort getIndexSort()
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.