This is an automated email from the ASF dual-hosted git repository. umamahesh pushed a commit to branch HDDS-3816-ec in repository https://gitbox.apache.org/repos/asf/ozone.git
commit b2a33b759eb90d3e1d01b3f4b09bc612863aeb94 Author: Uma Maheswara Rao G <[email protected]> AuthorDate: Tue Feb 15 13:30:26 2022 -0800 HDDS-6320: EC: Fix new checkstyle rule warnings in EC branch --- .../hadoop/hdds/scm/storage/BlockOutputStream.java | 8 +++---- .../hdds/scm/storage/ECBlockOutputStream.java | 2 +- .../hdds/client/DefaultReplicationConfig.java | 2 +- .../hadoop/hdds/client/TestReplicationConfig.java | 2 +- .../hadoop/hdds/scm/pipeline/MockPipeline.java | 2 +- .../erasurecode/rawcoder/util/GaloisField.java | 23 ++++++++++--------- .../ozone/erasurecode/rawcoder/util/RSUtil.java | 3 ++- .../ContainerPlacementPolicyFactory.java | 4 ++-- .../SCMContainerPlacementRackScatter.java | 8 +++---- .../scm/pipeline/WritableECContainerProvider.java | 6 ++--- .../hdds/scm/pipeline/TestECPipelineProvider.java | 6 ++--- .../pipeline/TestWritableECContainerProvider.java | 20 ++++++++--------- .../apache/hadoop/ozone/client/OzoneBucket.java | 2 +- .../hadoop/ozone/client/io/ECBlockInputStream.java | 6 ++--- .../ozone/client/io/ECBlockOutputStreamEntry.java | 10 ++++----- .../client/io/ECBlockReconstructedInputStream.java | 2 +- .../io/ECBlockReconstructedStripeInputStream.java | 4 ++-- .../hadoop/ozone/client/io/ECKeyOutputStream.java | 5 +++-- .../hadoop/ozone/client/MockDatanodeStorage.java | 4 ++-- .../hadoop/ozone/client/MockOmTransport.java | 4 ++-- .../ozone/client/MockXceiverClientFactory.java | 4 ++-- .../client/MultiNodePipelineBlockAllocator.java | 2 +- .../hadoop/ozone/client/TestOzoneECClient.java | 8 +++---- .../ozone/client/rpc/TestECKeyOutputStream.java | 2 +- .../ozone/client/rpc/read/ECStreamTestUtil.java | 4 ++-- .../rpc/read/TestBlockInputStreamFactoryImpl.java | 4 ++-- .../client/rpc/read/TestECBlockInputStream.java | 4 ++-- .../rpc/read/TestECBlockInputStreamProxy.java | 6 ++--- .../read/TestECBlockReconstructedInputStream.java | 26 +++++++++++----------- .../TestECBlockReconstructedStripeInputStream.java | 2 +- .../ozone/client/rpc/read/TestKeyInputStream.java | 2 +- .../apache/hadoop/fs/ozone/OzoneClientUtils.java | 3 ++- .../ozone/shell/bucket/CreateBucketHandler.java | 2 +- 33 files changed, 98 insertions(+), 94 deletions(-) diff --git a/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockOutputStream.java b/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockOutputStream.java index 9399fb0..fbf041f 100644 --- a/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockOutputStream.java +++ b/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockOutputStream.java @@ -213,19 +213,19 @@ public class BlockOutputStream extends OutputStream { return ioException.get(); } - XceiverClientSpi getXceiverClientSpi(){ + XceiverClientSpi getXceiverClientSpi() { return this.xceiverClient; } - BlockData.Builder getContainerBlockData(){ + BlockData.Builder getContainerBlockData() { return this.containerBlockData; } - Token<? extends TokenIdentifier> getToken(){ + Token<? extends TokenIdentifier> getToken() { return this.token; } - ExecutorService getResponseExecutor(){ + ExecutorService getResponseExecutor() { return this.responseExecutor; } diff --git a/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/ECBlockOutputStream.java b/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/ECBlockOutputStream.java index 66e550f..b2f86ac 100644 --- a/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/ECBlockOutputStream.java +++ b/hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/ECBlockOutputStream.java @@ -40,7 +40,7 @@ import static org.apache.hadoop.hdds.scm.storage.ContainerProtocolCalls.putBlock /** * Handles the chunk EC writes for an EC internal block. */ -public class ECBlockOutputStream extends BlockOutputStream{ +public class ECBlockOutputStream extends BlockOutputStream { private final DatanodeDetails datanodeDetails; private CompletableFuture<ContainerProtos.ContainerCommandResponseProto> diff --git a/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/DefaultReplicationConfig.java b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/DefaultReplicationConfig.java index dda778f..851cae9 100644 --- a/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/DefaultReplicationConfig.java +++ b/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/DefaultReplicationConfig.java @@ -93,7 +93,7 @@ public class DefaultReplicationConfig { } public int getRequiredNodes() { - if(this.type == ReplicationType.EC){ + if (this.type == ReplicationType.EC) { return ecReplicationConfig.getRequiredNodes(); } return this.factor.getValue(); diff --git a/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/client/TestReplicationConfig.java b/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/client/TestReplicationConfig.java index 4811187..7346616 100644 --- a/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/client/TestReplicationConfig.java +++ b/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/client/TestReplicationConfig.java @@ -39,7 +39,7 @@ import static org.junit.Assert.assertThrows; @RunWith(Parameterized.class) public class TestReplicationConfig { - private static final int MB = 1024*1024; + private static final int MB = 1024 * 1024; private static final int KB = 1024; @SuppressWarnings("checkstyle:VisibilityModifier") diff --git a/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/scm/pipeline/MockPipeline.java b/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/scm/pipeline/MockPipeline.java index 5ccae21..0009f1b 100644 --- a/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/scm/pipeline/MockPipeline.java +++ b/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/scm/pipeline/MockPipeline.java @@ -97,7 +97,7 @@ public final class MockPipeline { public static Pipeline createEcPipeline(ECReplicationConfig repConfig) { List<DatanodeDetails> nodes = new ArrayList<>(); - for (int i=0; i<repConfig.getRequiredNodes(); i++) { + for (int i = 0; i < repConfig.getRequiredNodes(); i++) { nodes.add(MockDatanodeDetails.randomDatanodeDetails()); } Map<DatanodeDetails, Integer> nodeIndexes = new HashMap<>(); diff --git a/hadoop-hdds/erasurecode/src/main/java/org/apache/ozone/erasurecode/rawcoder/util/GaloisField.java b/hadoop-hdds/erasurecode/src/main/java/org/apache/ozone/erasurecode/rawcoder/util/GaloisField.java index 38a750f..7fb06ce 100644 --- a/hadoop-hdds/erasurecode/src/main/java/org/apache/ozone/erasurecode/rawcoder/util/GaloisField.java +++ b/hadoop-hdds/erasurecode/src/main/java/org/apache/ozone/erasurecode/rawcoder/util/GaloisField.java @@ -243,8 +243,9 @@ public final class GaloisField { int idx1, idx2; for (int i = 0; i < len - 1; i++) { for (int j = len - 1; j > i; j--) { - for (idx2 = outputOffsets[j-1], idx1 = outputOffsets[j]; - idx1 < outputOffsets[j] + dataLen; idx1++, idx2++) { + for (idx2 = outputOffsets[j - 1], idx1 = + outputOffsets[j]; idx1 < outputOffsets[j] + dataLen; + idx1++, idx2++) { y[j][idx1] = (byte) (y[j][idx1] ^ mulTable[x[i]][y[j - 1][idx2] & 0x000000FF]); } @@ -259,7 +260,7 @@ public final class GaloisField { } } for (int j = i; j < len - 1; j++) { - for (idx2 = outputOffsets[j+1], idx1 = outputOffsets[j]; + for (idx2 = outputOffsets[j + 1], idx1 = outputOffsets[j]; idx1 < outputOffsets[j] + dataLen; idx1++, idx2++) { y[j][idx1] = (byte) (y[j][idx1] ^ y[j + 1][idx2]); } @@ -276,9 +277,9 @@ public final class GaloisField { for (int i = 0; i < len - 1; i++) { for (int j = len - 1; j > i; j--) { p = y[j]; - for (idx1 = p.position(), idx2 = y[j-1].position(); - idx1 < p.limit(); idx1++, idx2++) { - p.put(idx1, (byte) (p.get(idx1) ^ mulTable[x[i]][y[j-1].get(idx2) & + for (idx1 = p.position(), idx2 = y[j - 1].position(); idx1 < p + .limit(); idx1++, idx2++) { + p.put(idx1, (byte) (p.get(idx1) ^ mulTable[x[i]][y[j - 1].get(idx2) & 0x000000FF])); } } @@ -295,9 +296,9 @@ public final class GaloisField { for (int j = i; j < len - 1; j++) { p = y[j]; - for (idx1 = p.position(), idx2 = y[j+1].position(); - idx1 < p.limit(); idx1++, idx2++) { - p.put(idx1, (byte) (p.get(idx1) ^ y[j+1].get(idx2))); + for (idx1 = p.position(), idx2 = y[j + 1].position(); idx1 < p + .limit(); idx1++, idx2++) { + p.put(idx1, (byte) (p.get(idx1) ^ y[j + 1].get(idx2))); } } } @@ -521,7 +522,7 @@ public final class GaloisField { * fat matrix (number of rows > number of columns). */ public void gaussianElimination(int[][] matrix) { - assert(matrix != null && matrix.length > 0 && matrix[0].length > 0 + assert (matrix != null && matrix.length > 0 && matrix[0].length > 0 && matrix.length < matrix[0].length); int height = matrix.length; int width = matrix[0].length; @@ -551,7 +552,7 @@ public final class GaloisField { } } } - for (int i = height - 1; i >=0; i--) { + for (int i = height - 1; i >= 0; i--) { for (int j = 0; j < i; j++) { int lead = matrix[j][i]; for (int k = i; k < width; k++) { diff --git a/hadoop-hdds/erasurecode/src/main/java/org/apache/ozone/erasurecode/rawcoder/util/RSUtil.java b/hadoop-hdds/erasurecode/src/main/java/org/apache/ozone/erasurecode/rawcoder/util/RSUtil.java index 6d23c1f..0ec88d0 100644 --- a/hadoop-hdds/erasurecode/src/main/java/org/apache/ozone/erasurecode/rawcoder/util/RSUtil.java +++ b/hadoop-hdds/erasurecode/src/main/java/org/apache/ozone/erasurecode/rawcoder/util/RSUtil.java @@ -28,7 +28,8 @@ import java.nio.ByteBuffer; @InterfaceAudience.Private public final class RSUtil { - private RSUtil(){} + private RSUtil() { + } // We always use the byte system (with symbol size 8, field size 256, // primitive polynomial 285, and primitive root 2). diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/algorithms/ContainerPlacementPolicyFactory.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/algorithms/ContainerPlacementPolicyFactory.java index aa060ce..9c64566 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/algorithms/ContainerPlacementPolicyFactory.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/algorithms/ContainerPlacementPolicyFactory.java @@ -63,7 +63,7 @@ public final class ContainerPlacementPolicyFactory { public static PlacementPolicy getECPolicy( ConfigurationSource conf, final NodeManager nodeManager, NetworkTopology clusterMap, final boolean fallback, - SCMContainerPlacementMetrics metrics) throws SCMException{ + SCMContainerPlacementMetrics metrics) throws SCMException { // TODO: Change default placement policy for EC final Class<? extends PlacementPolicy> placementClass = conf .getClass(ScmConfigKeys.OZONE_SCM_CONTAINER_PLACEMENT_EC_IMPL_KEY, @@ -77,7 +77,7 @@ public final class ContainerPlacementPolicyFactory { Class<? extends PlacementPolicy> placementClass, ConfigurationSource conf, final NodeManager nodeManager, NetworkTopology clusterMap, final boolean fallback, - SCMContainerPlacementMetrics metrics) throws SCMException{ + SCMContainerPlacementMetrics metrics) throws SCMException { Constructor<? extends PlacementPolicy> constructor; try { constructor = placementClass.getDeclaredConstructor(NodeManager.class, diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/algorithms/SCMContainerPlacementRackScatter.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/algorithms/SCMContainerPlacementRackScatter.java index 54e7238..7915a5b 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/algorithms/SCMContainerPlacementRackScatter.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/algorithms/SCMContainerPlacementRackScatter.java @@ -58,9 +58,9 @@ public final class SCMContainerPlacementRackScatter private final NetworkTopology networkTopology; private static final int RACK_LEVEL = 1; // OUTER_LOOP is to avoid infinity choose on all racks - private static final int OUTER_LOOP_MAX_RETRY= 3; + private static final int OUTER_LOOP_MAX_RETRY = 3; // INNER_LOOP is to choose node in each rack - private static final int INNER_LOOP_MAX_RETRY= 5; + private static final int INNER_LOOP_MAX_RETRY = 5; private final SCMContainerPlacementMetrics metrics; /** @@ -239,7 +239,7 @@ public final class SCMContainerPlacementRackScatter private Node chooseNode(String scope, List<Node> excludedNodes, long metadataSizeRequired, long dataSizeRequired) { int maxRetry = INNER_LOOP_MAX_RETRY; - while(true) { + while (true) { metrics.incrDatanodeChooseAttemptCount(); Node node = networkTopology.chooseRandom(scope, excludedNodes); if (node == null) { @@ -316,7 +316,7 @@ public final class SCMContainerPlacementRackScatter } private List<Node> getAllRacks() { - int rackLevel = networkTopology.getMaxLevel()-1; + int rackLevel = networkTopology.getMaxLevel() - 1; List<Node> racks = networkTopology.getNodes(rackLevel); Collections.shuffle(racks); return racks; diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/WritableECContainerProvider.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/WritableECContainerProvider.java index 37efbcd..554a72a 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/WritableECContainerProvider.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/WritableECContainerProvider.java @@ -92,7 +92,7 @@ public class WritableECContainerProvider public ContainerInfo getContainer(final long size, ECReplicationConfig repConfig, String owner, ExcludeList excludeList) throws IOException { - synchronized(this) { + synchronized (this) { int openPipelineCount = pipelineManager.getPipelineCount(repConfig, Pipeline.PipelineState.OPEN); if (openPipelineCount < providerConfig.getMinimumPipelines()) { @@ -136,7 +136,7 @@ public class WritableECContainerProvider return containerInfo; } } - } catch(PipelineNotFoundException | ContainerNotFoundException e){ + } catch (PipelineNotFoundException | ContainerNotFoundException e) { LOG.warn("Pipeline or container not found when selecting a writable " + "container", e); existingPipelines.remove(pipeline); @@ -147,7 +147,7 @@ public class WritableECContainerProvider // If we get here, all the pipelines we tried were no good. So try to // allocate a new one and usePipelineManagerV2Impl.java it. try { - synchronized(this) { + synchronized (this) { return allocateContainer(repConfig, size, owner, excludeList); } } catch (IOException e) { diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestECPipelineProvider.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestECPipelineProvider.java index d95ef85..802ed01 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestECPipelineProvider.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestECPipelineProvider.java @@ -72,7 +72,7 @@ public class TestECPipelineProvider { Mockito.anyLong())) .thenAnswer(invocation -> { List<DatanodeDetails> dns = new ArrayList<>(); - for (int i=0; i<(int)invocation.getArguments()[2]; i++) { + for (int i = 0; i < (int) invocation.getArguments()[2]; i++) { dns.add(MockDatanodeDetails.randomDatanodeDetails()); } return dns; @@ -90,9 +90,9 @@ public class TestECPipelineProvider { pipeline.getNodes().size()); Assert.assertEquals(ALLOCATED, pipeline.getPipelineState()); List<DatanodeDetails> dns = pipeline.getNodes(); - for (int i=0; i<ecConf.getRequiredNodes(); i++) { + for (int i = 0; i < ecConf.getRequiredNodes(); i++) { // EC DN indexes are numbered starting from 1 to N. - Assert.assertEquals(i+1, pipeline.getReplicaIndex(dns.get(i))); + Assert.assertEquals(i + 1, pipeline.getReplicaIndex(dns.get(i))); } } diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestWritableECContainerProvider.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestWritableECContainerProvider.java index 9b9c7a9..269927a 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestWritableECContainerProvider.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestWritableECContainerProvider.java @@ -137,7 +137,7 @@ public class TestWritableECContainerProvider { throws IOException { // The first 5 calls should return a different container Set<ContainerInfo> allocatedContainers = new HashSet<>(); - for (int i=0; i<minPipelines; i++) { + for (int i = 0; i < minPipelines; i++) { ContainerInfo container = provider.getContainer(1, repConfig, OWNER, new ExcludeList()); assertFalse(allocatedContainers.contains(container)); @@ -145,7 +145,7 @@ public class TestWritableECContainerProvider { } allocatedContainers.clear(); - for (int i=0; i<20; i++) { + for (int i = 0; i < 20; i++) { ContainerInfo container = provider.getContainer(1, repConfig, OWNER, new ExcludeList()); allocatedContainers.add(container); @@ -162,7 +162,7 @@ public class TestWritableECContainerProvider { @Test public void testPiplineLimitIgnoresExcludedPipelines() throws IOException { Set<ContainerInfo> allocatedContainers = new HashSet<>(); - for (int i=0; i<minPipelines; i++) { + for (int i = 0; i < minPipelines; i++) { ContainerInfo container = provider.getContainer( 1, repConfig, OWNER, new ExcludeList()); allocatedContainers.add(container); @@ -184,7 +184,7 @@ public class TestWritableECContainerProvider { public void testNewPipelineCreatedIfAllPipelinesExcluded() throws IOException { Set<ContainerInfo> allocatedContainers = new HashSet<>(); - for (int i=0; i<minPipelines; i++) { + for (int i = 0; i < minPipelines; i++) { ContainerInfo container = provider.getContainer( 1, repConfig, OWNER, new ExcludeList()); allocatedContainers.add(container); @@ -204,7 +204,7 @@ public class TestWritableECContainerProvider { public void testNewPipelineCreatedIfAllContainersExcluded() throws IOException { Set<ContainerInfo> allocatedContainers = new HashSet<>(); - for (int i=0; i<minPipelines; i++) { + for (int i = 0; i < minPipelines; i++) { ContainerInfo container = provider.getContainer( 1, repConfig, OWNER, new ExcludeList()); allocatedContainers.add(container); @@ -263,7 +263,7 @@ public class TestWritableECContainerProvider { ContainerInfo container = provider.getContainer(1, repConfig, OWNER, new ExcludeList()); - for (int i=0; i<5; i++) { + for (int i = 0; i < 5; i++) { ContainerInfo nextContainer = provider.getContainer(1, repConfig, OWNER, new ExcludeList()); assertEquals(container, nextContainer); @@ -274,7 +274,7 @@ public class TestWritableECContainerProvider { public void testNewContainerAllocatedAndPipelinesClosedIfNoSpaceInExisting() throws IOException { Set<ContainerInfo> allocatedContainers = new HashSet<>(); - for (int i=0; i<minPipelines; i++) { + for (int i = 0; i < minPipelines; i++) { ContainerInfo container = provider.getContainer(1, repConfig, OWNER, new ExcludeList()); assertFalse(allocatedContainers.contains(container)); @@ -314,7 +314,7 @@ public class TestWritableECContainerProvider { conf, pipelineManager, containerManager, pipelineChoosingPolicy); Set<ContainerInfo> allocatedContainers = new HashSet<>(); - for (int i=0; i<minPipelines; i++) { + for (int i = 0; i < minPipelines; i++) { ContainerInfo container = provider.getContainer(1, repConfig, OWNER, new ExcludeList()); assertFalse(allocatedContainers.contains(container)); @@ -332,7 +332,7 @@ public class TestWritableECContainerProvider { public void testContainerNotFoundWhenAttemptingToUseExisting() throws IOException { Set<ContainerInfo> allocatedContainers = new HashSet<>(); - for (int i=0; i<minPipelines; i++) { + for (int i = 0; i < minPipelines; i++) { ContainerInfo container = provider.getContainer(1, repConfig, OWNER, new ExcludeList()); assertFalse(allocatedContainers.contains(container)); @@ -363,7 +363,7 @@ public class TestWritableECContainerProvider { // When tha happens, CM will change the container state to CLOSING and // remove it from the container list in pipeline Manager. Set<ContainerInfo> allocatedContainers = new HashSet<>(); - for (int i=0; i<minPipelines; i++) { + for (int i = 0; i < minPipelines; i++) { ContainerInfo container = provider.getContainer( 1, repConfig, OWNER, new ExcludeList()); assertFalse(allocatedContainers.contains(container)); diff --git a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneBucket.java b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneBucket.java index ebdd994..0da2386 100644 --- a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneBucket.java +++ b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneBucket.java @@ -1314,7 +1314,7 @@ public class OzoneBucket extends WithMetadata { return bucketLayout; } - public ReplicationConfig getReplicationConfig(){ + public ReplicationConfig getReplicationConfig() { return this.defaultReplication; } } diff --git a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockInputStream.java b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockInputStream.java index b71d475..06e6844 100644 --- a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockInputStream.java +++ b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockInputStream.java @@ -176,7 +176,7 @@ public class ECBlockInputStream extends BlockExtendedInputStream { OmKeyLocationInfo blkInfo = new OmKeyLocationInfo.Builder() .setBlockID(blockInfo.getBlockID()) - .setLength(internalBlockLength(locationIndex+1)) + .setLength(internalBlockLength(locationIndex + 1)) .setPipeline(blockInfo.getPipeline()) .setToken(blockInfo.getToken()) .setPartNumber(blockInfo.getPartNumber()) @@ -262,7 +262,7 @@ public class ECBlockInputStream extends BlockExtendedInputStream { } int totalRead = 0; - while(strategy.getTargetLength() > 0 && remaining() > 0) { + while (strategy.getTargetLength() > 0 && remaining() > 0) { try { int currentIndex = currentStreamIndex(); BlockExtendedInputStream stream = getOrOpenStream(currentIndex); @@ -337,7 +337,7 @@ public class ECBlockInputStream extends BlockExtendedInputStream { // might be corrupt. throw new IOException("Expected to read " + expectedRead + " but got EOF" + " from blockGroup " + stream.getBlockID() + " index " - + currentStreamIndex()+1); + + currentStreamIndex() + 1); } return actualRead; } diff --git a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockOutputStreamEntry.java b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockOutputStreamEntry.java index 1f9d82c..3a86bd5 100644 --- a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockOutputStreamEntry.java +++ b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockOutputStreamEntry.java @@ -59,7 +59,7 @@ import static org.apache.ratis.util.Preconditions.assertInstanceOf; * an internal ECBlockOutputStream instance with a single node pipeline, that * is derived from the original EC pipeline. */ -public class ECBlockOutputStreamEntry extends BlockOutputStreamEntry{ +public class ECBlockOutputStreamEntry extends BlockOutputStreamEntry { private final ECReplicationConfig replicationConfig; private final long length; @@ -140,11 +140,11 @@ public class ECBlockOutputStreamEntry extends BlockOutputStreamEntry{ } } - public void forceToFirstParityBlock(){ + public void forceToFirstParityBlock() { currentStreamIdx = replicationConfig.getData(); } - public void resetToFirstEntry(){ + public void resetToFirstEntry() { currentStreamIdx = 0; } @@ -158,7 +158,7 @@ public class ECBlockOutputStreamEntry extends BlockOutputStreamEntry{ @Override void incCurrentPosition(long len) { - if (isWritingParity()){ + if (isWritingParity()) { return; } super.incCurrentPosition(len); @@ -209,7 +209,7 @@ public class ECBlockOutputStreamEntry extends BlockOutputStreamEntry{ } void updateBlockGroupToAckedPosition(long len) { - if (isWritingParity()){ + if (isWritingParity()) { return; } this.successfulBlkGrpAckedLen += len; diff --git a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockReconstructedInputStream.java b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockReconstructedInputStream.java index d44ed15..6894719 100644 --- a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockReconstructedInputStream.java +++ b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockReconstructedInputStream.java @@ -115,7 +115,7 @@ public class ECBlockReconstructedInputStream extends BlockExtendedInputStream { private long readBufferToDest(ByteBuffer src, ByteBuffer dest) { int initialRemaining = dest.remaining(); - while(dest.hasRemaining() && src.hasRemaining()) { + while (dest.hasRemaining() && src.hasRemaining()) { dest.put(src.get()); } int read = initialRemaining - dest.remaining(); diff --git a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockReconstructedStripeInputStream.java b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockReconstructedStripeInputStream.java index 26fbd15..524f741 100644 --- a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockReconstructedStripeInputStream.java +++ b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockReconstructedStripeInputStream.java @@ -270,7 +270,7 @@ public class ECBlockReconstructedStripeInputStream extends ECBlockInputStream { return EOF; } validateBuffers(bufs); - while(true) { + while (true) { try { assignBuffers(bufs); clearParityBuffers(); @@ -472,7 +472,7 @@ public class ECBlockReconstructedStripeInputStream extends ECBlockInputStream { }))); } boolean exceptionOccurred = false; - while(!pendingReads.isEmpty()) { + while (!pendingReads.isEmpty()) { int index = -1; try { ImmutablePair<Integer, Future<Void>> pair = pendingReads.poll(); diff --git a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECKeyOutputStream.java b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECKeyOutputStream.java index f8e295d..b6836af 100644 --- a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECKeyOutputStream.java +++ b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECKeyOutputStream.java @@ -384,7 +384,7 @@ public class ECKeyOutputStream extends KeyOutputStream { int pos = ecChunkBufferCache.addToDataBuffer(currIdx, b, off, (int) len); handleOutputStreamWrite(currIdx, len, isFullCell, false); - if(pos == ecChunkSize){ + if (pos == ecChunkSize) { blockOutputStreamEntryPool.getCurrentStreamEntry().useNextBlockStream(); } return pos; @@ -729,7 +729,8 @@ public class ECKeyOutputStream extends KeyOutputStream { final ByteBuffer buf = dataBuffers[i]; final int pos = buf.position() + len; Preconditions.checkState(pos <= cellSize, - "Position("+pos+") is greater than the cellSize("+cellSize+")."); + "Position(" + pos + ") is greater than the cellSize(" + + cellSize + ")."); buf.put(b, off, len); return pos; } diff --git a/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/MockDatanodeStorage.java b/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/MockDatanodeStorage.java index 41de363..1f29425 100644 --- a/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/MockDatanodeStorage.java +++ b/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/MockDatanodeStorage.java @@ -42,7 +42,7 @@ public class MockDatanodeStorage { private boolean failed = false; - public void setStorageFailed(){ + public void setStorageFailed() { this.failed = true; } @@ -87,7 +87,7 @@ public class MockDatanodeStorage { + chunkInfo.getChunkName() + "_" + chunkInfo.getOffset(); } - public Map<String, ByteString> getAllBlockData(){ + public Map<String, ByteString> getAllBlockData() { return this.data; } diff --git a/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/MockOmTransport.java b/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/MockOmTransport.java index c663970..90ed563 100644 --- a/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/MockOmTransport.java +++ b/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/MockOmTransport.java @@ -270,7 +270,7 @@ public class MockOmTransport implements OmTransport { private InfoBucketResponse infoBucket(InfoBucketRequest infoBucketRequest) { BucketInfo bucketInfo = buckets.get(infoBucketRequest.getVolumeName()) .get(infoBucketRequest.getBucketName()); - if(!bucketInfo.hasDefaultReplicationConfig()) { + if (!bucketInfo.hasDefaultReplicationConfig()) { final ReplicationConfig replicationConfig = ReplicationConfig .getDefault(new OzoneConfiguration()); @@ -354,7 +354,7 @@ public class MockOmTransport implements OmTransport { return CreateBucketResponse.newBuilder().build(); } - public Map<String, Map<String, Map<String, KeyInfo>>> getKeys(){ + public Map<String, Map<String, Map<String, KeyInfo>>> getKeys() { return this.keys; } diff --git a/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/MockXceiverClientFactory.java b/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/MockXceiverClientFactory.java index ef2fd43..fbcc153 100644 --- a/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/MockXceiverClientFactory.java +++ b/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/MockXceiverClientFactory.java @@ -41,7 +41,7 @@ public class MockXceiverClientFactory public void setFailedStorages(List<DatanodeDetails> failedStorages) { List<DatanodeDetails> remainingFailNodes = new ArrayList<>(); - for(int i=0; i< failedStorages.size(); i++){ + for (int i = 0; i < failedStorages.size(); i++) { DatanodeDetails failedDN = failedStorages.get(i); boolean isCurrentNodeMarked = false; final Iterator<Map.Entry<DatanodeDetails, MockDatanodeStorage>> iterator = @@ -55,7 +55,7 @@ public class MockXceiverClientFactory isCurrentNodeMarked = true; } } - if(!isCurrentNodeMarked){ + if (!isCurrentNodeMarked) { //This node does not initialized by client yet. remainingFailNodes.add(failedDN); } diff --git a/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/MultiNodePipelineBlockAllocator.java b/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/MultiNodePipelineBlockAllocator.java index ee16d6d..97c5cfd 100644 --- a/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/MultiNodePipelineBlockAllocator.java +++ b/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/MultiNodePipelineBlockAllocator.java @@ -58,7 +58,7 @@ public class MultiNodePipelineBlockAllocator implements MockBlockAllocator { } } - public List<HddsProtos.DatanodeDetailsProto> getClusterDns(){ + public List<HddsProtos.DatanodeDetailsProto> getClusterDns() { return this.clusterDns; } diff --git a/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/TestOzoneECClient.java b/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/TestOzoneECClient.java index f8fee62..758e3bd 100644 --- a/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/TestOzoneECClient.java +++ b/hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/TestOzoneECClient.java @@ -194,7 +194,7 @@ public class TestOzoneECClient { Assert.assertEquals(keyName, key.getName()); try (OzoneInputStream is = bucket.readKey(keyName)) { byte[] fileContent = new byte[chunkSize]; - for (int i=0; i<dataBlocks; i++) { + for (int i = 0; i < dataBlocks; i++) { Assert.assertEquals(inputChunks[i].length, is.read(fileContent)); Assert.assertTrue(Arrays.equals(inputChunks[i], fileContent)); } @@ -389,7 +389,7 @@ public class TestOzoneECClient { // create key without mentioning replication config. Since we set EC // replication in bucket, key should be EC key. - try (OzoneOutputStream out = bucket.createKey("mykey", 6*inputSize)) { + try (OzoneOutputStream out = bucket.createKey("mykey", 6 * inputSize)) { Assert.assertTrue(out.getOutputStream() instanceof ECKeyOutputStream); // Block Size is 2kb, so to create 3 blocks we need 6 iterations here for (int j = 0; j < 6; j++) { @@ -449,7 +449,7 @@ public class TestOzoneECClient { try (OzoneOutputStream out = bucket.createKey(keyName, inputSize, new ECReplicationConfig(dataBlocks, parityBlocks, ECReplicationConfig.EcCodec.RS, chunkSize), new HashMap<>())) { - for (int i = 0; i < inputChunks[0].length-1; i++) { + for (int i = 0; i < inputChunks[0].length - 1; i++) { out.write(inputChunks[0][i]); } } @@ -486,7 +486,7 @@ public class TestOzoneECClient { try (OzoneInputStream is = bucket.readKey(keyName)) { byte[] fileContent = new byte[chunkSize]; - for (int i=0; i<2; i++) { + for (int i = 0; i < 2; i++) { Assert.assertEquals(inputChunks[i].length, is.read(fileContent)); Assert.assertTrue(Arrays.equals(inputChunks[i], fileContent)); } diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestECKeyOutputStream.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestECKeyOutputStream.java index cc4c0ae..c3f0765 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestECKeyOutputStream.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestECKeyOutputStream.java @@ -185,7 +185,7 @@ public class TestECKeyOutputStream { } byte[] buf = new byte[chunkSize]; try (OzoneInputStream in = bucket.readKey(keyString)) { - for (int i=0; i< inputChunks.length; i++) { + for (int i = 0; i < inputChunks.length; i++) { int read = in.read(buf, 0, chunkSize); Assert.assertEquals(chunkSize, read); Assert.assertTrue(Arrays.equals(buf, inputChunks[i])); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/ECStreamTestUtil.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/ECStreamTestUtil.java index f1f4a44..2aa32b6 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/ECStreamTestUtil.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/ECStreamTestUtil.java @@ -110,7 +110,7 @@ public final class ECStreamTestUtil { SplittableRandom rand, int length) { Preconditions.assertTrue(totalSpaceAvailable(bufs) >= length); int remaining = length; - while(remaining > 0) { + while (remaining > 0) { for (ByteBuffer b : bufs) { int toWrite = Math.min(stripeSize, remaining); for (int i = 0; i < toWrite; i++) { @@ -147,7 +147,7 @@ public final class ECStreamTestUtil { */ public static void assertBufferMatches(ByteBuffer b, SplittableRandom rand) { b.flip(); - int i=0; + int i = 0; while (b.hasRemaining()) { i++; Assert.assertEquals("Failed on iteration " + i, diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestBlockInputStreamFactoryImpl.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestBlockInputStreamFactoryImpl.java index badb33b..dcc03bc 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestBlockInputStreamFactoryImpl.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestBlockInputStreamFactoryImpl.java @@ -67,8 +67,8 @@ public class TestBlockInputStreamFactoryImpl { ReplicationConfig repConfig = new ECReplicationConfig(3, 2); - OmKeyLocationInfo blockInfo = createKeyLocationInfo(repConfig, 5, - 1024*1024*10); + OmKeyLocationInfo blockInfo = + createKeyLocationInfo(repConfig, 5, 1024 * 1024 * 10); BlockExtendedInputStream stream = factory.create(repConfig, blockInfo, blockInfo.getPipeline(), diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestECBlockInputStream.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestECBlockInputStream.java index 60a3a85..b3b01ba4 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestECBlockInputStream.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestECBlockInputStream.java @@ -402,7 +402,7 @@ public class TestECBlockInputStream { private void validateBufferContents(ByteBuffer buf, int from, int to, byte val) { - for (int i=from; i<to; i++){ + for (int i = from; i < to; i++) { Assert.assertEquals(val, buf.get(i)); } } @@ -486,7 +486,7 @@ public class TestECBlockInputStream { } int toRead = Math.min(buf.remaining(), (int)getRemaining()); - for (int i=0; i<toRead; i++) { + for (int i = 0; i < toRead; i++) { buf.put(dataVal); } position += toRead; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestECBlockInputStreamProxy.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestECBlockInputStreamProxy.java index 160ded4..fd4e8ad 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestECBlockInputStreamProxy.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestECBlockInputStreamProxy.java @@ -209,7 +209,7 @@ public class TestECBlockInputStreamProxy { ByteBuffer readBuffer = ByteBuffer.allocate(100); dataGenerator = new SplittableRandom(randomSeed); try (ECBlockInputStreamProxy bis = createBISProxy(repConfig, blockInfo)) { - while(true) { + while (true) { int read = bis.read(readBuffer); ECStreamTestUtil.assertBufferMatches(readBuffer, dataGenerator); readBuffer.clear(); @@ -237,7 +237,7 @@ public class TestECBlockInputStreamProxy { ByteBuffer readBuffer = ByteBuffer.allocate(100); dataGenerator = new SplittableRandom(randomSeed); try (ECBlockInputStreamProxy bis = createBISProxy(repConfig, blockInfo)) { - while(true) { + while (true) { int read = bis.read(readBuffer); ECStreamTestUtil.assertBufferMatches(readBuffer, dataGenerator); readBuffer.clear(); @@ -277,7 +277,7 @@ public class TestECBlockInputStreamProxy { // stream. streamFactory.getStreams().get(false).setShouldError(true, 151, new BadDataLocationException(badDN, "Simulated Error")); - while(true) { + while (true) { readBuffer.clear(); read = bis.read(readBuffer); ECStreamTestUtil.assertBufferMatches(readBuffer, dataGenerator); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestECBlockReconstructedInputStream.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestECBlockReconstructedInputStream.java index bd5ddd0..5d73b94 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestECBlockReconstructedInputStream.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestECBlockReconstructedInputStream.java @@ -73,7 +73,7 @@ public class TestECBlockReconstructedInputStream { public void testBlockLengthReturned() throws IOException { Map<DatanodeDetails, Integer> dnMap = ECStreamTestUtil.createIndexMap(4, 5); - try(ECBlockReconstructedStripeInputStream stripeStream + try (ECBlockReconstructedStripeInputStream stripeStream = createStripeInputStream(dnMap, 12345L)) { try (ECBlockReconstructedInputStream stream = new ECBlockReconstructedInputStream(repConfig, bufferPool, @@ -87,8 +87,8 @@ public class TestECBlockReconstructedInputStream { public void testBlockIDReturned() throws IOException { Map<DatanodeDetails, Integer> dnMap = ECStreamTestUtil.createIndexMap(1, 4, 5); - try(ECBlockReconstructedStripeInputStream stripeStream - = createStripeInputStream(dnMap, 12345L)) { + try (ECBlockReconstructedStripeInputStream stripeStream + = createStripeInputStream(dnMap, 12345L)) { try (ECBlockReconstructedInputStream stream = new ECBlockReconstructedInputStream(repConfig, bufferPool, stripeStream)) { @@ -112,8 +112,8 @@ public class TestECBlockReconstructedInputStream { Map<DatanodeDetails, Integer> dnMap = ECStreamTestUtil.createIndexMap(1, 2, 4, 5); - try(ECBlockReconstructedStripeInputStream stripeStream - = createStripeInputStream(dnMap, blockLength)) { + try (ECBlockReconstructedStripeInputStream stripeStream + = createStripeInputStream(dnMap, blockLength)) { try (ECBlockReconstructedInputStream stream = new ECBlockReconstructedInputStream(repConfig, bufferPool, stripeStream)) { @@ -150,8 +150,8 @@ public class TestECBlockReconstructedInputStream { Map<DatanodeDetails, Integer> dnMap = ECStreamTestUtil.createIndexMap(1, 2, 4, 5); - try(ECBlockReconstructedStripeInputStream stripeStream - = createStripeInputStream(dnMap, blockLength)) { + try (ECBlockReconstructedStripeInputStream stripeStream + = createStripeInputStream(dnMap, blockLength)) { try (ECBlockReconstructedInputStream stream = new ECBlockReconstructedInputStream(repConfig, bufferPool, stripeStream)) { @@ -182,8 +182,8 @@ public class TestECBlockReconstructedInputStream { Map<DatanodeDetails, Integer> dnMap = ECStreamTestUtil.createIndexMap(1, 2, 4, 5); - try(ECBlockReconstructedStripeInputStream stripeStream - = createStripeInputStream(dnMap, blockLength)) { + try (ECBlockReconstructedStripeInputStream stripeStream + = createStripeInputStream(dnMap, blockLength)) { try (ECBlockReconstructedInputStream stream = new ECBlockReconstructedInputStream(repConfig, bufferPool, stripeStream)) { @@ -218,8 +218,8 @@ public class TestECBlockReconstructedInputStream { Map<DatanodeDetails, Integer> dnMap = ECStreamTestUtil.createIndexMap(1, 2, 4, 5); byte[] buf = new byte[1024]; - try(ECBlockReconstructedStripeInputStream stripeStream - = createStripeInputStream(dnMap, blockLength)) { + try (ECBlockReconstructedStripeInputStream stripeStream + = createStripeInputStream(dnMap, blockLength)) { try (ECBlockReconstructedInputStream stream = new ECBlockReconstructedInputStream(repConfig, bufferPool, stripeStream)) { @@ -255,8 +255,8 @@ public class TestECBlockReconstructedInputStream { Map<DatanodeDetails, Integer> dnMap = ECStreamTestUtil.createIndexMap(1, 2, 4, 5); - try(ECBlockReconstructedStripeInputStream stripeStream - = createStripeInputStream(dnMap, blockLength)) { + try (ECBlockReconstructedStripeInputStream stripeStream + = createStripeInputStream(dnMap, blockLength)) { try (ECBlockReconstructedInputStream stream = new ECBlockReconstructedInputStream(repConfig, bufferPool, stripeStream)) { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestECBlockReconstructedStripeInputStream.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestECBlockReconstructedStripeInputStream.java index ec9bbdc..3381ef5 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestECBlockReconstructedStripeInputStream.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestECBlockReconstructedStripeInputStream.java @@ -537,7 +537,7 @@ public class TestECBlockReconstructedStripeInputStream { } } - @Test(expected=InsufficientLocationsException.class) + @Test(expected = InsufficientLocationsException.class) public void testAllLocationsFailOnFirstRead() throws IOException { // This test simulates stale nodes. When the nodes are stale, but not yet // dead, the locations will still be given to the client and it will try to diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestKeyInputStream.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestKeyInputStream.java index 3876c1b..c3dd75f 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestKeyInputStream.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestKeyInputStream.java @@ -229,7 +229,7 @@ public class TestKeyInputStream extends TestInputStreamBase { int dataLength = (9 * BLOCK_SIZE + ecChunkSize); byte[] inputData = writeRandomBytes(keyName, repConfig, dataLength); - try(KeyInputStream keyInputStream = getKeyInputStream(keyName)) { + try (KeyInputStream keyInputStream = getKeyInputStream(keyName)) { validate(keyInputStream, inputData, 0, ecChunkSize + 1234); diff --git a/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneClientUtils.java b/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneClientUtils.java index f218160..3a45c90 100644 --- a/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneClientUtils.java +++ b/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneClientUtils.java @@ -183,7 +183,8 @@ public final class OzoneClientUtils { String clientConfiguredDefaultReplication = clientSideConfig.get(OZONE_REPLICATION); - if (userPassedReplication == null && clientConfiguredDefaultReplication != null) { + if (userPassedReplication == null + && clientConfiguredDefaultReplication != null) { clientReplication = clientConfiguredDefaultReplication; } diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/bucket/CreateBucketHandler.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/bucket/CreateBucketHandler.java index a40c531..cd30f34 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/bucket/CreateBucketHandler.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/shell/bucket/CreateBucketHandler.java @@ -121,7 +121,7 @@ public class CreateBucketHandler extends BucketHandler { } } - if(replicationType!=null) { + if (replicationType != null) { if (replication != null) { ReplicationConfig replicationConfig = ReplicationConfig .parse(ReplicationType.valueOf(replicationType), --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
