public class StoreFileMetaData extends Object implements Streamable
Constructor and Description |
---|
StoreFileMetaData(String name,
long length) |
StoreFileMetaData(String name,
long length,
String checksum) |
StoreFileMetaData(String name,
long length,
String checksum,
org.apache.lucene.util.Version writtenBy) |
StoreFileMetaData(String name,
long length,
String checksum,
org.apache.lucene.util.Version writtenBy,
org.apache.lucene.util.BytesRef hash) |
Modifier and Type | Method and Description |
---|---|
String |
checksum()
Returns a string representation of the files checksum.
|
org.apache.lucene.util.BytesRef |
hash()
Returns a variable length hash of the file represented by this metadata object.
|
boolean |
hasLegacyChecksum()
Returns
true iff the checksum is not null and if the file has NOT been written by
a Lucene version greater or equal to Lucene 4.8 |
boolean |
isSame(StoreFileMetaData other)
Returns
true iff the length and the checksums are the same. |
long |
length()
the actual file size on "disk", if compressed, the compressed size
|
String |
name()
Returns the name of this file
|
void |
readFrom(StreamInput in) |
static StoreFileMetaData |
readStoreFileMetaData(StreamInput in) |
String |
toString() |
void |
writeTo(StreamOutput out) |
org.apache.lucene.util.Version |
writtenBy()
Returns the Lucene version this file has been written by or
null if unknown |
public StoreFileMetaData(String name, long length)
public StoreFileMetaData(String name, long length, String checksum, org.apache.lucene.util.Version writtenBy)
public String name()
public long length()
@Nullable public String checksum()
hasLegacyChecksum()
returns
true
this is a Adler32 checksum.public boolean isSame(StoreFileMetaData other)
true
iff the length and the checksums are the same. otherwise false
public static StoreFileMetaData readStoreFileMetaData(StreamInput in) throws IOException
IOException
public void readFrom(StreamInput in) throws IOException
readFrom
in interface Streamable
IOException
public void writeTo(StreamOutput out) throws IOException
writeTo
in interface Streamable
IOException
public org.apache.lucene.util.Version writtenBy()
null
if unknownpublic boolean hasLegacyChecksum()
true
iff the checksum is not null
and if the file has NOT been written by
a Lucene version greater or equal to Lucene 4.8public org.apache.lucene.util.BytesRef hash()
Copyright © 2009–2016. All rights reserved.