public final class SnapshotInfo extends java.lang.Object implements java.lang.Comparable<SnapshotInfo>, ToXContent, Writeable
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Writeable.Reader<V>, Writeable.Writer<V>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONTEXT_MODE_PARAM |
static java.lang.String |
CONTEXT_MODE_SNAPSHOT |
EMPTY_PARAMS
Constructor and Description |
---|
SnapshotInfo(SnapshotId snapshotId,
java.util.List<java.lang.String> indices,
long startTime) |
SnapshotInfo(SnapshotId snapshotId,
java.util.List<java.lang.String> indices,
long startTime,
java.lang.String reason,
long endTime,
int totalShards,
java.util.List<SnapshotShardFailure> shardFailures) |
SnapshotInfo(StreamInput in)
Constructs snapshot information from stream input
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(SnapshotInfo o)
Compares two snapshots by their start time
|
long |
endTime()
Returns time when snapshot ended
|
boolean |
equals(java.lang.Object o) |
int |
failedShards()
Number of failed shards
|
static SnapshotInfo |
fromXContent(XContentParser parser)
This method creates a SnapshotInfo from internal x-content.
|
int |
hashCode() |
static SnapshotInfo |
incompatible(SnapshotId snapshotId)
Gets a new
SnapshotInfo instance for a snapshot that is incompatible with the
current version of the cluster. |
java.util.List<java.lang.String> |
indices()
Returns indices that were included into this snapshot
|
java.lang.String |
reason()
Returns snapshot failure reason
|
java.util.List<SnapshotShardFailure> |
shardFailures()
Returns shard failures
|
SnapshotId |
snapshotId()
Returns snapshot id
|
long |
startTime()
Returns time when snapshot started
|
SnapshotState |
state()
Returns snapshot state
|
RestStatus |
status()
Returns snapshot REST status
|
int |
successfulShards()
Returns total number of shards that were successfully snapshotted
|
java.lang.String |
toString() |
int |
totalShards()
Returns total number of shards that were snapshotted
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
Version |
version()
Returns the version of elasticsearch that the snapshot was created with.
|
void |
writeTo(StreamOutput out)
Write this into the StreamOutput.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isFragment
public static final java.lang.String CONTEXT_MODE_PARAM
public static final java.lang.String CONTEXT_MODE_SNAPSHOT
public SnapshotInfo(SnapshotId snapshotId, java.util.List<java.lang.String> indices, long startTime)
public SnapshotInfo(SnapshotId snapshotId, java.util.List<java.lang.String> indices, long startTime, java.lang.String reason, long endTime, int totalShards, java.util.List<SnapshotShardFailure> shardFailures)
public SnapshotInfo(StreamInput in) throws java.io.IOException
java.io.IOException
public static SnapshotInfo incompatible(SnapshotId snapshotId)
SnapshotInfo
instance for a snapshot that is incompatible with the
current version of the cluster.public SnapshotId snapshotId()
public SnapshotState state()
public java.lang.String reason()
public java.util.List<java.lang.String> indices()
public long startTime()
public long endTime()
Can be 0L if snapshot is still running
public int totalShards()
public int failedShards()
public int successfulShards()
public java.util.List<SnapshotShardFailure> shardFailures()
@Nullable public Version version()
null
if state()
returns SnapshotState.INCOMPATIBLE
.public int compareTo(SnapshotInfo o)
compareTo
in interface java.lang.Comparable<SnapshotInfo>
o
- other snapshot0
if snapshots were created at the same time;
a value less than 0
if this snapshot was created before snapshot o
; and
a value greater than 0
if this snapshot was created after snapshot o
;public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public RestStatus status()
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException
public static SnapshotInfo fromXContent(XContentParser parser) throws java.io.IOException
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Writeable