Skip to content

Commit 7a88397

Browse files
committed
Better formatting
1 parent 7f259d7 commit 7a88397

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

server/src/main/java/org/elasticsearch/repositories/blobstore/MetadataVerifier.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ private void verifyIndices() {
199199
final var name = indicesEntry.getKey();
200200
final var indexId = indicesEntry.getValue();
201201
if (name.equals(indexId.getName()) == false) {
202-
addFailure("index name [%s] has mismatched name in [%s]", name, indexId);
202+
addFailure("index name [%s] has mismatched name in %s", name, indexId);
203203
}
204204
}
205205

@@ -242,7 +242,7 @@ void run() {
242242

243243
private void verifyIndexSnapshot(RefCounted indexSnapshotRefs, SnapshotId snapshotId) {
244244
if (expectedSnapshots.contains(snapshotId) == false) {
245-
addFailure("index [%s] has mismatched snapshot [%s]", indexId, snapshotId);
245+
addFailure("index %s has mismatched snapshot [%s]", indexId, snapshotId);
246246
}
247247

248248
final var indexMetaBlobId = repositoryData.indexMetaDataGenerations().indexMetaBlobId(snapshotId, indexId);
@@ -291,7 +291,7 @@ private BlobStoreIndexShardSnapshot getBlobStoreIndexShardSnapshot(SnapshotId sn
291291
addFailure(
292292
new RepositoryVerificationException(
293293
repositoryName,
294-
format("failed to load shard %s/%d snapshot for %s", indexId, shardId, snapshotId),
294+
format("failed to load shard %s[%d] snapshot for [%s]", indexId, shardId, snapshotId),
295295
e
296296
)
297297
);
@@ -306,7 +306,7 @@ private int getNumberOfShards(String indexMetaBlobId, SnapshotId snapshotId) {
306306
addFailure(
307307
new RepositoryVerificationException(
308308
repositoryName,
309-
format("failed to load index %s metadata for %s from blob [%s]", indexId, snapshotId, indexMetaBlobId),
309+
format("failed to load index %s metadata for [%s] from blob [%s]", indexId, snapshotId, indexMetaBlobId),
310310
e
311311
)
312312
);
@@ -317,7 +317,7 @@ private int getNumberOfShards(String indexMetaBlobId, SnapshotId snapshotId) {
317317
private BlobStoreIndexShardSnapshots getBlobStoreIndexShardSnapshots(int shardId) {
318318
final var shardGen = repositoryData.shardGenerations().getShardGen(indexId, shardId);
319319
if (shardGen == null) {
320-
addFailure("unknown shard generation for %s/%d", indexId, shardId);
320+
addFailure("unknown shard generation for %s[%d]", indexId, shardId);
321321
return null;
322322
}
323323
try {
@@ -340,7 +340,7 @@ private void verifyShardSnapshot(
340340

341341
if (shardSnapshot.snapshot().equals(snapshotId.getName()) == false) {
342342
addFailure(
343-
"snapshot [%s] for shard [%s/%d] has mismatched name [%s]",
343+
"snapshot [%s] for shard %s[%d] has mismatched name [%s]",
344344
snapshotId,
345345
indexId,
346346
shardId,
@@ -364,7 +364,7 @@ private void verifyShardSnapshot(
364364
}
365365

366366
if (foundSnapshot == false) {
367-
addFailure("snapshot [%s] for shard [%s/%d] has no entry in the shard-level summary", snapshotId, indexId, shardId);
367+
addFailure("snapshot [%s] for shard %s[%d] has no entry in the shard-level summary", snapshotId, indexId, shardId);
368368
}
369369
}
370370
}
@@ -383,15 +383,15 @@ private void verifyConsistentShardFiles(
383383
final var snapshotFile = snapshotFiles.get(summaryFile.physicalName());
384384
if (snapshotFile == null) {
385385
addFailure(
386-
"snapshot [%s] for shard [%s/%d] has no entry for file [%s] found in summary",
386+
"snapshot [%s] for shard %s[%d] has no entry for file [%s] found in summary",
387387
snapshotId,
388388
indexId,
389389
shardId,
390390
summaryFile.physicalName()
391391
);
392392
} else if (summaryFile.isSame(snapshotFile) == false) {
393393
addFailure(
394-
"snapshot [%s] for shard [%s/%d] has a mismatched entry for file [%s]",
394+
"snapshot [%s] for shard %s[%d] has a mismatched entry for file [%s]",
395395
snapshotId,
396396
indexId,
397397
shardId,
@@ -406,7 +406,7 @@ private void verifyConsistentShardFiles(
406406
for (final var snapshotFile : shardSnapshot.indexFiles()) {
407407
if (summaryFiles.get(snapshotFile.physicalName()) == null) {
408408
addFailure(
409-
"snapshot [%s] for shard [%s/%d] has no entry in the shard-level summary for file [%s]",
409+
"snapshot [%s] for shard %s[%d] has no entry in the shard-level summary for file [%s]",
410410
snapshotId,
411411
indexId,
412412
shardId,
@@ -435,7 +435,7 @@ private void verifyFileInfo(
435435
final var actualLength = ByteSizeValue.ofBytes(fileInfo.metadata().hash().length);
436436
if (fileLength.getBytes() != actualLength.getBytes()) {
437437
addFailure(
438-
"snapshot [%s] for shard [%s/%d] has virtual blob [%s] for [%s] with length [%s] instead of [%s]",
438+
"snapshot [%s] for shard %s[%d] has virtual blob [%s] for [%s] with length [%s] instead of [%s]",
439439
snapshot,
440440
indexId,
441441
shardId,
@@ -452,7 +452,7 @@ private void verifyFileInfo(
452452
final var partLength = ByteSizeValue.ofBytes(fileInfo.partBytes(part));
453453
if (blobInfo == null) {
454454
addFailure(
455-
"snapshot [%s] for shard [%s/%d] has missing blob [%s] for [%s] part [%d/%d]; "
455+
"snapshot [%s] for shard %s[%d] has missing blob [%s] for [%s] part [%d/%d]; "
456456
+ "file length [%s], part length [%s]",
457457
snapshot,
458458
indexId,
@@ -467,7 +467,7 @@ private void verifyFileInfo(
467467

468468
} else if (blobInfo.length() != partLength.getBytes()) {
469469
addFailure(
470-
"snapshot [%s] for shard [%s/%d] has blob [%s] for [%s] part [%d/%d] with length [%s] instead of [%s]; "
470+
"snapshot [%s] for shard %s[%d] has blob [%s] for [%s] part [%d/%d] with length [%s] instead of [%s]; "
471471
+ "file length [%s]",
472472
snapshot,
473473
indexId,

0 commit comments

Comments
 (0)