HDFS-12719. Ozone: Fix checkstyle, javac, whitespace issues in HDFS-7240 branch. Contributed by Mukul Kumar Singh.

This commit is contained in:
Anu Engineer 2017-11-09 10:08:58 -08:00 committed by Owen O'Malley
parent 761926db2c
commit 740a06cdd7
30 changed files with 136 additions and 97 deletions

View File

@ -148,8 +148,8 @@ public int hashCode(){
@Override
public boolean equals(Object obj) {
return (obj instanceof Property) && (((Property) obj).getName()).equals
(this.getName());
return (obj instanceof Property) && (((Property) obj).getName())
.equals(this.getName());
}
}
}

View File

@ -41,14 +41,14 @@ public interface ServiceRuntimeInfo {
String getVersion();
/**
* Get the version of software running on the Namenode
* Get the version of software running on the Namenode.
*
* @return a string representing the version
*/
String getSoftwareVersion();
/**
* Get the compilation information which contains date, user and branch
* Get the compilation information which contains date, user and branch.
*
* @return the compilation information, as a JSON string.
*/

View File

@ -332,8 +332,8 @@ public Builder setRequestID(String id) {
return this;
}
public Builder setType(ReplicationType type) {
this.type = type;
public Builder setType(ReplicationType replicationType) {
this.type = replicationType;
return this;
}

View File

@ -249,8 +249,8 @@ public Builder setState(OzoneProtos.LifeCycleState lifeCycleState) {
return this;
}
public Builder setPipeline(Pipeline pipeline) {
this.pipeline = pipeline;
public Builder setPipeline(Pipeline containerPipeline) {
this.pipeline = containerPipeline;
return this;
}
@ -269,18 +269,18 @@ public Builder setNumberOfKeys(long keyCount) {
return this;
}
public Builder setStateEnterTime(long stateEnterTime) {
this.stateEnterTime = stateEnterTime;
public Builder setStateEnterTime(long time) {
this.stateEnterTime = time;
return this;
}
public Builder setOwner(OzoneProtos.Owner owner) {
this.owner = owner;
public Builder setOwner(OzoneProtos.Owner containerOwner) {
this.owner = containerOwner;
return this;
}
public Builder setContainerName(String containerName) {
this.containerName = containerName;
public Builder setContainerName(String container) {
this.containerName = container;
return this;
}

View File

@ -17,6 +17,10 @@
MYNAME="${BASH_SOURCE-$0}"
## @description usage info
## @audience private
## @stability evolving
## @replaceable no
function hadoop_usage
{
hadoop_add_option "--buildpaths" "attempt to add class files from build tree"

View File

@ -17,7 +17,10 @@
# Start hadoop hdfs and ozone daemons.
# Run this on master node.
## @description usage info
## @audience private
## @stability evolving
## @replaceable no
function hadoop_usage
{
echo "Usage: start-ozone.sh"

View File

@ -17,6 +17,10 @@
MYNAME="${BASH_SOURCE-$0}"
## @description usage info
## @audience private
## @stability evolving
## @replaceable no
function hadoop_usage
{
hadoop_add_option "--buildpaths" "attempt to add class files from build tree"

View File

@ -17,7 +17,10 @@
# Stop hdfs and ozone daemons.
# Run this on master node.
## @description usage info
## @audience private
## @stability evolving
## @replaceable no
function hadoop_usage
{
echo "Usage: stop-ozone.sh"

View File

@ -434,88 +434,88 @@ private static long computeCacheSize(Configuration configuration,
/**
* Sets the Config to be used by this cache.
*
* @param configuration - Config
* @param conf - Config
* @return Builder
*/
public Builder setConfiguration(Configuration configuration) {
this.configuration = configuration;
public Builder setConfiguration(Configuration conf) {
this.configuration = conf;
return this;
}
/**
* Sets the user name who is the owner of this volume.
*
* @param userName - name of the owner, please note this is not the current
* @param user - name of the owner, please note this is not the current
* user name.
* @return - Builder
*/
public Builder setUserName(String userName) {
this.userName = userName;
public Builder setUserName(String user) {
this.userName = user;
return this;
}
/**
* Sets the VolumeName.
*
* @param volumeName - Name of the volume
* @param volume - Name of the volume
* @return Builder
*/
public Builder setVolumeName(String volumeName) {
this.volumeName = volumeName;
public Builder setVolumeName(String volume) {
this.volumeName = volume;
return this;
}
/**
* Sets the Pipelines that form this volume.
*
* @param pipelines - list of pipelines
* @param pipelineList - list of pipelines
* @return Builder
*/
public Builder setPipelines(List<Pipeline> pipelines) {
this.pipelines = pipelines;
public Builder setPipelines(List<Pipeline> pipelineList) {
this.pipelines = pipelineList;
return this;
}
/**
* Sets the Client Manager that manages the communication with containers.
*
* @param clientManager - clientManager.
* @param xceiverClientManager - clientManager.
* @return - Builder
*/
public Builder setClientManager(XceiverClientManager clientManager) {
this.clientManager = clientManager;
public Builder setClientManager(XceiverClientManager xceiverClientManager) {
this.clientManager = xceiverClientManager;
return this;
}
/**
* Sets the block size -- Typical sizes are 4KB, 8KB etc.
*
* @param blockSize - BlockSize.
* @param size - BlockSize.
* @return - Builder
*/
public Builder setBlockSize(int blockSize) {
this.blockSize = blockSize;
public Builder setBlockSize(int size) {
this.blockSize = size;
return this;
}
/**
* Sets the volumeSize.
*
* @param volumeSize - VolumeSize
* @param size - VolumeSize
* @return - Builder
*/
public Builder setVolumeSize(long volumeSize) {
this.volumeSize = volumeSize;
public Builder setVolumeSize(long size) {
this.volumeSize = size;
return this;
}
/**
* Set flusher.
* @param flusher - cache Flusher
* @param containerCacheFlusher - cache Flusher
* @return Builder.
*/
public Builder setFlusher(ContainerCacheFlusher flusher) {
this.flusher = flusher;
public Builder setFlusher(ContainerCacheFlusher containerCacheFlusher) {
this.flusher = containerCacheFlusher;
return this;
}

View File

@ -321,9 +321,9 @@ public boolean isDaemonStopped() {
/**
* Create a command handler thread.
*
* @param conf
* @param config
*/
private void initCommandHandlerThread(Configuration conf) {
private void initCommandHandlerThread(Configuration config) {
/**
* Task that periodically checks if we have any outstanding commands.

View File

@ -125,37 +125,37 @@ public Builder addHandler(CommandHandler handler) {
/**
* Add the OzoneContainer.
*
* @param container - ozone container.
* @param ozoneContainer - ozone container.
* @return Builder
*/
public Builder setContainer(OzoneContainer container) {
Preconditions.checkNotNull(container);
this.container = container;
public Builder setContainer(OzoneContainer ozoneContainer) {
Preconditions.checkNotNull(ozoneContainer);
this.container = ozoneContainer;
return this;
}
/**
* Set the Connection Manager.
*
* @param connectionManager
* @param scmConnectionManager
* @return this
*/
public Builder setConnectionManager(SCMConnectionManager
connectionManager) {
Preconditions.checkNotNull(connectionManager);
this.connectionManager = connectionManager;
scmConnectionManager) {
Preconditions.checkNotNull(scmConnectionManager);
this.connectionManager = scmConnectionManager;
return this;
}
/**
* Sets the Context.
*
* @param context - StateContext
* @param stateContext - StateContext
* @return this
*/
public Builder setContext(StateContext context) {
Preconditions.checkNotNull(context);
this.context = context;
public Builder setContext(StateContext stateContext) {
Preconditions.checkNotNull(stateContext);
this.context = stateContext;
return this;
}

View File

@ -92,32 +92,32 @@ public Long get() {
/**
* Sets the value of this metric.
*
* @param value - value of the metric.
* @param setValue - value of the metric.
*/
@Override
public void set(Long value) {
this.value = value;
public void set(Long setValue) {
this.value = setValue;
}
/**
* Adds a value of to the base.
*
* @param value - value
* @param addValue - value
*/
@Override
public void add(Long value) {
this.value += value;
public void add(Long addValue) {
this.value += addValue;
}
/**
* subtract a value.
*
* @param value value
* @param subValue value
*/
@Override
public void subtract(Long value) {
this.value -= value;
public void subtract(Long subValue) {
this.value -= subValue;
}
/**

View File

@ -73,26 +73,26 @@ public LongMetric getRemaining() {
/**
* Set the capacity, used and remaining space on a datanode.
*
* @param capacity in bytes
* @param used in bytes
* @param remaining in bytes
* @param newCapacity in bytes
* @param newUsed in bytes
* @param newRemaining in bytes
*/
@VisibleForTesting
public void set(long capacity, long used, long remaining) {
Preconditions.checkNotNull(capacity, "Capacity cannot be null");
Preconditions.checkNotNull(used, "used cannot be null");
Preconditions.checkNotNull(remaining, "remaining cannot be null");
public void set(long newCapacity, long newUsed, long newRemaining) {
Preconditions.checkNotNull(newCapacity, "Capacity cannot be null");
Preconditions.checkNotNull(newUsed, "used cannot be null");
Preconditions.checkNotNull(newRemaining, "remaining cannot be null");
Preconditions.checkArgument(capacity >= 0, "Capacity cannot be " +
Preconditions.checkArgument(newCapacity >= 0, "Capacity cannot be " +
"negative.");
Preconditions.checkArgument(used >= 0, "used space cannot be " +
Preconditions.checkArgument(newUsed >= 0, "used space cannot be " +
"negative.");
Preconditions.checkArgument(remaining >= 0, "remaining cannot be " +
Preconditions.checkArgument(newRemaining >= 0, "remaining cannot be " +
"negative");
this.capacity = new LongMetric(capacity);
this.scmUsed = new LongMetric(used);
this.remaining = new LongMetric(remaining);
this.capacity = new LongMetric(newCapacity);
this.scmUsed = new LongMetric(newUsed);
this.remaining = new LongMetric(newRemaining);
}
/**

View File

@ -65,9 +65,9 @@ public interface Keys {
*/
@PUT
@Consumes(MediaType.WILDCARD)
@ApiOperation(value = "Adds a key to an existing bucket.",notes = "If the "
+ "object already exists this call will overwrite or add with new version "
+ "number if the bucket versioning is turned on.")
@ApiOperation(value = "Adds a key to an existing bucket.", notes = "If the "
+ "object already exists this call will overwrite or add with new version"
+ " number if the bucket versioning is turned on.")
@ApiImplicitParams({
@ApiImplicitParam(name = "x-ozone-version", example = "v1", required =
true, paramType = "header"),

View File

@ -83,7 +83,7 @@ public static void shutdown() throws InterruptedException {
if (cluster != null) {
cluster.shutdown();
}
IOUtils.cleanup(null, storageContainerLocationClient, cluster);
IOUtils.cleanupWithLogger(null, storageContainerLocationClient, cluster);
}
/**

View File

@ -90,7 +90,7 @@ public static void shutdown() throws InterruptedException {
if (cluster != null) {
cluster.shutdown();
}
IOUtils.cleanup(null, storageContainerLocationClient, cluster);
IOUtils.cleanupWithLogger(null, storageContainerLocationClient, cluster);
}
/**

View File

@ -96,7 +96,7 @@ public static void shutdown() throws InterruptedException {
if (cluster != null) {
cluster.shutdown();
}
IOUtils.cleanup(null, storageContainerLocationClient, cluster);
IOUtils.cleanupWithLogger(null, storageContainerLocationClient, cluster);
}
/**

View File

@ -169,10 +169,10 @@ private void sleepIfNeeded() {
@Override
public StorageContainerDatanodeProtocolProtos.SCMHeartbeatResponseProto
sendHeartbeat(DatanodeID datanodeID, SCMNodeReport nodeReport,
ReportState reportState) throws IOException {
ReportState scmReportState) throws IOException {
rpcCount.incrementAndGet();
heartbeatCount.incrementAndGet();
this.reportState = reportState;
this.reportState = scmReportState;
sleepIfNeeded();
List<SCMCommandResponseProto>
cmdResponses = new LinkedList<>();

View File

@ -29,6 +29,9 @@
import java.util.LinkedList;
import java.util.List;
/**
* Test Ozone Bucket Info operation.
*/
public class TestBucketInfo {
@Test
public void testBucketInfoJson() throws IOException {

View File

@ -25,6 +25,9 @@
import static junit.framework.TestCase.assertEquals;
import static org.apache.hadoop.ozone.web.utils.OzoneUtils.getRequestID;
/**
* Test Ozone Error Codes.
*/
public class TestErrorCode {
/**
* Test Error Generator functions.

View File

@ -46,6 +46,9 @@
import static org.apache.hadoop.ozone.web.utils.OzoneUtils.getRequestID;
import static org.junit.Assert.assertEquals;
/**
* Test Ozone Access through REST protocol.
*/
public class TestOzoneWebAccess {
/**
* Set the timeout for every test.

View File

@ -29,7 +29,9 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
/**
* Test Ozone Volume Quota.
*/
public class TestQuota {
@Test
public void testParseQuota() {

View File

@ -29,6 +29,9 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
/**
* Test Ozone Utility operations like verifying resource name.
*/
public class TestUtils {
/**

View File

@ -28,6 +28,9 @@
import static org.junit.Assert.assertEquals;
/**
* Test Ozone Volume info structure.
*/
public class TestVolumeStructs {
@Test

View File

@ -44,7 +44,9 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
/**
* Test Ozone Bucket Lifecycle.
*/
public class TestBuckets {
/**
* Set the timeout for every test.

View File

@ -74,6 +74,9 @@
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
/**
* Test Ozone Key Lifecycle.
*/
public class TestKeys {
/**
* Set the timeout for every test.

View File

@ -58,6 +58,9 @@
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
/**
* Test Ozone Volumes Lifecycle.
*/
public class TestVolume {
private static MiniOzoneCluster cluster = null;
private static OzoneRestClient ozoneRestClient = null;

View File

@ -21,7 +21,7 @@
/**
* Constants for Ozone FileSystem implementation.
*/
public class Constants {
public final class Constants {
public static final String OZONE_URI_SCHEME = "o3";

View File

@ -48,7 +48,7 @@ class OzoneContract extends AbstractFSContract {
private static StorageHandler storageHandler;
private static final String CONTRACT_XML = "contract/ozone.xml";
public OzoneContract(Configuration conf) {
OzoneContract(Configuration conf) {
super(conf);
//insert the base features
addConfResource(CONTRACT_XML);