mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-27 02:18:42 +00:00
Adds toString() to snapshot operations in progress
A better toString() is added for snapshot operations in progress in the cluster state and logging has been increased to help debug SharedClusterSnapshotRestoreIT tests.
This commit is contained in:
parent
6b46334d31
commit
ce08594008
@ -89,6 +89,18 @@ public class RestoreInProgress extends AbstractNamedDiffable<Custom> implements
|
||||
return entries.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder("RestoreInProgress[");
|
||||
for (int i = 0; i < entries.size(); i++) {
|
||||
builder.append(entries.get(i).snapshot().getSnapshotId().getName());
|
||||
if (i + 1 < entries.size()) {
|
||||
builder.append(",");
|
||||
}
|
||||
}
|
||||
return builder.append("]").toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore metadata
|
||||
*/
|
||||
|
@ -150,6 +150,18 @@ public class SnapshotDeletionsInProgress extends AbstractNamedDiffable<Custom> i
|
||||
return builder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder("SnapshotDeletionsInProgress[");
|
||||
for (int i = 0; i < entries.size(); i++) {
|
||||
builder.append(entries.get(i).getSnapshot().getSnapshotId().getName());
|
||||
if (i + 1 < entries.size()) {
|
||||
builder.append(",");
|
||||
}
|
||||
}
|
||||
return builder.append("]").toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* A class representing a snapshot deletion request entry in the cluster state.
|
||||
*/
|
||||
|
@ -70,6 +70,18 @@ public class SnapshotsInProgress extends AbstractNamedDiffable<Custom> implement
|
||||
return entries.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder("SnapshotsInProgress[");
|
||||
for (int i = 0; i < entries.size(); i++) {
|
||||
builder.append(entries.get(i).snapshot().getSnapshotId().getName());
|
||||
if (i + 1 < entries.size()) {
|
||||
builder.append(",");
|
||||
}
|
||||
}
|
||||
return builder.append("]").toString();
|
||||
}
|
||||
|
||||
public static class Entry {
|
||||
private final State state;
|
||||
private final Snapshot snapshot;
|
||||
|
@ -806,6 +806,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
||||
logger.info("--> total number of simulated failures during restore: [{}]", getFailureCount("test-repo"));
|
||||
}
|
||||
|
||||
@TestLogging("org.elasticsearch.snapshots:TRACE,org.elasticsearch.cluster:TRACE")
|
||||
public void testDataFileCorruptionDuringRestore() throws Exception {
|
||||
Path repositoryLocation = randomRepoPath();
|
||||
Client client = client();
|
||||
|
Loading…
x
Reference in New Issue
Block a user