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 |
static Version |
VERBOSE_INTRODUCED |
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(SnapshotId snapshotId,
java.util.List<java.lang.String> indices,
SnapshotState state) |
SnapshotInfo(StreamInput in)
Constructs snapshot information from stream input
|
Modifier and Type | Method and Description |
---|---|
SnapshotInfo |
basic()
Gets a new
SnapshotInfo instance from the given SnapshotInfo with
all information stripped out except the snapshot id, state, and indices. |
int |
compareTo(SnapshotInfo o)
Compares two snapshots by their start time; if the start times are the same, then
compares the two snapshots by their snapshot ids.
|
long |
endTime()
Returns time when snapshot ended; a value of
0L will be returned if the
snapshot is still running or if state() returns null . |
boolean |
equals(java.lang.Object o) |
int |
failedShards()
Number of failed shards; a value of
0 will be returned if there were no
failed shards, or if state() returns null . |
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 in this snapshot.
|
java.lang.String |
reason()
Returns snapshot failure reason;
null if the snapshot succeeded. |
java.util.List<SnapshotShardFailure> |
shardFailures()
Returns shard failures; an empty list will be returned if there were no shard
failures, or if
state() returns null . |
SnapshotId |
snapshotId()
Returns snapshot id
|
long |
startTime()
|
SnapshotState |
state()
Returns snapshot state;
null if the state is unknown. |
RestStatus |
status()
Returns snapshot REST status
|
int |
successfulShards()
Returns total number of shards that were successfully snapshotted; a value of
0 will be returned if state() returns null . |
java.lang.String |
toString() |
int |
totalShards()
Returns total number of shards that were snapshotted; a value of
0 will
be returned if state() returns null . |
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 static final Version VERBOSE_INTRODUCED
public SnapshotInfo(SnapshotId snapshotId, java.util.List<java.lang.String> indices, SnapshotState state)
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 SnapshotInfo basic()
SnapshotInfo
instance from the given SnapshotInfo
with
all information stripped out except the snapshot id, state, and indices.public SnapshotId snapshotId()
@Nullable public SnapshotState state()
null
if the state is unknown.@Nullable public java.lang.String reason()
null
if the snapshot succeeded.public java.util.List<java.lang.String> indices()
public long startTime()
public long endTime()
0L
will be returned if the
snapshot is still running or if state()
returns null
.public int totalShards()
0
will
be returned if state()
returns null
.public int failedShards()
0
will be returned if there were no
failed shards, or if state()
returns null
.public int successfulShards()
0
will be returned if state()
returns null
.public java.util.List<SnapshotShardFailure> shardFailures()
state()
returns null
.@Nullable public Version version()
null
if state()
returns null
or SnapshotState.INCOMPATIBLE
.public int compareTo(SnapshotInfo o)
compareTo
in interface java.lang.Comparable<SnapshotInfo>
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