You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by ae...@apache.org on 2017/09/15 20:53:00 UTC
[2/2] hadoop git commit: HDFS-11612. Ozone: Cleanup Checkstyle
issues. Contributed by Shashikant Banerjee.
HDFS-11612. Ozone: Cleanup Checkstyle issues. Contributed by Shashikant Banerjee.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/8dbd0354
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/8dbd0354
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/8dbd0354
Branch: refs/heads/HDFS-7240
Commit: 8dbd0354c79fa7a95ed203fcf7c3bed93fa39e08
Parents: 154530a
Author: Anu Engineer <ae...@apache.org>
Authored: Fri Sep 15 13:49:12 2017 -0700
Committer: Anu Engineer <ae...@apache.org>
Committed: Fri Sep 15 13:49:12 2017 -0700
----------------------------------------------------------------------
.../org/apache/hadoop/cblock/package-info.java | 22 ++++++++
.../hadoop/ozone/ksm/helpers/KsmKeyInfo.java | 8 +--
.../hadoop/ozone/ksm/helpers/KsmVolumeArgs.java | 16 +++---
.../org/apache/hadoop/scm/XceiverClient.java | 24 ++++-----
.../apache/hadoop/scm/XceiverClientHandler.java | 10 ++--
.../apache/hadoop/scm/XceiverClientRatis.java | 5 +-
.../org/apache/hadoop/scm/XceiverClientSpi.java | 6 +--
.../container/common/helpers/ContainerInfo.java | 5 +-
.../scm/storage/ContainerProtocolCalls.java | 53 ++++++++-----------
.../org/apache/hadoop/ozone/TestOzoneAcls.java | 7 ++-
.../java/org/apache/hadoop/scm/TestArchive.java | 2 +-
.../container/common/helpers/KeyUtils.java | 6 +--
.../common/impl/ContainerManagerImpl.java | 3 +-
.../container/common/utils/package-info.java | 18 +++++++
.../ozone/scm/block/BlockManagerImpl.java | 55 +++++++++++---------
.../ozone/scm/container/ContainerMapping.java | 27 +++++-----
.../ozone/web/exceptions/package-info.java | 22 ++++++++
.../hadoop/ozone/web/handlers/package-info.java | 22 ++++++++
.../hadoop/ozone/web/interfaces/Keys.java | 32 ++++--------
.../hadoop/ozone/web/interfaces/Volume.java | 53 +++++++------------
.../ozone/web/interfaces/package-info.java | 22 ++++++++
.../ozone/web/localstorage/package-info.java | 18 +++++++
.../hadoop/ozone/web/messages/package-info.java | 18 +++++++
.../web/netty/CloseableCleanupListener.java | 2 +-
.../web/netty/ObjectStoreJerseyContainer.java | 2 +-
.../ozone/web/ozShell/bucket/package-info.java | 23 ++++++++
.../ozone/web/ozShell/keys/GetKeyHandler.java | 2 -
.../ozone/web/ozShell/keys/PutKeyHandler.java | 2 -
.../ozone/web/ozShell/keys/package-info.java | 23 ++++++++
.../ozone/web/ozShell/volume/package-info.java | 23 ++++++++
.../hadoop/ozone/web/request/package-info.java | 23 ++++++++
.../hadoop/ozone/web/response/package-info.java | 23 ++++++++
.../hadoop/ozone/web/userauth/package-info.java | 23 ++++++++
.../namenode/ha/TestPipelinesFailover.java | 6 +--
.../ozone/container/common/TestEndPoint.java | 45 ++++++++--------
.../common/impl/TestContainerPersistence.java | 4 +-
.../apache/hadoop/ozone/ksm/TestKSMSQLCli.java | 1 -
.../hadoop/ozone/ksm/TestKeySpaceManager.java | 12 ++---
.../apache/hadoop/ozone/scm/TestSCMMXBean.java | 4 ++
.../apache/hadoop/ozone/web/TestBucketInfo.java | 8 +--
.../apache/hadoop/ozone/web/TestErrorCode.java | 4 +-
.../hadoop/ozone/web/TestOzoneWebAccess.java | 2 +-
.../org/apache/hadoop/ozone/web/TestQuota.java | 9 ++--
.../org/apache/hadoop/ozone/web/TestUtils.java | 18 +++----
.../hadoop/ozone/web/TestVolumeStructs.java | 11 ++--
.../hadoop/ozone/web/client/TestBuckets.java | 3 +-
.../hadoop/ozone/web/client/TestKeys.java | 10 ++--
.../hadoop/ozone/web/client/TestVolume.java | 17 +++---
48 files changed, 500 insertions(+), 254 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/cblock/package-info.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/cblock/package-info.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/cblock/package-info.java
new file mode 100644
index 0000000..5f5d3cd
--- /dev/null
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/cblock/package-info.java
@@ -0,0 +1,22 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.cblock;
+
+/**
+ This package contains ozone client side libraries.
+ */
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/ozone/ksm/helpers/KsmKeyInfo.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/ozone/ksm/helpers/KsmKeyInfo.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/ozone/ksm/helpers/KsmKeyInfo.java
index 6dea835..75b2bf8 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/ozone/ksm/helpers/KsmKeyInfo.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/ozone/ksm/helpers/KsmKeyInfo.java
@@ -115,13 +115,13 @@ public final class KsmKeyInfo {
return this;
}
- public Builder setCreationTime(long creationTime) {
- this.creationTime = creationTime;
+ public Builder setCreationTime(long crTime) {
+ this.creationTime = crTime;
return this;
}
- public Builder setModificationTime(long modificationTime) {
- this.modificationTime = modificationTime;
+ public Builder setModificationTime(long mTime) {
+ this.modificationTime = mTime;
return this;
}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/ozone/ksm/helpers/KsmVolumeArgs.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/ozone/ksm/helpers/KsmVolumeArgs.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/ozone/ksm/helpers/KsmVolumeArgs.java
index 4d60827..6b1020c 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/ozone/ksm/helpers/KsmVolumeArgs.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/ozone/ksm/helpers/KsmVolumeArgs.java
@@ -142,18 +142,18 @@ public final class KsmVolumeArgs {
aclMap = new KsmOzoneAclMap();
}
- public Builder setAdminName(String adminName) {
- this.adminName = adminName;
+ public Builder setAdminName(String admin) {
+ this.adminName = admin;
return this;
}
- public Builder setOwnerName(String ownerName) {
- this.ownerName = ownerName;
+ public Builder setOwnerName(String owner) {
+ this.ownerName = owner;
return this;
}
- public Builder setVolume(String volume) {
- this.volume = volume;
+ public Builder setVolume(String volumeName) {
+ this.volume = volumeName;
return this;
}
@@ -162,8 +162,8 @@ public final class KsmVolumeArgs {
return this;
}
- public Builder setQuotaInBytes(long quotaInBytes) {
- this.quotaInBytes = quotaInBytes;
+ public Builder setQuotaInBytes(long quota) {
+ this.quotaInBytes = quota;
return this;
}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/XceiverClient.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/XceiverClient.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/XceiverClient.java
index 4b98772..9cdc379 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/XceiverClient.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/XceiverClient.java
@@ -123,11 +123,11 @@ public class XceiverClient extends XceiverClientSpi {
ContainerProtos.ContainerCommandRequestProto request)
throws IOException {
try {
- if ((channelFuture == null) || (!channelFuture.channel().isActive())) {
- throw new IOException("This channel is not connected.");
- }
- XceiverClientHandler handler =
- channelFuture.channel().pipeline().get(XceiverClientHandler.class);
+ if ((channelFuture == null) || (!channelFuture.channel().isActive())) {
+ throw new IOException("This channel is not connected.");
+ }
+ XceiverClientHandler handler =
+ channelFuture.channel().pipeline().get(XceiverClientHandler.class);
return handler.sendCommand(request);
} catch (ExecutionException | InterruptedException e) {
@@ -144,13 +144,13 @@ public class XceiverClient extends XceiverClientSpi {
*/
@Override
public CompletableFuture<ContainerProtos.ContainerCommandResponseProto>
- sendCommandAsync(ContainerProtos.ContainerCommandRequestProto request)
+ sendCommandAsync(ContainerProtos.ContainerCommandRequestProto request)
throws IOException, ExecutionException, InterruptedException {
- if ((channelFuture == null) || (!channelFuture.channel().isActive())) {
- throw new IOException("This channel is not connected.");
- }
- XceiverClientHandler handler =
- channelFuture.channel().pipeline().get(XceiverClientHandler.class);
- return handler.sendCommandAsync(request);
+ if ((channelFuture == null) || (!channelFuture.channel().isActive())) {
+ throw new IOException("This channel is not connected.");
+ }
+ XceiverClientHandler handler =
+ channelFuture.channel().pipeline().get(XceiverClientHandler.class);
+ return handler.sendCommandAsync(request);
}
}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/XceiverClientHandler.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/XceiverClientHandler.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/XceiverClientHandler.java
index 93d4438..cffd91e 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/XceiverClientHandler.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/XceiverClientHandler.java
@@ -109,8 +109,8 @@ public class XceiverClientHandler extends
* @return -- response
*/
- public ContainerCommandResponseProto
- sendCommand(ContainerProtos.ContainerCommandRequestProto request)
+ public ContainerCommandResponseProto sendCommand(
+ ContainerProtos.ContainerCommandRequestProto request)
throws ExecutionException, InterruptedException {
Future<ContainerCommandResponseProto> future = sendCommandAsync(request);
return future.get();
@@ -123,11 +123,11 @@ public class XceiverClientHandler extends
* @param request - Request to execute
* @return CompletableFuture
*/
- public CompletableFuture<ContainerCommandResponseProto>
- sendCommandAsync(ContainerProtos.ContainerCommandRequestProto request) {
+ public CompletableFuture<ContainerCommandResponseProto> sendCommandAsync(
+ ContainerProtos.ContainerCommandRequestProto request) {
// Throw an exception of request doesn't have traceId
- if(StringUtils.isEmpty(request.getTraceID())) {
+ if (StringUtils.isEmpty(request.getTraceID())) {
throw new IllegalArgumentException("Invalid trace ID");
}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/XceiverClientRatis.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/XceiverClientRatis.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/XceiverClientRatis.java
index 8ecf6f5..d6c7937 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/XceiverClientRatis.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/XceiverClientRatis.java
@@ -20,7 +20,6 @@ package org.apache.hadoop.scm;
import com.google.common.base.Preconditions;
import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hdfs.ozone.protocol.proto.ContainerProtos;
import org.apache.hadoop.hdfs.ozone.protocol.proto.ContainerProtos.ContainerCommandRequestProto;
import org.apache.hadoop.hdfs.ozone.protocol.proto.ContainerProtos.ContainerCommandResponseProto;
import org.apache.ratis.RatisHelper;
@@ -115,8 +114,8 @@ public final class XceiverClientRatis extends XceiverClientSpi {
* @throws IOException
*/
@Override
- public CompletableFuture<ContainerCommandResponseProto>
- sendCommandAsync(ContainerCommandRequestProto request)
+ public CompletableFuture<ContainerCommandResponseProto> sendCommandAsync(
+ ContainerCommandRequestProto request)
throws IOException, ExecutionException, InterruptedException {
throw new IOException("Not implemented");
}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/XceiverClientSpi.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/XceiverClientSpi.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/XceiverClientSpi.java
index aed29dc..3f297ad 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/XceiverClientSpi.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/XceiverClientSpi.java
@@ -103,8 +103,8 @@ public abstract class XceiverClientSpi implements Closeable {
* @return Response to the command
* @throws IOException
*/
- public abstract CompletableFuture<ContainerCommandResponseProto>
- sendCommandAsync(ContainerCommandRequestProto request) throws IOException,
- ExecutionException, InterruptedException;
+ public abstract CompletableFuture<ContainerCommandResponseProto> sendCommandAsync(
+ ContainerCommandRequestProto request)
+ throws IOException, ExecutionException, InterruptedException;
}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/container/common/helpers/ContainerInfo.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/container/common/helpers/ContainerInfo.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/container/common/helpers/ContainerInfo.java
index 16bc0db..34be5f1 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/container/common/helpers/ContainerInfo.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/container/common/helpers/ContainerInfo.java
@@ -82,13 +82,14 @@ public class ContainerInfo {
return builder.build();
}
+ /** Builder class for ContainerInfo. */
public static class Builder {
private OzoneProtos.LifeCycleState state;
private Pipeline pipeline;
private long stateEnterTime;
- public Builder setState(OzoneProtos.LifeCycleState state) {
- this.state = state;
+ public Builder setState(OzoneProtos.LifeCycleState lifeCycleState) {
+ this.state = lifeCycleState;
return this;
}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/storage/ContainerProtocolCalls.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/storage/ContainerProtocolCalls.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/storage/ContainerProtocolCalls.java
index 48e335f..0e992a5 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/storage/ContainerProtocolCalls.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/scm/storage/ContainerProtocolCalls.java
@@ -188,40 +188,33 @@ public final class ContainerProtocolCalls {
* @param traceID - Trace ID for logging purpose.
* @throws IOException
*/
- public static void writeSmallFile(XceiverClientSpi client, String containerName,
- String key, byte[] data, String traceID) throws IOException {
+ public static void writeSmallFile(XceiverClientSpi client,
+ String containerName, String key, byte[] data, String traceID)
+ throws IOException {
- KeyData containerKeyData = KeyData
- .newBuilder()
- .setContainerName(containerName)
- .setName(key).build();
- PutKeyRequestProto.Builder createKeyRequest = PutKeyRequestProto
- .newBuilder()
- .setPipeline(client.getPipeline().getProtobufMessage())
- .setKeyData(containerKeyData);
+ KeyData containerKeyData =
+ KeyData.newBuilder().setContainerName(containerName).setName(key)
+ .build();
+ PutKeyRequestProto.Builder createKeyRequest =
+ PutKeyRequestProto.newBuilder()
+ .setPipeline(client.getPipeline().getProtobufMessage())
+ .setKeyData(containerKeyData);
- KeyValue keyValue = KeyValue.newBuilder()
- .setKey("OverWriteRequested").setValue("true").build();
- ChunkInfo chunk = ChunkInfo
- .newBuilder()
- .setChunkName(key + "_chunk")
- .setOffset(0)
- .setLen(data.length)
- .addMetadata(keyValue)
- .build();
+ KeyValue keyValue =
+ KeyValue.newBuilder().setKey("OverWriteRequested").setValue("true")
+ .build();
+ ChunkInfo chunk =
+ ChunkInfo.newBuilder().setChunkName(key + "_chunk").setOffset(0)
+ .setLen(data.length).addMetadata(keyValue).build();
- PutSmallFileRequestProto putSmallFileRequest = PutSmallFileRequestProto
- .newBuilder().setChunkInfo(chunk)
- .setKey(createKeyRequest)
- .setData(ByteString.copyFrom(data))
- .build();
+ PutSmallFileRequestProto putSmallFileRequest =
+ PutSmallFileRequestProto.newBuilder().setChunkInfo(chunk)
+ .setKey(createKeyRequest).setData(ByteString.copyFrom(data))
+ .build();
- ContainerCommandRequestProto request = ContainerCommandRequestProto
- .newBuilder()
- .setCmdType(Type.PutSmallFile)
- .setTraceID(traceID)
- .setPutSmallFile(putSmallFileRequest)
- .build();
+ ContainerCommandRequestProto request =
+ ContainerCommandRequestProto.newBuilder().setCmdType(Type.PutSmallFile)
+ .setTraceID(traceID).setPutSmallFile(putSmallFileRequest).build();
ContainerCommandResponseProto response = client.sendCommand(request);
validateContainerResponse(response);
}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs-client/src/test/java/org/apache/hadoop/ozone/TestOzoneAcls.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/test/java/org/apache/hadoop/ozone/TestOzoneAcls.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/test/java/org/apache/hadoop/ozone/TestOzoneAcls.java
index e8fd4d3..c70b75e 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/test/java/org/apache/hadoop/ozone/TestOzoneAcls.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/test/java/org/apache/hadoop/ozone/TestOzoneAcls.java
@@ -26,10 +26,13 @@ import java.util.Set;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
+/**
+ * This class is to test acl stoarge and retreival in ozone store.
+ */
public class TestOzoneAcls {
@Test
- public void TestACLParse() {
+ public void testAclParse() {
HashMap<String, Boolean> testMatrix;
testMatrix = new HashMap<>();
@@ -103,7 +106,7 @@ public class TestOzoneAcls {
}
@Test
- public void TestACLValues() {
+ public void testAclValues() {
OzoneAcl acl = OzoneAcl.parseAcl("user:bilbo:rw");
assertEquals(acl.getName(), "bilbo");
assertEquals(acl.getRights(), OzoneAcl.OzoneACLRights.READ_WRITE);
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs-client/src/test/java/org/apache/hadoop/scm/TestArchive.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/test/java/org/apache/hadoop/scm/TestArchive.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/test/java/org/apache/hadoop/scm/TestArchive.java
index 3030575..86adddb 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/test/java/org/apache/hadoop/scm/TestArchive.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/test/java/org/apache/hadoop/scm/TestArchive.java
@@ -46,6 +46,7 @@ public class TestArchive {
private long checksumWrite = 0L;
private long checksumRead = 0L;
private long tmp = 0L;
+ private Checksum crc = new Adler32();
@Rule
public TemporaryFolder folder = new TemporaryFolder();
@@ -53,7 +54,6 @@ public class TestArchive {
@Rule
public TemporaryFolder outputFolder = new TemporaryFolder();
- Checksum crc = new Adler32();
@Before
public void setUp() throws Exception {
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/container/common/helpers/KeyUtils.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/container/common/helpers/KeyUtils.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/container/common/helpers/KeyUtils.java
index d508e91..b1c2b00 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/container/common/helpers/KeyUtils.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/container/common/helpers/KeyUtils.java
@@ -23,9 +23,7 @@ import org.apache.hadoop.hdfs.ozone.protocol.proto.ContainerProtos;
import org.apache.hadoop.scm.container.common.helpers.StorageContainerException;
import org.apache.hadoop.ozone.container.common.utils.ContainerCache;
import org.apache.hadoop.utils.MetadataStore;
-import org.apache.hadoop.utils.MetadataStoreBuilder;
-import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
@@ -142,8 +140,8 @@ public final class KeyUtils {
KeyData data = KeyData.getFromProtoBuf(kd);
return data;
} catch (IOException e) {
- throw new StorageContainerException("Failed to parse key data from the bytes array.",
- NO_SUCH_KEY);
+ throw new StorageContainerException("Failed to parse key data from the" +
+ " bytes array.", NO_SUCH_KEY);
}
}
}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerManagerImpl.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerManagerImpl.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerManagerImpl.java
index 88c6126..deed64a 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerManagerImpl.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/container/common/impl/ContainerManagerImpl.java
@@ -430,7 +430,8 @@ public class ContainerManagerImpl implements ContainerManager {
try {
if (isOpen(pipeline.getContainerName())) {
throw new StorageContainerException(
- "Deleting an open container is not allowed.", UNCLOSED_CONTAINER_IO);
+ "Deleting an open container is not allowed.",
+ UNCLOSED_CONTAINER_IO);
}
ContainerStatus status = containerMap.get(containerName);
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/container/common/utils/package-info.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/container/common/utils/package-info.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/container/common/utils/package-info.java
new file mode 100644
index 0000000..08264f0
--- /dev/null
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/container/common/utils/package-info.java
@@ -0,0 +1,18 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.ozone.container.common.utils;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/block/BlockManagerImpl.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/block/BlockManagerImpl.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/block/BlockManagerImpl.java
index 23b1c8b..23faaf9 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/block/BlockManagerImpl.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/block/BlockManagerImpl.java
@@ -290,7 +290,8 @@ public class BlockManagerImpl implements BlockManager, BlockmanagerMXBean {
private BlockContainerInfo getContainer(OzoneProtos.LifeCycleState state,
String name) {
- Map<String, BlockContainerInfo> containersByState = this.containers.get(state);
+ Map<String, BlockContainerInfo> containersByState =
+ this.containers.get(state);
return containersByState.get(name);
}
@@ -318,15 +319,15 @@ public class BlockManagerImpl implements BlockManager, BlockmanagerMXBean {
private void refreshContainers() {
Map<String, BlockContainerInfo> containersByState =
this.containers.get(OzoneProtos.LifeCycleState.CREATING);
- for (String containerName: containersByState.keySet()) {
+ for (String containerName : containersByState.keySet()) {
try {
ContainerInfo containerInfo =
containerManager.getContainer(containerName);
if (containerInfo == null) {
// TODO: clean up containers that has been deleted on SCM but
// TODO: still in ALLOCATED state in block manager.
- LOG.debug("Container {} allocated by block service" +
- "can't be found in SCM", containerName);
+ LOG.debug("Container {} allocated by block service"
+ + "can't be found in SCM", containerName);
continue;
}
if (containerInfo.getState() == OzoneProtos.LifeCycleState.OPEN) {
@@ -340,7 +341,7 @@ public class BlockManagerImpl implements BlockManager, BlockmanagerMXBean {
LOG.debug("Failed to get container info for: {}", containerName);
}
}
- }
+ }
/**
* Allocates a new block for a given size.
@@ -356,8 +357,7 @@ public class BlockManagerImpl implements BlockManager, BlockmanagerMXBean {
public AllocatedBlock allocateBlock(final long size) throws IOException {
boolean createContainer = false;
if (size < 0 || size > containerSize) {
- throw new SCMException("Unsupported block size",
- INVALID_BLOCK_SIZE);
+ throw new SCMException("Unsupported block size", INVALID_BLOCK_SIZE);
}
if (!nodeManager.isOutOfNodeChillMode()) {
throw new SCMException("Unable to create block while in chill mode",
@@ -370,8 +370,8 @@ public class BlockManagerImpl implements BlockManager, BlockmanagerMXBean {
List<String> candidates;
candidates = filterContainers(OzoneProtos.LifeCycleState.OPEN, size);
if (candidates.size() == 0) {
- candidates = filterContainers(OzoneProtos.LifeCycleState.ALLOCATED,
- size);
+ candidates =
+ filterContainers(OzoneProtos.LifeCycleState.ALLOCATED, size);
if (candidates.size() == 0) {
try {
candidates = allocateContainers(containerProvisionBatchSize);
@@ -383,8 +383,9 @@ public class BlockManagerImpl implements BlockManager, BlockmanagerMXBean {
}
// now we should have some candidates in ALLOCATE state
if (candidates.size() == 0) {
- throw new SCMException("Fail to find any container to allocate block "
- + "of size " + size + ".", FAILED_TO_FIND_CONTAINER_WITH_SPACE);
+ throw new SCMException(
+ "Fail to find any container to allocate block " + "of size "
+ + size + ".", FAILED_TO_FIND_CONTAINER_WITH_SPACE);
}
}
@@ -416,8 +417,8 @@ public class BlockManagerImpl implements BlockManager, BlockmanagerMXBean {
// TODO: make block key easier to debug (e.g., seq no)
// Allocate key for the block
String blockKey = UUID.randomUUID().toString();
- AllocatedBlock.Builder abb = new AllocatedBlock.Builder()
- .setKey(blockKey).setPipeline(containerInfo.getPipeline())
+ AllocatedBlock.Builder abb = new AllocatedBlock.Builder().setKey(blockKey)
+ .setPipeline(containerInfo.getPipeline())
.setShouldCreateContainer(createContainer);
if (containerInfo.getPipeline().getMachines().size() > 0) {
blockStore.put(DFSUtil.string2Bytes(blockKey),
@@ -428,12 +429,12 @@ public class BlockManagerImpl implements BlockManager, BlockmanagerMXBean {
getContainer(containerInfo.getState(), containerName);
Preconditions.checkNotNull(containerInfoUpdate);
containerInfoUpdate.addAllocated(size);
- containerStore.put(DFSUtil.string2Bytes(containerName),
- DFSUtil.string2Bytes(Long.toString(containerInfoUpdate.getAllocated())));
+ containerStore.put(DFSUtil.string2Bytes(containerName), DFSUtil
+ .string2Bytes(Long.toString(containerInfoUpdate.getAllocated())));
if (createContainer) {
- OzoneProtos.LifeCycleState newState =
- containerManager.updateContainerState(containerName,
- OzoneProtos.LifeCycleEvent.BEGIN_CREATE);
+ OzoneProtos.LifeCycleState newState = containerManager
+ .updateContainerState(containerName,
+ OzoneProtos.LifeCycleEvent.BEGIN_CREATE);
updateContainer(containerInfo.getState(), containerName, newState);
}
return abb.build();
@@ -457,17 +458,19 @@ public class BlockManagerImpl implements BlockManager, BlockmanagerMXBean {
try {
byte[] containerBytes = blockStore.get(DFSUtil.string2Bytes(key));
if (containerBytes == null) {
- throw new SCMException("Specified block key does not exist. key : " +
- key, FAILED_TO_FIND_BLOCK);
+ throw new SCMException(
+ "Specified block key does not exist. key : " + key,
+ FAILED_TO_FIND_BLOCK);
}
String containerName = DFSUtil.bytes2String(containerBytes);
- ContainerInfo containerInfo = containerManager.getContainer(
- containerName);
+ ContainerInfo containerInfo =
+ containerManager.getContainer(containerName);
if (containerInfo == null) {
- LOG.debug("Container {} allocated by block service" +
- "can't be found in SCM", containerName);
- throw new SCMException("Unable to find container for the block",
- SCMException.ResultCodes.FAILED_TO_FIND_CONTAINER);
+ LOG.debug(
+ "Container {} allocated by block service" + "can't be found in SCM",
+ containerName);
+ throw new SCMException("Unable to find container for the block",
+ SCMException.ResultCodes.FAILED_TO_FIND_CONTAINER);
}
return containerInfo.getPipeline();
} finally {
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerMapping.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerMapping.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerMapping.java
index c71f127..5a1af51 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerMapping.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerMapping.java
@@ -158,15 +158,17 @@ public class ContainerMapping implements Mapping {
* {@inheritDoc}
*/
@Override
- public ContainerInfo getContainer(final String containerName) throws IOException {
+ public ContainerInfo getContainer(final String containerName)
+ throws IOException {
ContainerInfo containerInfo;
lock.lock();
try {
byte[] containerBytes =
containerStore.get(containerName.getBytes(encoding));
if (containerBytes == null) {
- throw new SCMException("Specified key does not exist. key : " +
- containerName, SCMException.ResultCodes.FAILED_TO_FIND_CONTAINER);
+ throw new SCMException(
+ "Specified key does not exist. key : " + containerName,
+ SCMException.ResultCodes.FAILED_TO_FIND_CONTAINER);
}
containerInfo = ContainerInfo.fromProtobuf(
OzoneProtos.SCMContainerInfo.PARSER.parseFrom(containerBytes));
@@ -305,11 +307,11 @@ public class ContainerMapping implements Mapping {
lock.lock();
try {
byte[] dbKey = containerName.getBytes(encoding);
- byte[] containerBytes =
- containerStore.get(dbKey);
- if(containerBytes == null) {
- throw new SCMException("Failed to update container state"
- + containerName + ", reason : container doesn't exist.",
+ byte[] containerBytes = containerStore.get(dbKey);
+ if (containerBytes == null) {
+ throw new SCMException(
+ "Failed to update container state" + containerName
+ + ", reason : container doesn't exist.",
SCMException.ResultCodes.FAILED_TO_FIND_CONTAINER);
}
containerInfo = ContainerInfo.fromProtobuf(
@@ -317,11 +319,12 @@ public class ContainerMapping implements Mapping {
OzoneProtos.LifeCycleState newState;
try {
- newState = stateMachine.getNextState(containerInfo.getState(), event);
+ newState = stateMachine.getNextState(containerInfo.getState(), event);
} catch (InvalidStateTransitionException ex) {
- throw new SCMException("Failed to update container state"
- + containerName + ", reason : invalid state transition from state: "
- + containerInfo.getState() + " upon event: " + event + ".",
+ throw new SCMException(
+ "Failed to update container state" + containerName
+ + ", reason : invalid state transition from state: "
+ + containerInfo.getState() + " upon event: " + event + ".",
SCMException.ResultCodes.FAILED_TO_CHANGE_CONTAINER_STATE);
}
containerInfo.setState(newState);
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/exceptions/package-info.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/exceptions/package-info.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/exceptions/package-info.java
new file mode 100644
index 0000000..59cf724
--- /dev/null
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/exceptions/package-info.java
@@ -0,0 +1,22 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.ozone.web.exceptions;
+
+/**
+ This package contains ozone client side libraries.
+ */
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/handlers/package-info.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/handlers/package-info.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/handlers/package-info.java
new file mode 100644
index 0000000..4d34c2d
--- /dev/null
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/handlers/package-info.java
@@ -0,0 +1,22 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.ozone.web.handlers;
+
+/**
+ This package contains ozone client side libraries.
+ */
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/interfaces/Keys.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/interfaces/Keys.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/interfaces/Keys.java
index 1e830b1..ef70a6b 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/interfaces/Keys.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/interfaces/Keys.java
@@ -62,14 +62,9 @@ public interface Keys {
@PUT
@Consumes(MediaType.WILDCARD)
Response putKey(@PathParam("volume") String volume,
- @PathParam("bucket") String bucket,
- @PathParam("keys") String keys,
- InputStream is,
- @Context Request req,
- @Context UriInfo info,
- @Context HttpHeaders headers)
- throws OzoneException;
-
+ @PathParam("bucket") String bucket, @PathParam("keys") String keys,
+ InputStream is, @Context Request req, @Context UriInfo info,
+ @Context HttpHeaders headers) throws OzoneException;
/**
* Gets the Key if it exists.
@@ -88,14 +83,10 @@ public interface Keys {
*/
@GET
Response getKey(@PathParam("volume") String volume,
- @PathParam("bucket") String bucket,
- @PathParam("keys") String keys,
- @QueryParam(Header.OZONE_LIST_QUERY_TAG)
- String info,
- @Context Request req,
- @Context UriInfo uriInfo,
- @Context HttpHeaders headers)
- throws OzoneException;
+ @PathParam("bucket") String bucket, @PathParam("keys") String keys,
+ @QueryParam(Header.OZONE_LIST_QUERY_TAG) String info,
+ @Context Request req, @Context UriInfo uriInfo,
+ @Context HttpHeaders headers) throws OzoneException;
/**
* Deletes an existing key.
@@ -112,11 +103,8 @@ public interface Keys {
*/
@DELETE
Response deleteKey(@PathParam("volume") String volume,
- @PathParam("bucket") String bucket,
- @PathParam("keys") String keys,
- @Context Request req,
- @Context UriInfo info,
- @Context HttpHeaders headers)
- throws OzoneException;
+ @PathParam("bucket") String bucket, @PathParam("keys") String keys,
+ @Context Request req, @Context UriInfo info, @Context HttpHeaders headers)
+ throws OzoneException;
}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/interfaces/Volume.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/interfaces/Volume.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/interfaces/Volume.java
index 91ede36..1d0b1af 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/interfaces/Volume.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/interfaces/Volume.java
@@ -65,13 +65,10 @@ public interface Volume {
@POST
Response createVolume(@PathParam("volume") String volume,
- @DefaultValue(Header.OZONE_QUOTA_UNDEFINED)
- @QueryParam(Header.OZONE_QUOTA_QUERY_TAG) String quota,
- @Context Request req,
- @Context UriInfo uriInfo,
- @Context HttpHeaders headers)
- throws OzoneException;
-
+ @DefaultValue(Header.OZONE_QUOTA_UNDEFINED)
+ @QueryParam(Header.OZONE_QUOTA_QUERY_TAG) String quota,
+ @Context Request req, @Context UriInfo uriInfo,
+ @Context HttpHeaders headers) throws OzoneException;
/**
* Updates a Volume owned by the user.
@@ -93,13 +90,10 @@ public interface Volume {
*/
@PUT
Response updateVolume(@PathParam("volume") String volume,
- @DefaultValue(Header.OZONE_QUOTA_UNDEFINED)
- @QueryParam(Header.OZONE_QUOTA_QUERY_TAG) String quota,
- @Context Request req,
- @Context UriInfo uriInfo,
- @Context HttpHeaders headers)
- throws OzoneException;
-
+ @DefaultValue(Header.OZONE_QUOTA_UNDEFINED)
+ @QueryParam(Header.OZONE_QUOTA_QUERY_TAG) String quota,
+ @Context Request req, @Context UriInfo uriInfo,
+ @Context HttpHeaders headers) throws OzoneException;
/**
* Deletes a Volume if it is empty.
@@ -112,10 +106,8 @@ public interface Volume {
*/
@DELETE
Response deleteVolume(@PathParam("volume") String volume,
- @Context Request req,
- @Context UriInfo uriInfo,
- @Context HttpHeaders headers)
- throws OzoneException;
+ @Context Request req, @Context UriInfo uriInfo,
+ @Context HttpHeaders headers) throws OzoneException;
/**
* Returns Volume info. This API can be invoked either
@@ -131,21 +123,14 @@ public interface Volume {
*/
@GET
Response getVolumeInfo(@PathParam("volume") String volume,
- @DefaultValue(Header.OZONE_LIST_QUERY_BUCKET)
- @QueryParam(Header.OZONE_LIST_QUERY_TAG)
- String info,
- @QueryParam(Header.OZONE_LIST_QUERY_PREFIX)
- String prefix,
- @DefaultValue(Header.OZONE_DEFAULT_LIST_SIZE)
- @QueryParam(Header.OZONE_LIST_QUERY_MAXKEYS)
- int keys,
- @QueryParam(Header.OZONE_LIST_QUERY_PREVKEY)
- String prevKey,
- @QueryParam(Header.OZONE_LIST_QUERY_ROOTSCAN)
- boolean rootScan,
- @Context Request req,
- @Context UriInfo uriInfo,
- @Context HttpHeaders headers)
- throws OzoneException;
+ @DefaultValue(Header.OZONE_LIST_QUERY_BUCKET)
+ @QueryParam(Header.OZONE_LIST_QUERY_TAG) String info,
+ @QueryParam(Header.OZONE_LIST_QUERY_PREFIX) String prefix,
+ @DefaultValue(Header.OZONE_DEFAULT_LIST_SIZE)
+ @QueryParam(Header.OZONE_LIST_QUERY_MAXKEYS) int keys,
+ @QueryParam(Header.OZONE_LIST_QUERY_PREVKEY) String prevKey,
+ @QueryParam(Header.OZONE_LIST_QUERY_ROOTSCAN) boolean rootScan,
+ @Context Request req, @Context UriInfo uriInfo,
+ @Context HttpHeaders headers) throws OzoneException;
}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/interfaces/package-info.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/interfaces/package-info.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/interfaces/package-info.java
new file mode 100644
index 0000000..940f179
--- /dev/null
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/interfaces/package-info.java
@@ -0,0 +1,22 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.ozone.web.interfaces;
+
+/**
+ This package contains ozone client side libraries.
+ */
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/localstorage/package-info.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/localstorage/package-info.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/localstorage/package-info.java
new file mode 100644
index 0000000..6bf6643
--- /dev/null
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/localstorage/package-info.java
@@ -0,0 +1,18 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.ozone.web.localstorage;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/messages/package-info.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/messages/package-info.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/messages/package-info.java
new file mode 100644
index 0000000..273b3f5
--- /dev/null
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/messages/package-info.java
@@ -0,0 +1,18 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.ozone.web.messages;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/netty/CloseableCleanupListener.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/netty/CloseableCleanupListener.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/netty/CloseableCleanupListener.java
index 5cfaa75..eac8e6f 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/netty/CloseableCleanupListener.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/netty/CloseableCleanupListener.java
@@ -35,7 +35,7 @@ final class CloseableCleanupListener implements ChannelFutureListener {
*
* @param closeables any number of closeable resources
*/
- public CloseableCleanupListener(Closeable... closeables) {
+ CloseableCleanupListener(Closeable... closeables) {
this.closeables = closeables;
}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/netty/ObjectStoreJerseyContainer.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/netty/ObjectStoreJerseyContainer.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/netty/ObjectStoreJerseyContainer.java
index 5b18e2e..c018663 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/netty/ObjectStoreJerseyContainer.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/netty/ObjectStoreJerseyContainer.java
@@ -213,7 +213,7 @@ public final class ObjectStoreJerseyContainer {
* @param respOut output stream for writing response body
* @param latch for coordinating asynchronous return of HTTP response
*/
- public RequestRunner(HttpRequest nettyReq, InputStream reqIn,
+ RequestRunner(HttpRequest nettyReq, InputStream reqIn,
OutputStream respOut, CountDownLatch latch) {
this.latch = latch;
this.nettyReq = nettyReq;
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/ozShell/bucket/package-info.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/ozShell/bucket/package-info.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/ozShell/bucket/package-info.java
new file mode 100644
index 0000000..c344c35
--- /dev/null
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/ozShell/bucket/package-info.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Netty-based HTTP server implementation for Ozone.
+ */
+package org.apache.hadoop.ozone.web.ozShell.bucket;
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/ozShell/keys/GetKeyHandler.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/ozShell/keys/GetKeyHandler.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/ozShell/keys/GetKeyHandler.java
index a244a24..5a6dc9f 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/ozShell/keys/GetKeyHandler.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/ozShell/keys/GetKeyHandler.java
@@ -20,9 +20,7 @@ package org.apache.hadoop.ozone.web.ozShell.keys;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.codec.digest.DigestUtils;
-import org.apache.hadoop.ozone.web.client.OzoneBucket;
import org.apache.hadoop.ozone.web.client.OzoneRestClientException;
-import org.apache.hadoop.ozone.web.client.OzoneVolume;
import org.apache.hadoop.ozone.web.exceptions.OzoneException;
import org.apache.hadoop.ozone.web.ozShell.Handler;
import org.apache.hadoop.ozone.web.ozShell.Shell;
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/ozShell/keys/PutKeyHandler.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/ozShell/keys/PutKeyHandler.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/ozShell/keys/PutKeyHandler.java
index 30cc2cb..dea919e 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/ozShell/keys/PutKeyHandler.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/ozShell/keys/PutKeyHandler.java
@@ -20,9 +20,7 @@ package org.apache.hadoop.ozone.web.ozShell.keys;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.codec.digest.DigestUtils;
-import org.apache.hadoop.ozone.web.client.OzoneBucket;
import org.apache.hadoop.ozone.web.client.OzoneRestClientException;
-import org.apache.hadoop.ozone.web.client.OzoneVolume;
import org.apache.hadoop.ozone.web.exceptions.OzoneException;
import org.apache.hadoop.ozone.web.ozShell.Handler;
import org.apache.hadoop.ozone.web.ozShell.Shell;
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/ozShell/keys/package-info.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/ozShell/keys/package-info.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/ozShell/keys/package-info.java
new file mode 100644
index 0000000..1deb7ad
--- /dev/null
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/ozShell/keys/package-info.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Netty-based HTTP server implementation for Ozone.
+ */
+package org.apache.hadoop.ozone.web.ozShell.keys;
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/ozShell/volume/package-info.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/ozShell/volume/package-info.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/ozShell/volume/package-info.java
new file mode 100644
index 0000000..fc19274
--- /dev/null
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/ozShell/volume/package-info.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Netty-based HTTP server implementation for Ozone.
+ */
+package org.apache.hadoop.ozone.web.ozShell.volume;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/request/package-info.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/request/package-info.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/request/package-info.java
new file mode 100644
index 0000000..4fbc18f
--- /dev/null
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/request/package-info.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Netty-based HTTP server implementation for Ozone.
+ */
+package org.apache.hadoop.ozone.web.request;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/response/package-info.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/response/package-info.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/response/package-info.java
new file mode 100644
index 0000000..3bf66c8
--- /dev/null
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/response/package-info.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Netty-based HTTP server implementation for Ozone.
+ */
+package org.apache.hadoop.ozone.web.response;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/userauth/package-info.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/userauth/package-info.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/userauth/package-info.java
new file mode 100644
index 0000000..d498fc8
--- /dev/null
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/ozone/web/userauth/package-info.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Netty-based HTTP server implementation for Ozone.
+ */
+package org.apache.hadoop.ozone.web.userauth;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestPipelinesFailover.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestPipelinesFailover.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestPipelinesFailover.java
index dc7f47a..219757c 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestPipelinesFailover.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestPipelinesFailover.java
@@ -440,13 +440,13 @@ public class TestPipelinesFailover {
};
for (String[] scmd: scmds) {
- String scmd_str = StringUtils.join(" ", scmd);
+ String scmdStr = StringUtils.join(" ", scmd);
try {
ShellCommandExecutor sce = new ShellCommandExecutor(scmd);
sce.execute();
- LOG.info("'" + scmd_str + "' output:\n" + sce.getOutput());
+ LOG.info("'" + scmdStr + "' output:\n" + sce.getOutput());
} catch (IOException e) {
- LOG.warn("Error when running '" + scmd_str + "'", e);
+ LOG.warn("Error when running '" + scmdStr + "'", e);
}
}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/common/TestEndPoint.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/common/TestEndPoint.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/common/TestEndPoint.java
index 35f2861..65cf654 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/common/TestEndPoint.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/common/TestEndPoint.java
@@ -306,28 +306,27 @@ public class TestEndPoint {
// Create a datanode state machine for stateConext used by endpoint task
- try (DatanodeStateMachine stateMachine =
- new DatanodeStateMachine(DFSTestUtil.getLocalDatanodeID(), conf);
- EndpointStateMachine rpcEndPoint = SCMTestUtils.createEndpoint(conf,
- scmAddress, rpcTimeout)) {
- ContainerNodeIDProto containerNodeID = ContainerNodeIDProto.newBuilder()
- .setClusterID(UUID.randomUUID().toString())
- .setDatanodeID(getDatanodeID().getProtoBufMessage())
- .build();
- rpcEndPoint.setState(EndpointStateMachine.EndPointStates.HEARTBEAT);
-
- final StateContext stateContext = new StateContext(conf,
- DatanodeStateMachine.DatanodeStates.RUNNING,
- stateMachine);
-
- HeartbeatEndpointTask endpointTask =
- new HeartbeatEndpointTask(rpcEndPoint, conf, stateContext);
- endpointTask.setContainerNodeIDProto(containerNodeID);
- endpointTask.call();
- Assert.assertNotNull(endpointTask.getContainerNodeIDProto());
+ try (DatanodeStateMachine stateMachine = new DatanodeStateMachine(
+ DFSTestUtil.getLocalDatanodeID(), conf);
+ EndpointStateMachine rpcEndPoint = SCMTestUtils
+ .createEndpoint(conf, scmAddress, rpcTimeout)) {
+ ContainerNodeIDProto containerNodeID = ContainerNodeIDProto.newBuilder()
+ .setClusterID(UUID.randomUUID().toString())
+ .setDatanodeID(getDatanodeID().getProtoBufMessage()).build();
+ rpcEndPoint.setState(EndpointStateMachine.EndPointStates.HEARTBEAT);
+
+ final StateContext stateContext =
+ new StateContext(conf, DatanodeStateMachine.DatanodeStates.RUNNING,
+ stateMachine);
- Assert.assertEquals(EndpointStateMachine.EndPointStates.HEARTBEAT,
- rpcEndPoint.getState());
+ HeartbeatEndpointTask endpointTask =
+ new HeartbeatEndpointTask(rpcEndPoint, conf, stateContext);
+ endpointTask.setContainerNodeIDProto(containerNodeID);
+ endpointTask.call();
+ Assert.assertNotNull(endpointTask.getContainerNodeIDProto());
+
+ Assert.assertEquals(EndpointStateMachine.EndPointStates.HEARTBEAT,
+ rpcEndPoint.getState());
}
}
@@ -360,8 +359,8 @@ public class TestEndPoint {
* @return
*/
ContainerReport getRandomContainerReport() {
- return new ContainerReport(UUID.randomUUID().toString()
- ,DigestUtils.sha256Hex("Random"));
+ return new ContainerReport(UUID.randomUUID().toString(),
+ DigestUtils.sha256Hex("Random"));
}
/**
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestContainerPersistence.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestContainerPersistence.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestContainerPersistence.java
index db1774d..5b2fce1 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestContainerPersistence.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestContainerPersistence.java
@@ -90,7 +90,7 @@ public class TestContainerPersistence {
@Rule
public Timeout testTimeout = new Timeout(300000);
- private static Logger LOG =
+ private static Logger log =
LoggerFactory.getLogger(TestContainerPersistence.class);
private static String path;
private static ContainerManagerImpl containerManager;
@@ -149,7 +149,7 @@ public class TestContainerPersistence {
@After
public void cleanupDir() throws IOException {
// Clean up SCM metadata
- LOG.info("Deletting {}", path);
+ log.info("Deletting {}", path);
FileUtils.deleteDirectory(new File(path));
// Clean up SCM datanode container metadata/data
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/ksm/TestKSMSQLCli.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/ksm/TestKSMSQLCli.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/ksm/TestKSMSQLCli.java
index 9fa7ec5..4ca981f 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/ksm/TestKSMSQLCli.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/ksm/TestKSMSQLCli.java
@@ -29,7 +29,6 @@ import org.apache.hadoop.ozone.web.handlers.VolumeArgs;
import org.apache.hadoop.ozone.web.interfaces.StorageHandler;
import org.apache.hadoop.ozone.web.utils.OzoneUtils;
import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/ksm/TestKeySpaceManager.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/ksm/TestKeySpaceManager.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/ksm/TestKeySpaceManager.java
index 6365400..00367dc 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/ksm/TestKeySpaceManager.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/ksm/TestKeySpaceManager.java
@@ -523,14 +523,14 @@ public class TestKeySpaceManager {
stream.write(dataString.getBytes());
}
- // We allow the key overwrite to be successful. Please note : Till HDFS-11922
- // is fixed this causes a data block leak on the data node side. That is
- // this overwrite only overwrites the keys on KSM. We need to garbage
- // collect those blocks from datanode.
+ // We allow the key overwrite to be successful. Please note : Till
+ // HDFS-11922 is fixed this causes a data block leak on the data node side.
+ // That is this overwrite only overwrites the keys on KSM. We need to
+ // garbage collect those blocks from datanode.
KeyArgs keyArgs2 = new KeyArgs(volumeName, bucketName, keyName, userArgs);
storageHandler.newKeyWriter(keyArgs2);
- Assert.assertEquals(numKeyAllocateFails,
- ksmMetrics.getNumKeyAllocateFails());
+ Assert
+ .assertEquals(numKeyAllocateFails, ksmMetrics.getNumKeyAllocateFails());
}
/**
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/TestSCMMXBean.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/TestSCMMXBean.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/TestSCMMXBean.java
index fadead1..b97e420 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/TestSCMMXBean.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/scm/TestSCMMXBean.java
@@ -44,6 +44,10 @@ import java.util.concurrent.TimeoutException;
import javax.management.openmbean.CompositeData;
import javax.management.openmbean.TabularData;
+/**
+ *
+ * This class is to test JMX management interface for scm information.
+ */
public class TestSCMMXBean {
public static final Log LOG = LogFactory.getLog(TestSCMMXBean.class);
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestBucketInfo.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestBucketInfo.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestBucketInfo.java
index c7b3b16..0678b63 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestBucketInfo.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestBucketInfo.java
@@ -31,7 +31,7 @@ import java.util.List;
public class TestBucketInfo {
@Test
- public void TestBucketInfoJson() throws IOException {
+ public void testBucketInfoJson() throws IOException {
BucketInfo bucketInfo = new BucketInfo("volumeName", "bucketName");
String bucketInfoString = bucketInfo.toJsonString();
BucketInfo newBucketInfo = BucketInfo.parse(bucketInfoString);
@@ -39,7 +39,7 @@ public class TestBucketInfo {
}
@Test
- public void TestBucketInfoDBString() throws IOException {
+ public void testBucketInfoDBString() throws IOException {
BucketInfo bucketInfo = new BucketInfo("volumeName", "bucketName");
String bucketInfoString = bucketInfo.toDBString();
BucketInfo newBucketInfo = BucketInfo.parse(bucketInfoString);
@@ -47,7 +47,7 @@ public class TestBucketInfo {
}
@Test
- public void TestBucketInfoAddAcls() throws IOException {
+ public void testBucketInfoAddAcls() throws IOException {
BucketInfo bucketInfo = new BucketInfo("volumeName", "bucketName");
String bucketInfoString = bucketInfo.toDBString();
BucketInfo newBucketInfo = BucketInfo.parse(bucketInfoString);
@@ -64,7 +64,7 @@ public class TestBucketInfo {
@Test
- public void TestBucketInfoVersionAndType() throws IOException {
+ public void testBucketInfoVersionAndType() throws IOException {
BucketInfo bucketInfo = new BucketInfo("volumeName", "bucketName");
bucketInfo.setVersioning(OzoneConsts.Versioning.ENABLED);
bucketInfo.setStorageType(StorageType.DISK);
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestErrorCode.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestErrorCode.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestErrorCode.java
index 6639e48..b707bc8 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestErrorCode.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestErrorCode.java
@@ -30,7 +30,7 @@ public class TestErrorCode {
* Test Error Generator functions.
*/
@Test
- public void TestErrorGen() {
+ public void testErrorGen() {
OzoneException e = ErrorTable
.newError(ErrorTable.ACCESS_DENIED, getRequestID(), "/test/path",
"localhost");
@@ -40,7 +40,7 @@ public class TestErrorCode {
}
@Test
- public void TestErrorGenWithException() {
+ public void testErrorGenWithException() {
OzoneException e =
new OzoneException(ErrorTable.ACCESS_DENIED.getHttpCode(),
"short message", new Exception("Hello"));
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestOzoneWebAccess.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestOzoneWebAccess.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestOzoneWebAccess.java
index 09dd797..dd38bd5 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestOzoneWebAccess.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestOzoneWebAccess.java
@@ -48,7 +48,7 @@ import static org.junit.Assert.assertEquals;
public class TestOzoneWebAccess {
/**
- * Set the timeout for every test
+ * Set the timeout for every test.
*/
@Rule
public Timeout testTimeout = new Timeout(300000);
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestQuota.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestQuota.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestQuota.java
index c846147..9b5a578 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestQuota.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestQuota.java
@@ -32,7 +32,7 @@ import static org.junit.Assert.fail;
public class TestQuota {
@Test
- public void TestParseQuota() {
+ public void testParseQuota() {
HashMap<String, Boolean> testMatrix;
testMatrix = new HashMap<String, Boolean>();
@@ -56,11 +56,10 @@ public class TestQuota {
testMatrix.put("1024 bytes", Boolean.TRUE);
testMatrix.put("1bytes", Boolean.TRUE);
testMatrix.put("0bytes", Boolean.TRUE);
- testMatrix.put("10000 BYTES",Boolean.TRUE );
+ testMatrix.put("10000 BYTES", Boolean.TRUE);
testMatrix.put("BYTESbytes", Boolean.FALSE);
testMatrix.put("bytes", Boolean.FALSE);
-
Set<String> keys = testMatrix.keySet();
for (String key : keys) {
if (testMatrix.get(key)) {
@@ -79,7 +78,7 @@ public class TestQuota {
}
@Test
- public void TestVerifyQuota() {
+ public void testVerifyQuota() {
OzoneQuota qt = OzoneQuota.parseQuota("10TB");
assertEquals(qt.getSize(), 10);
assertEquals(qt.getUnit(), OzoneQuota.Units.TB);
@@ -107,7 +106,7 @@ public class TestQuota {
}
@Test
- public void TestVerifyRemove() {
+ public void testVerifyRemove() {
assertTrue(OzoneQuota.isRemove("remove"));
assertFalse(OzoneQuota.isRemove("not remove"));
assertFalse(OzoneQuota.isRemove(null));
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestUtils.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestUtils.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestUtils.java
index 3917016..4891e4c 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestUtils.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestUtils.java
@@ -35,7 +35,7 @@ public class TestUtils {
* Tests if the bucket name handling is correct.
*/
@Test
- public void TestValidBucketNames() {
+ public void testValidBucketNames() {
HashMap<String, Boolean> testMatrix;
// Init the Table with Strings and Expected Return values
testMatrix = new HashMap<String, Boolean>();
@@ -47,9 +47,8 @@ public class TestUtils {
testMatrix.put("bucket..ozone.self", Boolean.FALSE);
testMatrix.put("192.1.1.1", Boolean.FALSE);
testMatrix.put("ab", Boolean.FALSE);
- testMatrix.put("bucket.ozone.self.this.is.a.really.long.name.that." +
- "is.more.than.sixty.three.characters.long.for.sure",
- Boolean.FALSE);
+ testMatrix.put("bucket.ozone.self.this.is.a.really.long.name.that."
+ + "is.more.than.sixty.three.characters.long.for.sure", Boolean.FALSE);
testMatrix.put(null, Boolean.FALSE);
testMatrix.put("bucket@$", Boolean.FALSE);
testMatrix.put("BUCKET", Boolean.FALSE);
@@ -66,7 +65,7 @@ public class TestUtils {
Set<String> keys = testMatrix.keySet();
for (String key : keys) {
- if(testMatrix.get(key)) {
+ if (testMatrix.get(key)) {
// For valid names there should be no exceptions at all
verifyResourceName(key);
@@ -74,8 +73,8 @@ public class TestUtils {
try {
verifyResourceName(key);
// should never get here since the isValid call will throw
- fail("An exception was expected but did not happen.");
- } catch(IllegalArgumentException e){
+ fail("An exception was expected but did not happen.");
+ } catch (IllegalArgumentException e) {
}
}
@@ -90,11 +89,10 @@ public class TestUtils {
* that this test is good enough.
*/
@Test
- public void TestRequestIDisRandom(){
+ public void testRequestIDisRandom() {
HashSet<String> set = new HashSet<>();
- for (int i = 0; i < 1000; i ++){
+ for (int i = 0; i < 1000; i++) {
assertTrue(set.add(getRequestID()));
}
}
-
}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestVolumeStructs.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestVolumeStructs.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestVolumeStructs.java
index 551e7d4..ef5a346 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestVolumeStructs.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/TestVolumeStructs.java
@@ -32,8 +32,8 @@ public class TestVolumeStructs {
@Test
public void testVolumeInfoParse() throws IOException {
- VolumeInfo volInfo = new VolumeInfo("testvol",
- "Thu, Apr 9, 2015 10:23:45 GMT", "gandalf");
+ VolumeInfo volInfo =
+ new VolumeInfo("testvol", "Thu, Apr 9, 2015 10:23:45 GMT", "gandalf");
VolumeOwner owner = new VolumeOwner("bilbo");
volInfo.setOwner(owner);
String jString = volInfo.toJsonString();
@@ -48,8 +48,7 @@ public class TestVolumeStructs {
public void testVolumeInfoValue() throws IOException {
String createdOn = "Thu, Apr 9, 2015 10:23:45 GMT";
String createdBy = "gandalf";
- VolumeInfo volInfo = new VolumeInfo("testvol",
- createdOn, createdBy);
+ VolumeInfo volInfo = new VolumeInfo("testvol", createdOn, createdBy);
assertEquals(volInfo.getCreatedBy(), createdBy);
assertEquals(volInfo.getCreatedOn(), createdOn);
}
@@ -57,11 +56,10 @@ public class TestVolumeStructs {
@Test
public void testVolumeListParse() throws IOException {
-
ListVolumes list = new ListVolumes();
for (int x = 0; x < 100; x++) {
VolumeInfo volInfo = new VolumeInfo("testvol" + Integer.toString(x),
- "Thu, Apr 9, 2015 10:23:45 GMT", "gandalf");
+ "Thu, Apr 9, 2015 10:23:45 GMT", "gandalf");
list.addVolume(volInfo);
}
list.sort();
@@ -69,5 +67,4 @@ public class TestVolumeStructs {
ListVolumes newList = ListVolumes.parse(listString);
assertEquals(list.toJsonString(), newList.toJsonString());
}
-
}
http://git-wip-us.apache.org/repos/asf/hadoop/blob/8dbd0354/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/client/TestBuckets.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/client/TestBuckets.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/client/TestBuckets.java
index a288bda..eb53162 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/client/TestBuckets.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/ozone/web/client/TestBuckets.java
@@ -44,6 +44,7 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+
public class TestBuckets {
/**
* Set the timeout for every test.
@@ -83,7 +84,7 @@ public class TestBuckets {
}
/**
- * shutdown MiniDFSCluster
+ * shutdown MiniDFSCluster.
*/
@AfterClass
public static void shutdown() {
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org