This is an automated email from the ASF dual-hosted git repository. captainzmc pushed a commit to branch HDDS-4454 in repository https://gitbox.apache.org/repos/asf/ozone.git
commit e63539309fd026c5052e9648844aafad8170264a Author: hao guo <[email protected]> AuthorDate: Mon Feb 21 21:02:50 2022 +0800 HDDS-6355. [Ozone-Streaming] Fix CheckStyle problem (#3119) --- .../apache/hadoop/hdds/scm/storage/BlockDataStreamOutput.java | 10 +++++----- .../java/org/apache/hadoop/hdds/scm/storage/StreamBuffer.java | 4 ++-- .../hadoop/ozone/client/io/BlockDataStreamOutputEntryPool.java | 4 ++-- .../java/org/apache/hadoop/ozone/client/rpc/RpcClient.java | 2 +- .../test/java/org/apache/hadoop/ozone/MiniOzoneCluster.java | 4 ++-- .../java/org/apache/hadoop/ozone/MiniOzoneClusterImpl.java | 2 +- .../hadoop/ozone/client/rpc/TestBlockDataStreamOutput.java | 4 ++-- .../java/org/apache/hadoop/fs/ozone/BasicOzoneFileSystem.java | 2 +- .../org/apache/hadoop/fs/ozone/BasicRootedOzoneFileSystem.java | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockDataStreamOutput.java b/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockDataStreamOutput.java index 8dd9e6b50e..8b3e32cf41 100644 --- a/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockDataStreamOutput.java +++ b/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockDataStreamOutput.java @@ -283,7 +283,7 @@ public class BlockDataStreamOutput implements ByteBufferStreamOutput { } private void writeChunkIfNeeded() throws IOException { - if (currentBuffer.length()==0) { + if (currentBuffer.length() == 0) { writeChunk(currentBuffer); currentBuffer = null; } @@ -302,7 +302,7 @@ public class BlockDataStreamOutput implements ByteBufferStreamOutput { } private void allocateNewBufferIfNeeded() { - if (currentBuffer==null) { + if (currentBuffer == null) { currentBuffer = StreamBuffer.allocate(config.getDataStreamMinPacketSize()); } @@ -323,7 +323,7 @@ public class BlockDataStreamOutput implements ByteBufferStreamOutput { updateFlushLength(); executePutBlock(false, false); } - if (bufferList.size()==streamWindow){ + if (bufferList.size() == streamWindow) { try { checkOpen(); if (!putBlockFutures.isEmpty()) { @@ -514,7 +514,7 @@ public class BlockDataStreamOutput implements ByteBufferStreamOutput { // here, we just limit this buffer to the current position. So that next // write will happen in new buffer - if (currentBuffer!=null) { + if (currentBuffer != null) { writeChunk(currentBuffer); currentBuffer = null; } @@ -693,7 +693,7 @@ public class BlockDataStreamOutput implements ByteBufferStreamOutput { boolean processExecutionException) throws IOException { LOG.error("Command execution was interrupted."); - if(processExecutionException) { + if (processExecutionException) { handleExecutionException(ex); } else { throw new IOException(EXCEPTION_MSG + ex.toString(), ex); diff --git a/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/StreamBuffer.java b/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/StreamBuffer.java index 5118ea5ead..d34e4dca94 100644 --- a/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/StreamBuffer.java +++ b/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/StreamBuffer.java @@ -48,11 +48,11 @@ public class StreamBuffer { } - public void put(StreamBuffer sb){ + public void put(StreamBuffer sb) { buffer.put(sb.buffer); } - public static StreamBuffer allocate(int size){ + public static StreamBuffer allocate(int size) { return new StreamBuffer(ByteBuffer.allocate(size)); } diff --git a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/BlockDataStreamOutputEntryPool.java b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/BlockDataStreamOutputEntryPool.java index 24a046f623..00cda7844a 100644 --- a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/BlockDataStreamOutputEntryPool.java +++ b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/BlockDataStreamOutputEntryPool.java @@ -307,8 +307,8 @@ public class BlockDataStreamOutputEntryPool { } long computeBufferData() { - long totalDataLen =0; - for (StreamBuffer b : bufferList){ + long totalDataLen = 0; + for (StreamBuffer b : bufferList) { totalDataLen += b.position(); } return totalDataLen; diff --git a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java index 8df0f55f5c..4bdf169d87 100644 --- a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java +++ b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java @@ -1211,7 +1211,7 @@ public class RpcClient implements ClientProtocol { .setAcls(getAclList()); if (Boolean.parseBoolean(metadata.get(OzoneConsts.GDPR_FLAG))) { - try{ + try { GDPRSymmetricKey gKey = new GDPRSymmetricKey(new SecureRandom()); builder.addAllMetadata(gKey.getKeyDetails()); } catch (Exception e) { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneCluster.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneCluster.java index 4809f0c357..4c485d805c 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneCluster.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneCluster.java @@ -325,8 +325,8 @@ public interface MiniOzoneCluster { protected Optional<Integer> chunkSize = Optional.empty(); protected OptionalInt streamBufferSize = OptionalInt.empty(); protected Optional<Long> streamBufferFlushSize = Optional.empty(); - protected Optional<Long> dataStreamBufferFlushSize= Optional.empty(); - protected Optional<Long> datastreamWindowSize= Optional.empty(); + protected Optional<Long> dataStreamBufferFlushSize = Optional.empty(); + protected Optional<Long> datastreamWindowSize = Optional.empty(); protected Optional<Long> streamBufferMaxSize = Optional.empty(); protected OptionalInt dataStreamMinPacketSize = OptionalInt.empty(); protected Optional<Long> blockSize = Optional.empty(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneClusterImpl.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneClusterImpl.java index 866f4188ea..96a35e09bc 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneClusterImpl.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneClusterImpl.java @@ -669,7 +669,7 @@ public class MiniOzoneClusterImpl implements MiniOzoneCluster { dataStreamBufferFlushSize = Optional.of((long) 4 * chunkSize.get()); } if (!dataStreamMinPacketSize.isPresent()) { - dataStreamMinPacketSize = OptionalInt.of(chunkSize.get()/4); + dataStreamMinPacketSize = OptionalInt.of(chunkSize.get() / 4); } if (!datastreamWindowSize.isPresent()) { datastreamWindowSize = Optional.of((long) 8 * chunkSize.get()); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockDataStreamOutput.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockDataStreamOutput.java index 21003374d7..6225e25268 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockDataStreamOutput.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockDataStreamOutput.java @@ -107,7 +107,7 @@ public class TestBlockDataStreamOutput { .setDataStreamBufferFlushize(maxFlushSize) .setStreamBufferSizeUnit(StorageUnit.BYTES) .setDataStreamMinPacketSize(chunkSize) - .setDataStreamStreamWindowSize(5*chunkSize) + .setDataStreamStreamWindowSize(5 * chunkSize) .build(); cluster.waitForClusterToBeReady(); //the easiest way to create an open container is creating a key @@ -137,7 +137,7 @@ public class TestBlockDataStreamOutput { @Test public void testHalfChunkWrite() throws Exception { testWrite(chunkSize / 2); - testWriteWithFailure(chunkSize/2); + testWriteWithFailure(chunkSize / 2); } @Test diff --git a/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneFileSystem.java b/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneFileSystem.java index 645992c3ab..32a9f31811 100644 --- a/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneFileSystem.java +++ b/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneFileSystem.java @@ -263,7 +263,7 @@ public class BasicOzoneFileSystem extends FileSystem { boolean isRatisStreamingEnabled = getConf().getBoolean( OzoneConfigKeys.OZONE_FS_DATASTREAM_ENABLE, OzoneConfigKeys.OZONE_FS_DATASTREAM_ENABLE_DEFAULT); - if (isRatisStreamingEnabled){ + if (isRatisStreamingEnabled) { return new FSDataOutputStream(adapter.createStreamFile(key, replication, overwrite, recursive), statistics); } diff --git a/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneFileSystem.java b/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneFileSystem.java index 0bed09ba8a..600abdf4f1 100644 --- a/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneFileSystem.java +++ b/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicRootedOzoneFileSystem.java @@ -239,7 +239,7 @@ public class BasicRootedOzoneFileSystem extends FileSystem { boolean isRatisStreamingEnabled = getConf().getBoolean( OzoneConfigKeys.OZONE_FS_DATASTREAM_ENABLE, OzoneConfigKeys.OZONE_FS_DATASTREAM_ENABLE_DEFAULT); - if (isRatisStreamingEnabled){ + if (isRatisStreamingEnabled) { return new FSDataOutputStream(adapter.createStreamFile(key, replication, overwrite, recursive), statistics); } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
