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,
Map<String,String> commitUserData,
long numDocs) |
MetadataSnapshot(StreamInput input) |
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) |
Map<String,String> |
getCommitUserData() |
long |
getNumDocs()
Returns the number of documents in this store snapshot
|
StoreFileMetaData |
getSegmentsFile()
Returns the segments file that this metadata snapshot represents or null if the snapshot is empty.
|
String |
getSyncId()
Returns the sync id of the commit point that this MetadataSnapshot represents.
|
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() |
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, Map<String,String> commitUserData, long numDocs)
public MetadataSnapshot(StreamInput input) throws IOException
IOException
public long getNumDocs()
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 void writeTo(StreamOutput out) throws IOException
writeTo
in interface Streamable
IOException
public boolean contains(String existingFile)
public StoreFileMetaData getSegmentsFile()
public String getSyncId()
public void readFrom(StreamInput in) throws IOException
readFrom
in interface Streamable
IOException
Copyright © 2009–2016. All rights reserved.