diff --git a/server/src/main/java/com/hedera/block/server/Server.java b/server/src/main/java/com/hedera/block/server/Server.java index 0bf0dd10f..702f1644b 100644 --- a/server/src/main/java/com/hedera/block/server/Server.java +++ b/server/src/main/java/com/hedera/block/server/Server.java @@ -80,7 +80,7 @@ public static void main(final String[] args) { @NonNull final BlockReader blockReader = - BlockAsDirReaderBuilder.builder(BLOCKNODE_STORAGE_ROOT_PATH_KEY, config) + BlockAsDirReaderBuilder.newBuilder(BLOCKNODE_STORAGE_ROOT_PATH_KEY, config) .build(); @NonNull diff --git a/server/src/main/java/com/hedera/block/server/persistence/storage/read/BlockAsDirReaderBuilder.java b/server/src/main/java/com/hedera/block/server/persistence/storage/read/BlockAsDirReaderBuilder.java index 356ade732..3be4e7d54 100644 --- a/server/src/main/java/com/hedera/block/server/persistence/storage/read/BlockAsDirReaderBuilder.java +++ b/server/src/main/java/com/hedera/block/server/persistence/storage/read/BlockAsDirReaderBuilder.java @@ -37,7 +37,7 @@ private BlockAsDirReaderBuilder(@NonNull final String key, @NonNull final Config } @NonNull - public static BlockAsDirReaderBuilder builder( + public static BlockAsDirReaderBuilder newBuilder( @NonNull final String key, @NonNull final Config config) { return new BlockAsDirReaderBuilder(key, config); } diff --git a/server/src/test/java/com/hedera/block/server/BlockStreamServiceIT.java b/server/src/test/java/com/hedera/block/server/BlockStreamServiceIT.java index 2787979c4..83cbf5c32 100644 --- a/server/src/test/java/com/hedera/block/server/BlockStreamServiceIT.java +++ b/server/src/test/java/com/hedera/block/server/BlockStreamServiceIT.java @@ -499,7 +499,7 @@ public void testMediatorExceptionHandlingWhenPersistenceFailure() throws IOExcep // Now verify the block was removed from the file system. final BlockReader blockReader = - BlockAsDirReaderBuilder.builder(JUNIT, testConfig).build(); + BlockAsDirReaderBuilder.newBuilder(JUNIT, testConfig).build(); final Optional blockOpt = blockReader.read(1); assertTrue(blockOpt.isEmpty()); diff --git a/server/src/test/java/com/hedera/block/server/BlockStreamServiceTest.java b/server/src/test/java/com/hedera/block/server/BlockStreamServiceTest.java index ddaf48a87..893325891 100644 --- a/server/src/test/java/com/hedera/block/server/BlockStreamServiceTest.java +++ b/server/src/test/java/com/hedera/block/server/BlockStreamServiceTest.java @@ -141,7 +141,7 @@ public void testProto() throws IOException, NoSuchAlgorithmException { void testSingleBlockHappyPath() throws IOException { final BlockReader blockReader = - BlockAsDirReaderBuilder.builder(JUNIT, testConfig).build(); + BlockAsDirReaderBuilder.newBuilder(JUNIT, testConfig).build(); final BlockNodeContext blockNodeContext = BlockNodeContextFactory.create(); final BlockStreamService blockStreamService = new BlockStreamService( diff --git a/server/src/test/java/com/hedera/block/server/persistence/storage/BlockAsDirRemoverTest.java b/server/src/test/java/com/hedera/block/server/persistence/storage/BlockAsDirRemoverTest.java index b6fbaff5a..2c871f611 100644 --- a/server/src/test/java/com/hedera/block/server/persistence/storage/BlockAsDirRemoverTest.java +++ b/server/src/test/java/com/hedera/block/server/persistence/storage/BlockAsDirRemoverTest.java @@ -81,7 +81,7 @@ public void testRemoveNonExistentBlock() throws IOException { // Verify the block was not removed final BlockReader blockReader = - BlockAsDirReaderBuilder.builder(JUNIT, testConfig).build(); + BlockAsDirReaderBuilder.newBuilder(JUNIT, testConfig).build(); Optional blockOpt = blockReader.read(1); assert (blockOpt.isPresent()); assertEquals( @@ -114,7 +114,7 @@ public void testRemoveBlockWithPermException() throws IOException { // Verify the block was not removed final BlockReader blockReader = - BlockAsDirReaderBuilder.builder(JUNIT, testConfig).build(); + BlockAsDirReaderBuilder.newBuilder(JUNIT, testConfig).build(); Optional blockOpt = blockReader.read(1); assert (blockOpt.isPresent()); assertEquals( diff --git a/server/src/test/java/com/hedera/block/server/persistence/storage/read/BlockAsDirReaderTest.java b/server/src/test/java/com/hedera/block/server/persistence/storage/read/BlockAsDirReaderTest.java index 7cf975bcb..afb703205 100644 --- a/server/src/test/java/com/hedera/block/server/persistence/storage/read/BlockAsDirReaderTest.java +++ b/server/src/test/java/com/hedera/block/server/persistence/storage/read/BlockAsDirReaderTest.java @@ -80,7 +80,7 @@ public void tearDown() { @Test public void testReadBlockDoesNotExist() throws IOException { final BlockReader blockReader = - BlockAsDirReaderBuilder.builder(JUNIT, testConfig).build(); + BlockAsDirReaderBuilder.newBuilder(JUNIT, testConfig).build(); final Optional blockOpt = blockReader.read(10000); assertTrue(blockOpt.isEmpty()); } @@ -101,7 +101,7 @@ public void testReadPermsRepairSucceeded() throws IOException { // The default BlockReader will attempt to repair the permissions and should succeed final BlockReader blockReader = - BlockAsDirReaderBuilder.builder(JUNIT, testConfig).build(); + BlockAsDirReaderBuilder.newBuilder(JUNIT, testConfig).build(); final Optional blockOpt = blockReader.read(1); assertFalse(blockOpt.isEmpty()); assertEquals(10, blockOpt.get().getBlockItemsList().size()); @@ -124,7 +124,7 @@ public void testRemoveBlockReadPermsRepairFailed() throws IOException { // For this test, build the Reader with ineffective repair permissions to // simulate a failed repair (root changed the perms, etc.) final BlockReader blockReader = - BlockAsDirReaderBuilder.builder(JUNIT, testConfig) + BlockAsDirReaderBuilder.newBuilder(JUNIT, testConfig) .filePerms(TestUtils.getNoPerms()) .build(); final Optional blockOpt = blockReader.read(1); @@ -145,7 +145,7 @@ public void testRemoveBlockItemReadPerms() throws IOException { removeBlockItemReadPerms(1, 1, testConfig); final BlockReader blockReader = - BlockAsDirReaderBuilder.builder(JUNIT, testConfig).build(); + BlockAsDirReaderBuilder.newBuilder(JUNIT, testConfig).build(); assertThrows(IOException.class, () -> blockReader.read(1)); } @@ -159,7 +159,7 @@ public void testPathIsNotDirectory() throws IOException { // Should return empty because the path is not a directory final BlockReader blockReader = - BlockAsDirReaderBuilder.builder(JUNIT, testConfig).build(); + BlockAsDirReaderBuilder.newBuilder(JUNIT, testConfig).build(); final Optional blockOpt = blockReader.read(1); assertTrue(blockOpt.isEmpty()); } diff --git a/server/src/test/java/com/hedera/block/server/persistence/storage/write/BlockAsDirWriterTest.java b/server/src/test/java/com/hedera/block/server/persistence/storage/write/BlockAsDirWriterTest.java index d668f2d44..793002d1d 100644 --- a/server/src/test/java/com/hedera/block/server/persistence/storage/write/BlockAsDirWriterTest.java +++ b/server/src/test/java/com/hedera/block/server/persistence/storage/write/BlockAsDirWriterTest.java @@ -103,7 +103,8 @@ public void testWriterAndReaderHappyPath() throws IOException { } // Confirm the block - BlockReader blockReader = BlockAsDirReaderBuilder.builder(JUNIT, testConfig).build(); + BlockReader blockReader = + BlockAsDirReaderBuilder.newBuilder(JUNIT, testConfig).build(); Optional blockOpt = blockReader.read(1); assertFalse(blockOpt.isEmpty()); @@ -144,7 +145,8 @@ public void testRemoveBlockWritePerms() throws IOException { blockWriter.write(blockItems.getFirst()); // Confirm we're able to read 1 block item - BlockReader blockReader = BlockAsDirReaderBuilder.builder(JUNIT, testConfig).build(); + BlockReader blockReader = + BlockAsDirReaderBuilder.newBuilder(JUNIT, testConfig).build(); Optional blockOpt = blockReader.read(1); assertFalse(blockOpt.isEmpty()); assertEquals(1, blockOpt.get().getBlockItemsList().size()); @@ -214,7 +216,8 @@ public void testRemoveRootDirReadPerm() throws IOException { blockWriter.write(blockItems.get(i)); } - BlockReader blockReader = BlockAsDirReaderBuilder.builder(JUNIT, testConfig).build(); + BlockReader blockReader = + BlockAsDirReaderBuilder.newBuilder(JUNIT, testConfig).build(); Optional blockOpt = blockReader.read(1); assertFalse(blockOpt.isEmpty()); assertEquals(10, blockOpt.get().getBlockItemsList().size()); @@ -261,7 +264,7 @@ public void testPartialBlockRemoval() throws IOException { // Verify the partially written block was removed final BlockReader blockReader = - BlockAsDirReaderBuilder.builder(JUNIT, testConfig).build(); + BlockAsDirReaderBuilder.newBuilder(JUNIT, testConfig).build(); Optional blockOpt = blockReader.read(3); assertTrue(blockOpt.isEmpty());