From f8dbe09c06230426465304fde4604f8fefaae802 Mon Sep 17 00:00:00 2001 From: bansvaru Date: Wed, 7 Jun 2023 20:55:28 +0530 Subject: [PATCH] spotless fixes --- .../index/translog/RemoteFSTranslogTests.java | 43 +++---------------- 1 file changed, 7 insertions(+), 36 deletions(-) diff --git a/server/src/test/java/org/opensearch/index/translog/RemoteFSTranslogTests.java b/server/src/test/java/org/opensearch/index/translog/RemoteFSTranslogTests.java index 57e193d8b886e..94b2f58ecd066 100644 --- a/server/src/test/java/org/opensearch/index/translog/RemoteFSTranslogTests.java +++ b/server/src/test/java/org/opensearch/index/translog/RemoteFSTranslogTests.java @@ -484,15 +484,11 @@ public void testSimpleOperationsUpload() throws Exception { translog.rollGeneration(); assertEquals(6, translog.allUploaded().size()); - Set mdFiles = blobStoreTransferService.listAll( - getTranslogDirectory().add("metadata") - ); + Set mdFiles = blobStoreTransferService.listAll(getTranslogDirectory().add("metadata")); assertEquals(2, mdFiles.size()); logger.info("All md files {}", mdFiles); - Set tlogFiles = blobStoreTransferService.listAll( - getTranslogDirectory().add("data").add(String.valueOf(primaryTerm.get())) - ); + Set tlogFiles = blobStoreTransferService.listAll(getTranslogDirectory().add("data").add(String.valueOf(primaryTerm.get()))); logger.info("All data files {}", tlogFiles); // assert content of ckp and tlog files @@ -590,14 +586,7 @@ public void testMetadataFileDeletion() throws Exception { assertEquals(1, translog.readers.size()); } assertBusy(() -> assertEquals(4, translog.allUploaded().size())); - assertBusy( - () -> assertEquals( - 2, - blobStoreTransferService.listAll( - getTranslogDirectory().add(METADATA_DIR) - ).size() - ) - ); + assertBusy(() -> assertEquals(2, blobStoreTransferService.listAll(getTranslogDirectory().add(METADATA_DIR)).size())); int moreDocs = randomIntBetween(3, 10); logger.info("numDocs={} moreDocs={}", numDocs, moreDocs); for (int i = numDocs; i < numDocs + moreDocs; i++) { @@ -606,14 +595,7 @@ public void testMetadataFileDeletion() throws Exception { translog.trimUnreferencedReaders(); assertEquals(1 + moreDocs, translog.readers.size()); assertBusy(() -> assertEquals(2 + 2L * moreDocs, translog.allUploaded().size())); - assertBusy( - () -> assertEquals( - 1 + moreDocs, - blobStoreTransferService.listAll( - getTranslogDirectory().add(METADATA_DIR) - ).size() - ) - ); + assertBusy(() -> assertEquals(1 + moreDocs, blobStoreTransferService.listAll(getTranslogDirectory().add(METADATA_DIR)).size())); int totalDocs = numDocs + moreDocs; translog.setMinSeqNoToKeep(totalDocs - 1); @@ -626,14 +608,7 @@ public void testMetadataFileDeletion() throws Exception { ); translog.setMinSeqNoToKeep(totalDocs); translog.trimUnreferencedReaders(); - assertBusy( - () -> assertEquals( - 2, - blobStoreTransferService.listAll( - getTranslogDirectory().add(METADATA_DIR) - ).size() - ) - ); + assertBusy(() -> assertEquals(2, blobStoreTransferService.listAll(getTranslogDirectory().add(METADATA_DIR)).size())); // Change primary term and test the deletion of older primaries String translogUUID = translog.translogUUID; @@ -649,9 +624,7 @@ public void testMetadataFileDeletion() throws Exception { long newPrimaryTerm = primaryTerm.incrementAndGet(); // Check all metadata files corresponds to old primary term - Set mdFileNames = blobStoreTransferService.listAll( - getTranslogDirectory().add(METADATA_DIR) - ); + Set mdFileNames = blobStoreTransferService.listAll(getTranslogDirectory().add(METADATA_DIR)); assertTrue(mdFileNames.stream().allMatch(name -> name.startsWith(String.valueOf(oldPrimaryTerm).concat("__")))); // Creating RemoteFsTranslog with the same location @@ -665,9 +638,7 @@ public void testMetadataFileDeletion() throws Exception { } // Check that all metadata files are belonging now to the new primary - mdFileNames = blobStoreTransferService.listAll( - getTranslogDirectory().add(METADATA_DIR) - ); + mdFileNames = blobStoreTransferService.listAll(getTranslogDirectory().add(METADATA_DIR)); assertTrue(mdFileNames.stream().allMatch(name -> name.startsWith(String.valueOf(newPrimaryTerm).concat("__")))); try {