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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@ public class DatanodeRatisServerConfig {
)
private long requestTimeOut = Duration.ofSeconds(60).toMillis();

public long getRequestTimeOut() {
return requestTimeOut;
}

public void setRequestTimeOut(Duration duration) {
this.requestTimeOut = duration.toMillis();
}

@Config(key = "watch.timeout",
defaultValue = "30s",
type = ConfigType.TIME,
Expand All @@ -63,14 +55,6 @@ public void setRequestTimeOut(Duration duration) {
)
private long watchTimeOut = Duration.ofSeconds(30).toMillis();

public long getWatchTimeOut() {
return watchTimeOut;
}

public void setWatchTimeOut(Duration duration) {
this.watchTimeOut = duration.toMillis();
}

@Config(key = "notification.no-leader.timeout",
defaultValue = "300s",
type = ConfigType.TIME,
Expand All @@ -81,14 +65,6 @@ public void setWatchTimeOut(Duration duration) {
)
private long noLeaderTimeout = Duration.ofSeconds(300).toMillis();

public long getNoLeaderTimeout() {
return noLeaderTimeout;
}

public void setNoLeaderTimeout(Duration duration) {
this.noLeaderTimeout = duration.toMillis();
}

@Config(key = "rpc.slowness.timeout",
defaultValue = "300s",
type = ConfigType.TIME,
Expand All @@ -99,14 +75,6 @@ public void setNoLeaderTimeout(Duration duration) {
)
private long followerSlownessTimeout = Duration.ofSeconds(300).toMillis();

public long getFollowerSlownessTimeout() {
return followerSlownessTimeout;
}

public void setFollowerSlownessTimeout(Duration duration) {
this.followerSlownessTimeout = duration.toMillis();
}

@Config(key = "write.element-limit",
defaultValue = "1024",
type = ConfigType.INT,
Expand All @@ -116,14 +84,6 @@ public void setFollowerSlownessTimeout(Duration duration) {
)
private int leaderNumPendingRequests;

public int getLeaderNumPendingRequests() {
return leaderNumPendingRequests;
}

public void setLeaderNumPendingRequests(int leaderNumPendingRequests) {
this.leaderNumPendingRequests = leaderNumPendingRequests;
}

@Config(key = "datastream.request.threads",
defaultValue = "20",
type = ConfigType.INT,
Expand All @@ -133,14 +93,6 @@ public void setLeaderNumPendingRequests(int leaderNumPendingRequests) {
)
private int streamRequestThreads;

public int getStreamRequestThreads() {
return streamRequestThreads;
}

public void setStreamRequestThreads(int streamRequestThreads) {
this.streamRequestThreads = streamRequestThreads;
}

@Config(key = "datastream.client.pool.size",
defaultValue = "10",
type = ConfigType.INT,
Expand All @@ -150,14 +102,6 @@ public void setStreamRequestThreads(int streamRequestThreads) {
)
private int clientPoolSize;

public int getClientPoolSize() {
return clientPoolSize;
}

public void setClientPoolSize(int clientPoolSize) {
this.clientPoolSize = clientPoolSize;
}

@Config(key = "delete.ratis.log.directory",
defaultValue = "true",
type = ConfigType.BOOLEAN,
Expand All @@ -167,14 +111,6 @@ public void setClientPoolSize(int clientPoolSize) {
)
private boolean shouldDeleteRatisLogDirectory;

public boolean shouldDeleteRatisLogDirectory() {
return shouldDeleteRatisLogDirectory;
}

public void setLeaderNumPendingRequests(boolean delete) {
this.shouldDeleteRatisLogDirectory = delete;
}

@Config(key = "leaderelection.pre-vote",
defaultValue = "true",
type = ConfigType.BOOLEAN,
Expand All @@ -183,14 +119,6 @@ public void setLeaderNumPendingRequests(boolean delete) {
)
private boolean preVoteEnabled = true;

public boolean isPreVoteEnabled() {
return preVoteEnabled;
}

public void setPreVote(boolean preVote) {
this.preVoteEnabled = preVote;
}

/** @see RaftServerConfigKeys.Log.Appender#WAIT_TIME_MIN_KEY */
@Config(key = "log.appender.wait-time.min",
defaultValue = "0us",
Expand All @@ -204,6 +132,78 @@ public void setPreVote(boolean preVote) {
)
private long logAppenderWaitTimeMin;

public long getRequestTimeOut() {
return requestTimeOut;
}

public void setRequestTimeOut(Duration duration) {
this.requestTimeOut = duration.toMillis();
}

public long getWatchTimeOut() {
return watchTimeOut;
}

public void setWatchTimeOut(Duration duration) {
this.watchTimeOut = duration.toMillis();
}

public long getNoLeaderTimeout() {
return noLeaderTimeout;
}

public void setNoLeaderTimeout(Duration duration) {
this.noLeaderTimeout = duration.toMillis();
}

public long getFollowerSlownessTimeout() {
return followerSlownessTimeout;
}

public void setFollowerSlownessTimeout(Duration duration) {
this.followerSlownessTimeout = duration.toMillis();
}

public int getLeaderNumPendingRequests() {
return leaderNumPendingRequests;
}

public void setLeaderNumPendingRequests(int leaderNumPendingRequests) {
this.leaderNumPendingRequests = leaderNumPendingRequests;
}

public int getStreamRequestThreads() {
return streamRequestThreads;
}

public void setStreamRequestThreads(int streamRequestThreads) {
this.streamRequestThreads = streamRequestThreads;
}

public int getClientPoolSize() {
return clientPoolSize;
}

public void setClientPoolSize(int clientPoolSize) {
this.clientPoolSize = clientPoolSize;
}

public boolean shouldDeleteRatisLogDirectory() {
return shouldDeleteRatisLogDirectory;
}

public void setLeaderNumPendingRequests(boolean delete) {
this.shouldDeleteRatisLogDirectory = delete;
}

public boolean isPreVoteEnabled() {
return preVoteEnabled;
}

public void setPreVote(boolean preVote) {
this.preVoteEnabled = preVote;
}

public long getLogAppenderWaitTimeMin() {
return logAppenderWaitTimeMin;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
@InterfaceStability.Evolving
public interface SpaceUsageCheckFactory {

String CONFIG_PREFIX = "hdds.datanode.du.factory";

/**
* Creates configuration for the HDDS volume rooted at {@code dir}.
*
Expand Down Expand Up @@ -110,8 +112,6 @@ static DUFactory defaultImplementation() {
return new DUFactory();
}

String CONFIG_PREFIX = "hdds.datanode.du.factory";

/**
* Configuration for {@link SpaceUsageCheckFactory}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ public class MoveDataNodePair {
MoveDataNodePair.class,
DelegatedCodec.CopyType.SHALLOW);

public static Codec<MoveDataNodePair> getCodec() {
return CODEC;
}

/**
* source datanode of current move option.
*/
Expand All @@ -58,6 +54,10 @@ public MoveDataNodePair(DatanodeDetails src, DatanodeDetails tgt) {
this.tgt = tgt;
}

public static Codec<MoveDataNodePair> getCodec() {
return CODEC;
}

public DatanodeDetails getTgt() {
return tgt;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,6 @@
* Generates container tokens.
*/
public interface ContainerTokenGenerator {

/**
* Shortcut for generating encoded token for current user.
* @throws UncheckedIOException if user lookup or URL-encoding fails
*/
String generateEncodedToken(ContainerID containerID);

/**
* Generate token for the container.
*/
Token<ContainerTokenIdentifier> generateToken(String user,
ContainerID containerID);

/**
* No-op implementation for when container tokens are disabled.
*/
Expand All @@ -48,10 +35,19 @@ public String generateEncodedToken(ContainerID containerID) {
}

@Override
public Token<ContainerTokenIdentifier> generateToken(String user,
ContainerID containerID) {
public Token<ContainerTokenIdentifier> generateToken(String user, ContainerID containerID) {
return new Token<>();
}
};

/**
* Shortcut for generating encoded token for current user.
* @throws UncheckedIOException if user lookup or URL-encoding fails
*/
String generateEncodedToken(ContainerID containerID);

/**
* Generate token for the container.
*/
Token<ContainerTokenIdentifier> generateToken(String user, ContainerID containerID);
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ public final class CertInfo implements Comparable<CertInfo>, Serializable {
CertInfo::getProtobuf,
CertInfo.class);

public static Codec<CertInfo> getCodec() {
return CODEC;
}

static final Comparator<CertInfo> COMPARATOR
= Comparator.comparingLong(CertInfo::getTimestamp);

Expand All @@ -56,6 +52,10 @@ private CertInfo(X509Certificate x509Certificate, long timestamp) {
this.timestamp = timestamp;
}

public static Codec<CertInfo> getCodec() {
return CODEC;
}

public static CertInfo fromProtobuf(CertInfoProto info) throws IOException {
return new CertInfo.Builder()
.setX509Certificate(info.getX509Certificate())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1703,12 +1703,12 @@ private void initHttpHeaderMap() {
public enum XFrameOption {
DENY("DENY"), SAMEORIGIN("SAMEORIGIN"), ALLOWFROM("ALLOW-FROM");

private final String name;

XFrameOption(String name) {
this.name = name;
}

private final String name;

@Override
public String toString() {
return this.name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,8 @@
*/
@InterfaceAudience.Private
public final class HttpServer2Metrics implements MetricsSource {
enum HttpServer2MetricsInfo implements MetricsInfo {
SERVER_NAME("HttpServer2 Metrics."),
HttpServerThreadCount("Number of threads in the pool."),
HttpServerIdleThreadCount("Number of idle threads but not reserved."),
HttpServerMaxThreadCount("Maximum number of threads in the pool."),
HttpServerThreadQueueWaitingTaskCount(
"The number of jobs in the queue waiting for a thread");

private final String desc;

HttpServer2MetricsInfo(String desc) {
this.desc = desc;
}

@Override
public String description() {
return desc;
}
}

public static final String SOURCE_NAME =
HttpServer2Metrics.class.getSimpleName();
public static final String SOURCE_NAME = HttpServer2Metrics.class.getSimpleName();

public static final String NAME = HttpServer2Metrics.class.getSimpleName();

Expand Down Expand Up @@ -91,4 +71,24 @@ public void unRegister() {
MetricsSystem ms = DefaultMetricsSystem.instance();
ms.unregisterSource(NAME);
}

enum HttpServer2MetricsInfo implements MetricsInfo {
SERVER_NAME("HttpServer2 Metrics."),
HttpServerThreadCount("Number of threads in the pool."),
HttpServerIdleThreadCount("Number of idle threads but not reserved."),
HttpServerMaxThreadCount("Maximum number of threads in the pool."),
HttpServerThreadQueueWaitingTaskCount(
"The number of jobs in the queue waiting for a thread");

private final String desc;

HttpServer2MetricsInfo(String desc) {
this.desc = desc;
}

@Override
public String description() {
return desc;
}
}
}
Loading