public class BlobStoreIndexShardSnapshots extends Object implements Iterable<SnapshotFiles>, ToXContent, FromXContentBuilder<BlobStoreIndexShardSnapshots>
This class is used to find files that were already snapshoted and clear out files that no longer referenced by any snapshots
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
static BlobStoreIndexShardSnapshots |
PROTO |
EMPTY_PARAMS
Constructor and Description |
---|
BlobStoreIndexShardSnapshots(List<SnapshotFiles> shardSnapshots) |
Modifier and Type | Method and Description |
---|---|
BlobStoreIndexShardSnapshot.FileInfo |
findNameFile(String name)
Finds reference to a snapshotted file by its snapshot name
|
List<BlobStoreIndexShardSnapshot.FileInfo> |
findPhysicalIndexFiles(String physicalName)
Finds reference to a snapshotted file by its original name
|
BlobStoreIndexShardSnapshots |
fromXContent(XContentParser parser,
ParseFieldMatcher parseFieldMatcher)
Parses an object with the type T from parser
|
Iterator<SnapshotFiles> |
iterator() |
List<SnapshotFiles> |
snapshots()
Returns list of snapshots
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params)
Writes index file for the shard in the following format.
|
public static final BlobStoreIndexShardSnapshots PROTO
public BlobStoreIndexShardSnapshots(List<SnapshotFiles> shardSnapshots)
public List<SnapshotFiles> snapshots()
public List<BlobStoreIndexShardSnapshot.FileInfo> findPhysicalIndexFiles(String physicalName)
physicalName
- original namepublic BlobStoreIndexShardSnapshot.FileInfo findNameFile(String name)
name
- file namepublic Iterator<SnapshotFiles> iterator()
iterator
in interface Iterable<SnapshotFiles>
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
{
"files": [{
"name": "__3",
"physical_name": "_0.si",
"length": 310,
"checksum": "1tpsg3p",
"written_by": "5.1.0",
"meta_hash": "P9dsFxNMdWNlb......"
}, {
"name": "__2",
"physical_name": "segments_2",
"length": 150,
"checksum": "11qjpz6",
"written_by": "5.1.0",
"meta_hash": "P9dsFwhzZWdtZ......."
}, {
"name": "__1",
"physical_name": "_0.cfe",
"length": 363,
"checksum": "er9r9g",
"written_by": "5.1.0"
}, {
"name": "__0",
"physical_name": "_0.cfs",
"length": 3354,
"checksum": "491liz",
"written_by": "5.1.0"
}, {
"name": "__4",
"physical_name": "segments_3",
"length": 150,
"checksum": "134567",
"written_by": "5.1.0",
"meta_hash": "P9dsFwhzZWdtZ......."
}],
"snapshots": {
"snapshot_1": {
"files": ["__0", "__1", "__2", "__3"]
},
"snapshot_2": {
"files": ["__0", "__1", "__2", "__4"]
}
}
}
}
toXContent
in interface ToXContent
IOException
public BlobStoreIndexShardSnapshots fromXContent(XContentParser parser, ParseFieldMatcher parseFieldMatcher) throws IOException
FromXContentBuilder
fromXContent
in interface FromXContentBuilder<BlobStoreIndexShardSnapshots>
IOException
Copyright © 2009–2016. All rights reserved.