public static final class Store.MetadataSnapshot extends Object implements Iterable<StoreFileMetaData>, Streamable
StoreFileMetaData
Modifier and Type | Field and Description |
---|---|
static Store.MetadataSnapshot |
EMPTY |
Constructor and Description |
---|
MetadataSnapshot(Map<String,StoreFileMetaData> metadata) |
Modifier and Type | Method and Description |
---|---|
Map<String,StoreFileMetaData> |
asMap() |
boolean |
contains(String existingFile)
Returns true iff this metadata contains the given file.
|
StoreFileMetaData |
get(String name) |
StoreFileMetaData |
getSegmentsFile()
Returns the segments file that this metadata snapshot represents or null if the snapshot is empty.
|
static void |
hashFile(org.apache.lucene.util.BytesRefBuilder fileHash,
InputStream in,
long size)
Computes a strong hash value for small files.
|
static org.apache.lucene.util.BytesRef |
hashFile(org.apache.lucene.store.Directory directory,
String file)
Computes a strong hash value for small files.
|
Iterator<StoreFileMetaData> |
iterator() |
static Store.MetadataSnapshot |
read(StreamInput in) |
void |
readFrom(StreamInput in) |
Store.RecoveryDiff |
recoveryDiff(Store.MetadataSnapshot recoveryTargetSnapshot)
Returns a diff between the two snapshots that can be used for recovery.
|
int |
size()
Returns the number of files in this snapshot
|
void |
writeTo(StreamOutput out) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public static final Store.MetadataSnapshot EMPTY
public MetadataSnapshot(Map<String,StoreFileMetaData> metadata)
public static org.apache.lucene.util.BytesRef hashFile(org.apache.lucene.store.Directory directory, String file) throws IOException
IOException
public static void hashFile(org.apache.lucene.util.BytesRefBuilder fileHash, InputStream in, long size) throws IOException
IOException
public Iterator<StoreFileMetaData> iterator()
iterator
in interface Iterable<StoreFileMetaData>
public StoreFileMetaData get(String name)
public Map<String,StoreFileMetaData> asMap()
public Store.RecoveryDiff recoveryDiff(Store.MetadataSnapshot recoveryTargetSnapshot)
public int size()
public static Store.MetadataSnapshot read(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 boolean contains(String existingFile)
public StoreFileMetaData getSegmentsFile()
Copyright © 2009–2015. All rights reserved.