Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public void connect(String encodedToken) throws Exception {

private synchronized void connectToDatanode(DatanodeDetails dn)
throws IOException {
if (isConnected(dn)){
if (isConnected(dn)) {
return;
}
// read port from the data node, on failure use default configured
Expand Down Expand Up @@ -269,10 +269,10 @@ public ContainerCommandResponseProto sendCommand(
Thread.currentThread().interrupt();
}
}
try{
try {
for (Map.Entry<DatanodeDetails,
CompletableFuture<ContainerCommandResponseProto> >
entry : futureHashMap.entrySet()){
entry : futureHashMap.entrySet()) {
responseProtoHashMap.put(entry.getKey(), entry.getValue().get());
}
} catch (InterruptedException e) {
Expand Down Expand Up @@ -538,7 +538,7 @@ public void onCompleted() {
}

private synchronized void checkOpen(DatanodeDetails dn)
throws IOException{
throws IOException {
if (closed) {
throw new IOException("This channel is not connected.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ public static void verifyKeyName(String keyName) {
if (keyName == null) {
throw new IllegalArgumentException("Key name is null");
}
if(!OzoneConsts.KEYNAME_ILLEGAL_CHARACTER_CHECK_REGEX
.matcher(keyName).matches()){
if (!OzoneConsts.KEYNAME_ILLEGAL_CHARACTER_CHECK_REGEX
.matcher(keyName).matches()) {
throw new IllegalArgumentException("Invalid key name: " + keyName);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public synchronized void initialize() throws IOException {
// retry according to retry policy.
chunks = getChunkInfos();
break;
} catch(SCMSecurityException ex) {
} catch (SCMSecurityException ex) {
throw ex;
} catch (StorageContainerException ex) {
refreshPipeline(ex);
Expand Down Expand Up @@ -340,9 +340,9 @@ synchronized int readWithStrategy(ByteReaderStrategy strategy) throws
} else {
throw e;
}
} catch(SCMSecurityException ex) {
} catch (SCMSecurityException ex) {
throw ex;
} catch(IOException ex) {
} catch (IOException ex) {
// We got a IOException which might be due
// to DN down or connectivity issue.
if (shouldRetryRead(ex)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ private void handleInterruptedException(Exception ex,
boolean processExecutionException)
throws IOException {
LOG.error("Command execution was interrupted.");
if(processExecutionException) {
if (processExecutionException) {
handleExecutionException(ex);
} else {
throw new IOException(EXCEPTION_MSG + ex.toString(), ex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public BufferPool(int bufferSize, int capacity) {
}

public BufferPool(int bufferSize, int capacity,
Function<ByteBuffer, ByteString> byteStringConversion){
Function<ByteBuffer, ByteString> byteStringConversion) {
this.capacity = capacity;
this.bufferSize = bufferSize;
bufferList = new ArrayList<>(capacity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void releaseBuffersOnException() {

@Override
XceiverClientReply sendWatchForCommit(boolean bufferFull) throws IOException {
return bufferFull? commitWatcher.watchOnFirstIndex()
return bufferFull ? commitWatcher.watchOnFirstIndex()
: commitWatcher.watchOnLastIndex();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public final class HddsConfigKeys {
*/
public static final String HDDS_X509_MAX_DURATION = "hdds.x509.max.duration";
// Limit Certificate duration to a max value of 5 years.
public static final String HDDS_X509_MAX_DURATION_DEFAULT= "P1865D";
public static final String HDDS_X509_MAX_DURATION_DEFAULT = "P1865D";
public static final String HDDS_X509_SIGNATURE_ALGO =
"hdds.x509.signature.algorithm";
public static final String HDDS_X509_SIGNATURE_ALGO_DEFAULT = "SHA256withRSA";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ public static long getShutDownTimeOut(ConfigurationSource conf) {
* Utility method to round up bytes into the nearest MB.
*/
public static int roundupMb(long bytes) {
return (int)Math.ceil((double) bytes/(double) ONE_MB);
return (int)Math.ceil((double) bytes / (double) ONE_MB);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,6 @@ public static String createStartupShutdownMessage(VersionInfo versionInfo,

public static String appendIfNotPresent(String str, char c) {
Preconditions.checkNotNull(str, "Input string is null");
return str.isEmpty() || str.charAt(str.length() - 1) != c ? str + c: str;
return str.isEmpty() || str.charAt(str.length() - 1) != c ? str + c : str;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public final class InterfaceAudience {
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
public @interface Public {};
public @interface Public { };

/**
* Intended only for the project(s) specified in the annotation.
Expand All @@ -67,7 +67,7 @@ public final class InterfaceAudience {
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
public @interface Private {};
public @interface Private { };

private InterfaceAudience() {} // Audience can't exist on its own
private InterfaceAudience() { } // Audience can't exist on its own
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public final class OzoneQuota {
public static final String OZONE_QUOTA_TB = "TB";

/** Quota Units.*/
public enum Units {B, KB, MB, GB, TB}
public enum Units { B, KB, MB, GB, TB }

// Quota to decide how many buckets can be created.
private long quotaInNamespace;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ public class QuotaList {
private ArrayList<OzoneQuota.Units> unitQuota;
private ArrayList<Long> sizeQuota;

public QuotaList(){
public QuotaList() {
ozoneQuota = new ArrayList<String>();
unitQuota = new ArrayList<OzoneQuota.Units>();
sizeQuota = new ArrayList<Long>();
}

public void addQuotaList(String oQuota, OzoneQuota.Units uQuota, Long sQuota){
public void addQuotaList(
String oQuota, OzoneQuota.Units uQuota, Long sQuota) {
ozoneQuota.add(oQuota);
unitQuota.add(uQuota);
sizeQuota.add(sQuota);
Expand All @@ -52,15 +53,15 @@ public ArrayList<OzoneQuota.Units> getUnitQuotaArray() {
return this.unitQuota;
}

public OzoneQuota.Units getUnits(String oQuota){
public OzoneQuota.Units getUnits(String oQuota) {
return unitQuota.get(ozoneQuota.indexOf(oQuota));
}

public Long getQuotaSize(OzoneQuota.Units uQuota){
public Long getQuotaSize(OzoneQuota.Units uQuota) {
return sizeQuota.get(unitQuota.indexOf(uQuota));
}

public OzoneQuota.Units getQuotaUnit(Long sQuota){
public OzoneQuota.Units getQuotaUnit(Long sQuota) {
return unitQuota.get(sizeQuota.indexOf(sQuota));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public enum ReplicationFactor {
* @return ReplicationFactor
*/
public static ReplicationFactor valueOf(int value) {
if(value == 1) {
if (value == 1) {
return ONE;
}
if (value == 3) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public Map<String, String> getPropsWithPrefix(String confPrefix) {
return configMap;
}

private static void addDeprecatedKeys(){
private static void addDeprecatedKeys() {
Configuration.addDeprecations(new DeprecationDelta[]{
new DeprecationDelta("ozone.datanode.pipeline.limit",
ScmConfigKeys.OZONE_DATANODE_PIPELINE_LIMIT),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private void loadInitialValue() {

private void refresh() {
//only one `refresh` can be running at a certain moment
if(isRefreshRunning.compareAndSet(false, true)) {
if (isRefreshRunning.compareAndSet(false, true)) {
try {
cachedValue.set(source.getUsedSpace());
} catch (RuntimeException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ public Builder setSetupTime(long time) {
*
* @return DatanodeDetails.Builder
*/
public Builder setPersistedOpState(HddsProtos.NodeOperationalState state){
public Builder setPersistedOpState(HddsProtos.NodeOperationalState state) {
this.persistedOpState = state;
return this;
}
Expand All @@ -726,7 +726,7 @@ public Builder setPersistedOpState(HddsProtos.NodeOperationalState state){
*
* @return DatanodeDetails.Builder
*/
public Builder setPersistedOpStateExpiry(long expiry){
public Builder setPersistedOpStateExpiry(long expiry) {
this.persistedOpStateExpiryEpochSec = expiry;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private static RaftGroup emptyRaftGroup() {
}

private static RaftGroup newRaftGroup(Collection<RaftPeer> peers) {
return peers.isEmpty()? emptyRaftGroup()
return peers.isEmpty() ? emptyRaftGroup()
: RaftGroup.valueOf(DUMMY_GROUP_ID, peers);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class ReconConfig {
type = ConfigType.STRING,
defaultValue = "",
tags = { ConfigTag.SECURITY, ConfigTag.RECON, ConfigTag.OZONE },
description = "The keytab file used by Recon daemon to login as "+
description = "The keytab file used by Recon daemon to login as " +
"its service principal."
)
private String keytab;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* Ozone configuration.
*/
public final class ByteStringConversion {
private ByteStringConversion(){} // no instantiation.
private ByteStringConversion() { } // no instantiation.

/**
* Creates the conversion function to be used to convert ByteBuffers to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class ScmConfig {
type = ConfigType.STRING,
defaultValue = "",
tags = { ConfigTag.SECURITY, ConfigTag.OZONE },
description = "The keytab file used by SCM daemon to login as "+
description = "The keytab file used by SCM daemon to login as " +
"its service principal."
)
private String keytab;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ public final class ScmConfigKeys {

public static final String OZONE_SCM_HA_RAFT_LOG_PURGE_GAP =
"ozone.scm.ha.ratis.log.purge.gap";
public static final int OZONE_SCM_HA_RAFT_LOG_PURGE_GAP_DEFAULT =1000000;
public static final int OZONE_SCM_HA_RAFT_LOG_PURGE_GAP_DEFAULT = 1000000;

public static final String OZONE_SCM_HA_RATIS_SNAPSHOT_THRESHOLD =
"ozone.scm.ha.ratis.snapshot.threshold";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private void incrementAndSample(String stat, ContainerID container) {
increment(stat);
List<ContainerID> list = containerSample
.computeIfAbsent(stat, k -> new ArrayList<>());
synchronized(list) {
synchronized (list) {
if (list.size() < SAMPLE_LIMIT) {
list.add(container);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
*/
public class InnerNodeImpl extends NodeImpl implements InnerNode {
protected static class Factory implements InnerNode.Factory<InnerNodeImpl> {
protected Factory() {}
protected Factory() { }

@Override
public InnerNodeImpl newInnerNode(String name, String location,
Expand Down Expand Up @@ -93,7 +93,7 @@ public int getNumOfNodes(int level) {
} else {
for (Node node: childrenMap.values()) {
if (node instanceof InnerNode) {
count += ((InnerNode)node).getNumOfNodes(level -1);
count += ((InnerNode)node).getNumOfNodes(level - 1);
} else {
throw new RuntimeException("Cannot support Level:" + level +
" on this node " + this.toString());
Expand All @@ -119,7 +119,7 @@ public List<Node> getNodes(int level) {
} else {
for (Node node: childrenMap.values()) {
if (node instanceof InnerNode) {
result.addAll(((InnerNode)node).getNodes(level -1));
result.addAll(((InnerNode)node).getNodes(level - 1));
} else {
throw new RuntimeException("Cannot support Level:" + level +
" on this node " + this.toString());
Expand Down Expand Up @@ -265,7 +265,7 @@ public Node getNode(String loc) {
if (child == null) {
return null;
}
if (path.length == 1){
if (path.length == 1) {
return child;
}
if (child instanceof InnerNode) {
Expand All @@ -292,7 +292,7 @@ public Node getLeaf(int leafIndex) {
}
return getChildNode(leafIndex);
} else {
for(Node node : childrenMap.values()) {
for (Node node : childrenMap.values()) {
InnerNodeImpl child = (InnerNodeImpl)node;
int leafCount = child.getNumOfLeaves();
if (leafIndex < leafCount) {
Expand Down Expand Up @@ -468,7 +468,7 @@ private Node getLeafOnLeafParent(int leafIndex, List<String> excludedScopes,
if (leafIndex >= getNumOfChildren()) {
return null;
}
for(Node node : childrenMap.values()) {
for (Node node : childrenMap.values()) {
if (excludedNodes != null && excludedNodes.contains(node)) {
continue;
}
Expand Down Expand Up @@ -519,7 +519,7 @@ private InnerNodeImpl createChildNode(String name) {
private Node getChildNode(int index) {
Iterator iterator = childrenMap.values().iterator();
Node node = null;
while(index >= 0 && iterator.hasNext()) {
while (index >= 0 && iterator.hasNext()) {
node = (Node)iterator.next();
index--;
}
Expand Down
Loading