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 702f1644b..85768d173 100644 --- a/server/src/main/java/com/hedera/block/server/Server.java +++ b/server/src/main/java/com/hedera/block/server/Server.java @@ -69,7 +69,7 @@ public static void main(final String[] args) { @NonNull final BlockWriter blockWriter = - BlockAsDirWriterBuilder.builder( + BlockAsDirWriterBuilder.newBuilder( BLOCKNODE_STORAGE_ROOT_PATH_KEY, config, blockNodeContext) .build(); @NonNull diff --git a/server/src/main/java/com/hedera/block/server/persistence/storage/write/BlockAsDirWriterBuilder.java b/server/src/main/java/com/hedera/block/server/persistence/storage/write/BlockAsDirWriterBuilder.java index b125192e9..f9c36a1f2 100644 --- a/server/src/main/java/com/hedera/block/server/persistence/storage/write/BlockAsDirWriterBuilder.java +++ b/server/src/main/java/com/hedera/block/server/persistence/storage/write/BlockAsDirWriterBuilder.java @@ -50,7 +50,7 @@ private BlockAsDirWriterBuilder( } @NonNull - public static BlockAsDirWriterBuilder builder( + public static BlockAsDirWriterBuilder newBuilder( @NonNull final String key, @NonNull final Config config, @NonNull final BlockNodeContext blockNodeContext) { 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 83cbf5c32..6a5250a17 100644 --- a/server/src/test/java/com/hedera/block/server/BlockStreamServiceIT.java +++ b/server/src/test/java/com/hedera/block/server/BlockStreamServiceIT.java @@ -589,7 +589,7 @@ private StreamMediator> buildStr final BlockNodeContext blockNodeContext = BlockNodeContextFactory.create(); final BlockWriter blockWriter = - BlockAsDirWriterBuilder.builder(JUNIT, testConfig, blockNodeContext) + BlockAsDirWriterBuilder.newBuilder(JUNIT, testConfig, blockNodeContext) .blockRemover(blockRemover) .filePerms(filePerms) .build(); 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 893325891..277185764 100644 --- a/server/src/test/java/com/hedera/block/server/BlockStreamServiceTest.java +++ b/server/src/test/java/com/hedera/block/server/BlockStreamServiceTest.java @@ -157,7 +157,7 @@ void testSingleBlockHappyPath() throws IOException { // Generate and persist a block final BlockWriter blockWriter = - BlockAsDirWriterBuilder.builder(JUNIT, testConfig, blockNodeContext).build(); + BlockAsDirWriterBuilder.newBuilder(JUNIT, testConfig, blockNodeContext).build(); final List blockItems = generateBlockItems(1); for (BlockItem blockItem : blockItems) { blockWriter.write(blockItem); 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 2c871f611..9f66ab2e6 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 @@ -70,7 +70,7 @@ public void testRemoveNonExistentBlock() throws IOException { final BlockNodeContext blockNodeContext = BlockNodeContextFactory.create(); final BlockWriter blockWriter = - BlockAsDirWriterBuilder.builder(JUNIT, testConfig, blockNodeContext).build(); + BlockAsDirWriterBuilder.newBuilder(JUNIT, testConfig, blockNodeContext).build(); for (final BlockItem blockItem : blockItems) { blockWriter.write(blockItem); } @@ -103,7 +103,7 @@ public void testRemoveBlockWithPermException() throws IOException { final BlockNodeContext blockNodeContext = BlockNodeContextFactory.create(); final BlockWriter blockWriter = - BlockAsDirWriterBuilder.builder(JUNIT, testConfig, blockNodeContext).build(); + BlockAsDirWriterBuilder.newBuilder(JUNIT, testConfig, blockNodeContext).build(); for (final BlockItem blockItem : blockItems) { blockWriter.write(blockItem); } 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 afb703205..aec8c6ba0 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 @@ -91,7 +91,7 @@ public void testReadPermsRepairSucceeded() throws IOException { final BlockNodeContext blockNodeContext = BlockNodeContextFactory.create(); final BlockWriter blockWriter = - BlockAsDirWriterBuilder.builder(JUNIT, testConfig, blockNodeContext).build(); + BlockAsDirWriterBuilder.newBuilder(JUNIT, testConfig, blockNodeContext).build(); for (BlockItem blockItem : blockItems) { blockWriter.write(blockItem); } @@ -113,7 +113,7 @@ public void testRemoveBlockReadPermsRepairFailed() throws IOException { final BlockNodeContext blockNodeContext = BlockNodeContextFactory.create(); final BlockWriter blockWriter = - BlockAsDirWriterBuilder.builder(JUNIT, testConfig, blockNodeContext).build(); + BlockAsDirWriterBuilder.newBuilder(JUNIT, testConfig, blockNodeContext).build(); for (BlockItem blockItem : blockItems) { blockWriter.write(blockItem); } @@ -137,7 +137,7 @@ public void testRemoveBlockItemReadPerms() throws IOException { final BlockNodeContext blockNodeContext = BlockNodeContextFactory.create(); final BlockWriter blockWriter = - BlockAsDirWriterBuilder.builder(JUNIT, testConfig, blockNodeContext).build(); + BlockAsDirWriterBuilder.newBuilder(JUNIT, testConfig, blockNodeContext).build(); for (BlockItem blockItem : blockItems) { blockWriter.write(blockItem); } @@ -171,7 +171,7 @@ public void testRepairReadPermsFails() throws IOException { final BlockNodeContext blockNodeContext = BlockNodeContextFactory.create(); final BlockWriter blockWriter = - BlockAsDirWriterBuilder.builder(JUNIT, testConfig, blockNodeContext).build(); + BlockAsDirWriterBuilder.newBuilder(JUNIT, testConfig, blockNodeContext).build(); for (final BlockItem blockItem : blockItems) { blockWriter.write(blockItem); } 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 793002d1d..31c4aea4d 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 @@ -86,7 +86,9 @@ public void testConstructorWithInvalidPath() throws IOException { final BlockNodeContext blockNodeContext = BlockNodeContextFactory.create(); assertThrows( IllegalArgumentException.class, - () -> BlockAsDirWriterBuilder.builder(JUNIT, testConfig, blockNodeContext).build()); + () -> + BlockAsDirWriterBuilder.newBuilder(JUNIT, testConfig, blockNodeContext) + .build()); } @Test @@ -97,7 +99,7 @@ public void testWriterAndReaderHappyPath() throws IOException { final BlockNodeContext blockNodeContext = BlockNodeContextFactory.create(); final BlockWriter blockWriter = - BlockAsDirWriterBuilder.builder(JUNIT, testConfig, blockNodeContext).build(); + BlockAsDirWriterBuilder.newBuilder(JUNIT, testConfig, blockNodeContext).build(); for (BlockItem blockItem : blockItems) { blockWriter.write(blockItem); } @@ -135,7 +137,7 @@ public void testRemoveBlockWritePerms() throws IOException { final BlockNodeContext blockNodeContext = BlockNodeContextFactory.create(); final BlockWriter blockWriter = - BlockAsDirWriterBuilder.builder(JUNIT, testConfig, blockNodeContext).build(); + BlockAsDirWriterBuilder.newBuilder(JUNIT, testConfig, blockNodeContext).build(); // Change the permissions on the block node root directory removeRootWritePerms(testConfig); @@ -186,7 +188,7 @@ public void testUnrecoverableIOExceptionOnWrite() throws IOException { final BlockNodeContext blockNodeContext = BlockNodeContextFactory.create(); final BlockWriter blockWriter = spy( - BlockAsDirWriterBuilder.builder(JUNIT, testConfig, blockNodeContext) + BlockAsDirWriterBuilder.newBuilder(JUNIT, testConfig, blockNodeContext) .blockRemover(blockRemover) .build()); doThrow(IOException.class).when(blockWriter).write(blockItems.getFirst()); @@ -199,7 +201,7 @@ public void testRemoveRootDirReadPerm() throws IOException { final BlockNodeContext blockNodeContext = BlockNodeContextFactory.create(); final BlockWriter blockWriter = - BlockAsDirWriterBuilder.builder(JUNIT, testConfig, blockNodeContext).build(); + BlockAsDirWriterBuilder.newBuilder(JUNIT, testConfig, blockNodeContext).build(); // Write the first block item to create the block // directory