HDDS-19. Update ozone to latest ratis snapshot build (0.1.1-alpha-d7d7061-SNAPSHOT). Contributed by Lokesh Jain.
This commit is contained in:
parent
960940e0e0
commit
6653f4ba2e
@ -19,6 +19,9 @@
|
|||||||
|
|
||||||
import org.apache.hadoop.classification.InterfaceAudience;
|
import org.apache.hadoop.classification.InterfaceAudience;
|
||||||
import org.apache.hadoop.classification.InterfaceStability;
|
import org.apache.hadoop.classification.InterfaceStability;
|
||||||
|
import org.apache.ratis.util.TimeDuration;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class contains constants for configuration keys used in SCM.
|
* This class contains constants for configuration keys used in SCM.
|
||||||
@ -62,6 +65,16 @@ public final class ScmConfigKeys {
|
|||||||
"dfs.container.ratis.segment.preallocated.size";
|
"dfs.container.ratis.segment.preallocated.size";
|
||||||
public static final int
|
public static final int
|
||||||
DFS_CONTAINER_RATIS_SEGMENT_PREALLOCATED_SIZE_DEFAULT = 128 * 1024 * 1024;
|
DFS_CONTAINER_RATIS_SEGMENT_PREALLOCATED_SIZE_DEFAULT = 128 * 1024 * 1024;
|
||||||
|
public static final String DFS_RATIS_CLIENT_REQUEST_TIMEOUT_DURATION_KEY =
|
||||||
|
"dfs.ratis.client.request.timeout.duration";
|
||||||
|
public static final TimeDuration
|
||||||
|
DFS_RATIS_CLIENT_REQUEST_TIMEOUT_DURATION_DEFAULT =
|
||||||
|
TimeDuration.valueOf(3000, TimeUnit.MILLISECONDS);
|
||||||
|
public static final String DFS_RATIS_SERVER_REQUEST_TIMEOUT_DURATION_KEY =
|
||||||
|
"dfs.ratis.server.request.timeout.duration";
|
||||||
|
public static final TimeDuration
|
||||||
|
DFS_RATIS_SERVER_REQUEST_TIMEOUT_DURATION_DEFAULT =
|
||||||
|
TimeDuration.valueOf(3000, TimeUnit.MILLISECONDS);
|
||||||
|
|
||||||
// TODO : this is copied from OzoneConsts, may need to move to a better place
|
// TODO : this is copied from OzoneConsts, may need to move to a better place
|
||||||
public static final String OZONE_SCM_CHUNK_SIZE_KEY = "ozone.scm.chunk.size";
|
public static final String OZONE_SCM_CHUNK_SIZE_KEY = "ozone.scm.chunk.size";
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
import org.apache.hadoop.hdds.client.ReplicationFactor;
|
import org.apache.hadoop.hdds.client.ReplicationFactor;
|
||||||
import org.apache.hadoop.hdds.client.ReplicationType;
|
import org.apache.hadoop.hdds.client.ReplicationType;
|
||||||
import org.apache.hadoop.hdds.scm.ScmConfigKeys;
|
import org.apache.hadoop.hdds.scm.ScmConfigKeys;
|
||||||
|
import org.apache.ratis.util.TimeDuration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class contains constants for configuration keys used in Ozone.
|
* This class contains constants for configuration keys used in Ozone.
|
||||||
@ -226,6 +227,16 @@ public final class OzoneConfigKeys {
|
|||||||
= ScmConfigKeys.OZONE_SCM_CHUNK_MAX_SIZE;
|
= ScmConfigKeys.OZONE_SCM_CHUNK_MAX_SIZE;
|
||||||
public static final String DFS_CONTAINER_RATIS_DATANODE_STORAGE_DIR =
|
public static final String DFS_CONTAINER_RATIS_DATANODE_STORAGE_DIR =
|
||||||
"dfs.container.ratis.datanode.storage.dir";
|
"dfs.container.ratis.datanode.storage.dir";
|
||||||
|
public static final String DFS_RATIS_CLIENT_REQUEST_TIMEOUT_DURATION_KEY =
|
||||||
|
ScmConfigKeys.DFS_RATIS_CLIENT_REQUEST_TIMEOUT_DURATION_KEY;
|
||||||
|
public static final TimeDuration
|
||||||
|
DFS_RATIS_CLIENT_REQUEST_TIMEOUT_DURATION_DEFAULT =
|
||||||
|
ScmConfigKeys.DFS_RATIS_CLIENT_REQUEST_TIMEOUT_DURATION_DEFAULT;
|
||||||
|
public static final String DFS_RATIS_SERVER_REQUEST_TIMEOUT_DURATION_KEY =
|
||||||
|
ScmConfigKeys.DFS_RATIS_SERVER_REQUEST_TIMEOUT_DURATION_KEY;
|
||||||
|
public static final TimeDuration
|
||||||
|
DFS_RATIS_SERVER_REQUEST_TIMEOUT_DURATION_DEFAULT =
|
||||||
|
ScmConfigKeys.DFS_RATIS_SERVER_REQUEST_TIMEOUT_DURATION_DEFAULT;
|
||||||
|
|
||||||
public static final String OZONE_SCM_WEB_AUTHENTICATION_KERBEROS_PRINCIPAL =
|
public static final String OZONE_SCM_WEB_AUTHENTICATION_KERBEROS_PRINCIPAL =
|
||||||
"ozone.web.authentication.kerberos.principal";
|
"ozone.web.authentication.kerberos.principal";
|
||||||
|
@ -119,6 +119,18 @@
|
|||||||
used by Apache Ratis on datanodes.(128 MB by default)
|
used by Apache Ratis on datanodes.(128 MB by default)
|
||||||
</description>
|
</description>
|
||||||
</property>
|
</property>
|
||||||
|
<property>
|
||||||
|
<name>dfs.ratis.client.request.timeout.duration</name>
|
||||||
|
<value>3s</value>
|
||||||
|
<tag>OZONE, RATIS, MANAGEMENT</tag>
|
||||||
|
<description>The timeout duration for ratis client request.</description>
|
||||||
|
</property>
|
||||||
|
<property>
|
||||||
|
<name>dfs.ratis.server.request.timeout.duration</name>
|
||||||
|
<value>3s</value>
|
||||||
|
<tag>OZONE, RATIS, MANAGEMENT</tag>
|
||||||
|
<description>The timeout duration for ratis server request.</description>
|
||||||
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>ozone.container.report.interval</name>
|
<name>ozone.container.report.interval</name>
|
||||||
<value>60000ms</value>
|
<value>60000ms</value>
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
.XceiverServerSpi;
|
.XceiverServerSpi;
|
||||||
import org.apache.ratis.RaftConfigKeys;
|
import org.apache.ratis.RaftConfigKeys;
|
||||||
import org.apache.ratis.RatisHelper;
|
import org.apache.ratis.RatisHelper;
|
||||||
|
import org.apache.ratis.client.RaftClientConfigKeys;
|
||||||
import org.apache.ratis.conf.RaftProperties;
|
import org.apache.ratis.conf.RaftProperties;
|
||||||
import org.apache.ratis.grpc.GrpcConfigKeys;
|
import org.apache.ratis.grpc.GrpcConfigKeys;
|
||||||
import org.apache.ratis.netty.NettyConfigKeys;
|
import org.apache.ratis.netty.NettyConfigKeys;
|
||||||
@ -78,11 +79,31 @@ private XceiverServerRatis(DatanodeDetails dd, int port, String storageDir,
|
|||||||
final int numWriteChunkThreads = conf.getInt(
|
final int numWriteChunkThreads = conf.getInt(
|
||||||
OzoneConfigKeys.DFS_CONTAINER_RATIS_NUM_WRITE_CHUNK_THREADS_KEY,
|
OzoneConfigKeys.DFS_CONTAINER_RATIS_NUM_WRITE_CHUNK_THREADS_KEY,
|
||||||
OzoneConfigKeys.DFS_CONTAINER_RATIS_NUM_WRITE_CHUNK_THREADS_DEFAULT);
|
OzoneConfigKeys.DFS_CONTAINER_RATIS_NUM_WRITE_CHUNK_THREADS_DEFAULT);
|
||||||
|
TimeUnit timeUnit =
|
||||||
|
OzoneConfigKeys.DFS_RATIS_CLIENT_REQUEST_TIMEOUT_DURATION_DEFAULT
|
||||||
|
.getUnit();
|
||||||
|
long duration = conf.getTimeDuration(
|
||||||
|
OzoneConfigKeys.DFS_RATIS_CLIENT_REQUEST_TIMEOUT_DURATION_KEY,
|
||||||
|
OzoneConfigKeys.DFS_RATIS_CLIENT_REQUEST_TIMEOUT_DURATION_DEFAULT
|
||||||
|
.getDuration(), timeUnit);
|
||||||
|
final TimeDuration clientRequestTimeout =
|
||||||
|
TimeDuration.valueOf(duration, timeUnit);
|
||||||
|
timeUnit = OzoneConfigKeys.DFS_RATIS_SERVER_REQUEST_TIMEOUT_DURATION_DEFAULT
|
||||||
|
.getUnit();
|
||||||
|
duration = conf.getTimeDuration(
|
||||||
|
OzoneConfigKeys.DFS_RATIS_SERVER_REQUEST_TIMEOUT_DURATION_KEY,
|
||||||
|
OzoneConfigKeys.DFS_RATIS_SERVER_REQUEST_TIMEOUT_DURATION_DEFAULT
|
||||||
|
.getDuration(), timeUnit);
|
||||||
|
final TimeDuration serverRequestTimeout =
|
||||||
|
TimeDuration.valueOf(duration, timeUnit);
|
||||||
|
|
||||||
Objects.requireNonNull(dd, "id == null");
|
Objects.requireNonNull(dd, "id == null");
|
||||||
this.port = port;
|
this.port = port;
|
||||||
RaftProperties serverProperties = newRaftProperties(rpc, port,
|
RaftProperties serverProperties =
|
||||||
storageDir, maxChunkSize, raftSegmentSize, raftSegmentPreallocatedSize);
|
newRaftProperties(rpc, port, storageDir, maxChunkSize, raftSegmentSize,
|
||||||
|
raftSegmentPreallocatedSize);
|
||||||
|
setRequestTimeout(serverProperties, clientRequestTimeout,
|
||||||
|
serverRequestTimeout);
|
||||||
|
|
||||||
writeChunkExecutor =
|
writeChunkExecutor =
|
||||||
new ThreadPoolExecutor(numWriteChunkThreads, numWriteChunkThreads,
|
new ThreadPoolExecutor(numWriteChunkThreads, numWriteChunkThreads,
|
||||||
@ -99,6 +120,14 @@ private XceiverServerRatis(DatanodeDetails dd, int port, String storageDir,
|
|||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void setRequestTimeout(RaftProperties serverProperties,
|
||||||
|
TimeDuration clientRequestTimeout, TimeDuration serverRequestTimeout) {
|
||||||
|
RaftClientConfigKeys.Rpc
|
||||||
|
.setRequestTimeout(serverProperties, clientRequestTimeout);
|
||||||
|
RaftServerConfigKeys.Rpc
|
||||||
|
.setRequestTimeout(serverProperties, serverRequestTimeout);
|
||||||
|
}
|
||||||
|
|
||||||
private static RaftProperties newRaftProperties(
|
private static RaftProperties newRaftProperties(
|
||||||
RpcType rpc, int port, String storageDir, int scmChunkSize,
|
RpcType rpc, int port, String storageDir, int scmChunkSize,
|
||||||
int raftSegmentSize, int raftSegmentPreallocatedSize) {
|
int raftSegmentSize, int raftSegmentPreallocatedSize) {
|
||||||
|
@ -97,7 +97,7 @@
|
|||||||
<ldap-api.version>1.0.0-M33</ldap-api.version>
|
<ldap-api.version>1.0.0-M33</ldap-api.version>
|
||||||
|
|
||||||
<!-- Apache Ratis version -->
|
<!-- Apache Ratis version -->
|
||||||
<ratis.version>0.1.1-alpha-8fd74ed-SNAPSHOT</ratis.version>
|
<ratis.version>0.1.1-alpha-d7d7061-SNAPSHOT</ratis.version>
|
||||||
<jcache.version>1.0-alpha-1</jcache.version>
|
<jcache.version>1.0-alpha-1</jcache.version>
|
||||||
<ehcache.version>3.3.1</ehcache.version>
|
<ehcache.version>3.3.1</ehcache.version>
|
||||||
<hikari.version>2.4.12</hikari.version>
|
<hikari.version>2.4.12</hikari.version>
|
||||||
@ -106,7 +106,7 @@
|
|||||||
|
|
||||||
<!-- Maven protoc compiler -->
|
<!-- Maven protoc compiler -->
|
||||||
<protobuf-maven-plugin.version>0.5.1</protobuf-maven-plugin.version>
|
<protobuf-maven-plugin.version>0.5.1</protobuf-maven-plugin.version>
|
||||||
<protobuf-compile.version>3.1.0</protobuf-compile.version>
|
<protobuf-compile.version>3.5.0</protobuf-compile.version>
|
||||||
<os-maven-plugin.version>1.5.0.Final</os-maven-plugin.version>
|
<os-maven-plugin.version>1.5.0.Final</os-maven-plugin.version>
|
||||||
|
|
||||||
<!-- define the Java language version used by the compiler -->
|
<!-- define the Java language version used by the compiler -->
|
||||||
@ -880,12 +880,6 @@
|
|||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.jctools</groupId>
|
|
||||||
<artifactId>jctools-core</artifactId>
|
|
||||||
<version>1.2.1</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.ratis</groupId>
|
<groupId>org.apache.ratis</groupId>
|
||||||
<artifactId>ratis-proto-shaded</artifactId>
|
<artifactId>ratis-proto-shaded</artifactId>
|
||||||
|
Loading…
Reference in New Issue
Block a user