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 @@ -66,7 +66,6 @@ public final class ContainerClientMetrics {
@Metric
private MutableCounterLong flushesDuringWrite;


private MutableQuantiles[] listBlockLatency;
private MutableQuantiles[] getBlockLatency;
private MutableQuantiles[] getCommittedBlockLengthLatency;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ public long getStaleThreshold(TimeUnit unit) {
return unit.convert(staleThreshold, MILLISECONDS);
}


public int getMaxSize() {
return maxSize;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ private RaftClient getClient() {
return Objects.requireNonNull(client.get(), "client is null");
}


@VisibleForTesting
public ConcurrentMap<UUID, Long> getCommitInfoMap() {
return commitInfoMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ public static int getMaxOutstandingRequests(ConfigurationSource config) {
.getMaxOutstandingRequests();
}


// This will return the underlying exception after unwrapping
// the exception to see if it matches with expected exception
// list otherwise will return the exception back.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public class BlockDataStreamOutput implements ByteBufferStreamOutput {
// buffers for which putBlock is yet to be executed
private List<StreamBuffer> buffersForPutBlock;
private boolean isDatastreamPipelineMode;

/**
* Creates a new BlockDataStreamOutput.
*
Expand Down Expand Up @@ -604,7 +605,6 @@ private void validateResponse(
}
}


private void setIoException(Throwable e) {
IOException ioe = getIoException();
if (ioe == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,6 @@ void validateResponse(
}
}


public IOException setIoException(Throwable e) {
IOException ioe = getIoException();
if (ioe == null) {
Expand Down Expand Up @@ -1245,6 +1244,7 @@ ContainerCommandResponseProto getResponse() {
*/
private static class FlushRuntimeException extends RuntimeException {
private final IOException cause;

FlushRuntimeException(IOException cause) {
this.cause = cause;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public class BufferPool {
private final Lock lock = new ReentrantLock();
private final Condition notFull = lock.newCondition();


public static BufferPool empty() {
return EMPTY;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,6 @@ private boolean chunkStreamEOF() {
}
}


/**
* Release the buffers upto the given index.
* @param releaseUptoBufferIndex bufferIndex (inclusive) upto which the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public class ECBlockOutputStream extends BlockOutputStream {

private CompletableFuture<ContainerProtos.ContainerCommandResponseProto>
putBlkRspFuture = null;

/**
* Creates a new ECBlockOutputStream.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public int position() {
return buffer.position();
}


public void put(StreamBuffer sb) {
buffer.put(sb.buffer);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public class ECBlockInputStream extends BlockExtendedInputStream {
private boolean closed = false;
private boolean seeked = false;
private OzoneClientConfig config;

protected ECReplicationConfig getRepConfig() {
return repConfig;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ public static Map<DatanodeDetails, Integer> createIndexMap(int... idxs) {
return map;
}


/**
* A stream factory which can be used in tests to provide TestBlockStream
* instances.
Expand Down Expand Up @@ -357,7 +356,7 @@ public int read(ByteBuffer buf) throws IOException {
buf.put(data.get());
}
return toRead;
};
}

private void throwError() throws IOException {
if (errorToThrow != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ public int read(ByteBuffer buf) throws IOException {
}
position += toRead;
return toRead;
};
}

@Override
protected int readWithStrategy(ByteReaderStrategy strategy) throws
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ public void testReadDataByteBufferMultipleStripes() throws IOException {
}
}


@Test
public void testReadDataWithUnbuffer() throws IOException {
// Read buffer is 16kb + 5 bytes so it does not align with stripes exactly
Expand Down Expand Up @@ -349,8 +348,6 @@ private void resetAndAdvanceDataGenerator(long position) {
}
}



/**
* Return a list of num ByteBuffers of the given size.
* @param num Number of buffers to create
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
@InterfaceStability.Stable
public final class HddsUtils {


private static final Logger LOG = LoggerFactory.getLogger(HddsUtils.class);

public static final ByteString REDACTED =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public static boolean isJavaVersionAtMost(int version) {
return JAVA_SPEC_VER <= version;
}


/**
* Private constructor.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
@InterfaceStability.Stable
public final class DecommissionUtils {


private static final Logger LOG = LoggerFactory.getLogger(DecommissionUtils.class);

private DecommissionUtils() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,6 @@ public Port getStandalonePort() {
return getPort(Name.STANDALONE);
}


/**
* Starts building a new DatanodeDetails from the protobuf input.
*
Expand Down Expand Up @@ -679,7 +678,6 @@ public boolean equals(Object obj) {
id.equals(((DatanodeDetails) obj).id);
}


/**
* Checks hostname, ipAddress and port of the 2 nodes are the same.
* @param datanodeDetails dnDetails object to compare with.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,6 @@ public static void createRaftServerProperties(ConfigurationSource ozoneConf,
});
}


private static Map<String, String> getDatanodeRatisPrefixProps(
ConfigurationSource configuration) {
return configuration.getPropsMatchPrefixAndTrimPrefix(
Expand Down Expand Up @@ -531,7 +530,6 @@ static RaftPeer newRaftPeer(RaftPeer peer, RaftPeerId target) {
return RaftPeer.newBuilder(peer).setPriority(priority).build();
}


/**
* Use raft client to send admin request, transfer the leadership.
* 1. Set priority and send setConfiguration request
Expand Down Expand Up @@ -647,7 +645,6 @@ public static int calculateAttempts(Duration pollInterval, Duration maxDuration)
return (int) (max / interval);
}


public static void setFirstElectionTimeoutDuration(
ConfigurationSource conf, RaftProperties properties, String configKey) {
long firstElectionTimeout = conf.getTimeDuration(configKey, -1, TimeUnit.MILLISECONDS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ private static ExceptionDependentRetry createExceptionDependentPolicy(
.setDefaultPolicy(multipleLinearRandomRetry)
.build();
}

private static TimeDuration toTimeDuration(Duration duration) {
return toTimeDuration(duration.toMillis());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public HddsProtos.AddScmRequestProto getProtobuf() {
return HddsProtos.AddScmRequestProto.newBuilder().setClusterId(clusterId)
.setScmId(scmId).setRatisAddr(ratisAddr).build();
}

/**
* Builder for AddSCMRequest.
*/
Expand All @@ -53,7 +54,6 @@ public static class Builder {
private String scmId;
private String ratisAddr;


/**
* sets the cluster id.
* @param cid clusterId to be set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ public void setKerberosPrincipal(String kerberosPrincipal) {
this.principal = kerberosPrincipal;
}


public void setKerberosKeytab(String kerberosKeytab) {
this.keytab = kerberosKeytab;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,6 @@ public final class ScmConfigKeys {
public static final String OZONE_SCM_PIPELINE_SCRUB_INTERVAL_DEFAULT =
"150s";


// Allow SCM to auto create factor ONE ratis pipeline.
public static final String OZONE_SCM_PIPELINE_AUTO_CREATE_FACTOR_ONE =
"ozone.scm.pipeline.creation.auto.factor.one";
Expand Down Expand Up @@ -497,7 +496,6 @@ public final class ScmConfigKeys {
"ozone.scm.ca.list.retry.interval";
public static final long OZONE_SCM_CA_LIST_RETRY_INTERVAL_DEFAULT = 10;


public static final String OZONE_SCM_EVENT_PREFIX = "ozone.scm.event.";

public static final String OZONE_SCM_EVENT_CONTAINER_REPORT_THREAD_POOL_SIZE =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public static IOException getIOExceptionForSendCommand(
return new IOException("Failed to execute command "
+ HddsUtils.processForDebug(request), e);
}

/**
* Sends a given command to server gets a waitable future back.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public HddsProtos.ContainerWithPipeline getProtobuf(int clientVersion)
return builder.build();
}


@Override
public String toString() {
return containerInfo.toString() + " | " + pipeline.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public class ExcludeList {
private long expiryTime = 0;
private final Clock clock;


public ExcludeList() {
clock = Clock.system(ZoneOffset.UTC);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ private Map<String, Integer> getExcludedScopeNodeCount(
}
return nodeCounts;
}

protected static class Factory implements InnerNode.Factory<InnerNodeImpl> {
protected Factory() { }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public final class NetUtils {
private NetUtils() {
// Prevent instantiation
}

/**
* Normalize a path by stripping off any trailing.
* {@link NetConstants#PATH_SEPARATOR}
Expand Down Expand Up @@ -74,7 +75,6 @@ public static int locationToDepth(String location) {
newLocation.split(NetConstants.PATH_SEPARATOR_STR).length;
}


/**
* Remove node from mutableExcludedNodes if it's covered by excludedScope.
* Please noted that mutableExcludedNodes content might be changed after the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ public interface NetworkTopology {
/** Exception for invalid network topology detection. */
class InvalidTopologyException extends RuntimeException {
private static final long serialVersionUID = 1L;

public InvalidTopologyException(String msg) {
super(msg);
}
}

/**
* Add a leaf node. This will be called when a new datanode is added.
* @param node node to be added; can be null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ public boolean isAncestor(String nodePath) {
NetUtils.addSuffix(nodePath).startsWith(
NetUtils.addSuffix(this.getNetworkFullPath()));
}

@Override
public boolean isDescendant(Node node) {
if (node == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ public void setDefaultName(String name) {
public int getCost() {
return this.cost;
}

public void setCost(int cost) {
this.cost = cost;
}
Expand Down Expand Up @@ -170,6 +171,7 @@ public String toString() {
public int getCost() {
return cost;
}

public static LayerType getType(String typeStr) {
for (LayerType type: LayerType.values()) {
if (typeStr.equalsIgnoreCase(type.toString())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public final class NodeSchemaLoader {

private static final int LAYOUT_VERSION = 1;
private static volatile NodeSchemaLoader instance = null;

private NodeSchemaLoader() { }

public static NodeSchemaLoader getInstance() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ public boolean sameDatanodes(Pipeline pipeline) {
return getNodeSet().equals(pipeline.getNodeSet());
}


/**
* Return the replica index of the specific datanode in the datanode set.
* <p>
Expand Down Expand Up @@ -604,6 +603,7 @@ public Builder setLeaderId(UUID leaderId1) {
this.leaderId = leaderId1;
return this;
}

public Builder setNodes(List<DatanodeDetails> nodes) {
this.nodeStatus = new LinkedHashMap<>();
nodes.forEach(node -> nodeStatus.put(node, -1L));
Expand Down Expand Up @@ -642,7 +642,6 @@ public Builder setSuggestedLeaderId(UUID uuid) {
return this;
}


public Builder setReplicaIndexes(Map<DatanodeDetails, Integer> indexes) {
this.replicaIndexes = indexes == null ? ImmutableMap.of() : ImmutableMap.copyOf(indexes);
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ public static ContainerCommandResponseProto getListBlockResponse(
.setListBlock(builder)
.build();
}

/**
* Returns successful getCommittedBlockLength Response.
* @param msg - Request.
Expand Down Expand Up @@ -281,6 +282,7 @@ public static ContainerCommandResponseProto getGetSmallFileResponseSuccess(
.setGetSmallFile(getSmallFile)
.build();
}

/**
* Returns a ReadContainer Response.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ public static void createContainer(XceiverClientSpi client, long containerID,
String encodedToken) throws IOException {
createContainer(client, containerID, encodedToken, null, 0);
}

/**
* createContainer call that creates a container on the datanode.
* @param client - client
Expand Down
Loading