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 @@ -88,10 +88,10 @@ public final class OzoneConfigKeys {
/**
* Ratis Port where containers listen to datastream requests.
*/
public static final String DFS_CONTAINER_RATIS_DATASTREAM_ENABLE
= "dfs.container.ratis.datastream.enable";
public static final boolean DFS_CONTAINER_RATIS_DATASTREAM_ENABLE_DEFAULT
= true;
public static final String DFS_CONTAINER_RATIS_DATASTREAM_ENABLED
= "dfs.container.ratis.datastream.enabled";
public static final boolean DFS_CONTAINER_RATIS_DATASTREAM_ENABLED_DEFAULT
= false;
public static final String DFS_CONTAINER_RATIS_DATASTREAM_PORT
= "dfs.container.ratis.datastream.port";
public static final int DFS_CONTAINER_RATIS_DATASTREAM_PORT_DEFAULT
Expand All @@ -100,9 +100,10 @@ public final class OzoneConfigKeys {
/**
* Flag to enable ratis streaming on filesystem writes.
*/
public static final String OZONE_FS_DATASTREAM_ENABLE =
"ozone.fs.datastream.enable";
public static final boolean OZONE_FS_DATASTREAM_ENABLE_DEFAULT = false;
public static final String OZONE_FS_DATASTREAM_ENABLED
= "ozone.fs.datastream.enabled";
public static final boolean OZONE_FS_DATASTREAM_ENABLED_DEFAULT
= false;

/**
* When set to true, allocate a random free port for ozone container, so that
Expand Down
11 changes: 6 additions & 5 deletions hadoop-hdds/common/src/main/resources/ozone-default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@
<tag>OZONE, CONTAINER, MANAGEMENT</tag>
<description>The ipc port number of container.</description>
</property>

<property>
<name>dfs.container.ratis.datastream.enable</name>
<value>true</value>
<name>dfs.container.ratis.datastream.enabled</name>
<value>false</value>
<tag>OZONE, CONTAINER, RATIS, DATASTREAM</tag>
<description>If enable datastream ipc of container.</description>
<description>It specifies whether to enable data stream of container.</description>
</property>
<property>
<name>dfs.container.ratis.datastream.port</name>
Expand Down Expand Up @@ -3377,8 +3378,8 @@
The time to live for container location cache in Ozone.
</description>
</property>

<name>ozone.fs.datastream.enable</name>
<property>
<name>ozone.fs.datastream.enabled</name>
<value>false</value>
<tag>OZONE, DATANODE</tag>
<description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ private XceiverServerRatis(DatanodeDetails dd,
datanodeDetails = dd;
assignPorts();
this.streamEnable = conf.getBoolean(
OzoneConfigKeys.DFS_CONTAINER_RATIS_DATASTREAM_ENABLE,
OzoneConfigKeys.DFS_CONTAINER_RATIS_DATASTREAM_ENABLE_DEFAULT);
OzoneConfigKeys.DFS_CONTAINER_RATIS_DATASTREAM_ENABLED,
OzoneConfigKeys.DFS_CONTAINER_RATIS_DATASTREAM_ENABLED_DEFAULT);
RaftProperties serverProperties = newRaftProperties();
this.context = context;
this.dispatcher = dispatcher;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ public void setUp() throws Exception {
TimeUnit.MILLISECONDS);
conf.setBoolean(OzoneConfigKeys.DFS_CONTAINER_RATIS_IPC_RANDOM_PORT, true);
conf.setBoolean(OzoneConfigKeys.DFS_CONTAINER_IPC_RANDOM_PORT, true);
conf.setBoolean(OzoneConfigKeys.DFS_CONTAINER_RATIS_DATASTREAM_ENABLED,
true);
conf.setBoolean(
OzoneConfigKeys.DFS_CONTAINER_RATIS_DATASTREAM_RANDOM_PORT, true);
serverAddresses = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ public TestDatanodeUpgradeToSchemaV3(Boolean enable) {
conf = new OzoneConfiguration();
conf.setBoolean(DatanodeConfiguration.CONTAINER_SCHEMA_V3_ENABLED,
this.schemaV3Enabled);
conf.setBoolean(OzoneConfigKeys.DFS_CONTAINER_RATIS_DATASTREAM_ENABLED,
true);
conf.setBoolean(
OzoneConfigKeys.DFS_CONTAINER_RATIS_DATASTREAM_RANDOM_PORT, true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ public void testGetVersionTask() throws Exception {
try (EndpointStateMachine rpcEndPoint = createEndpoint(conf,
serverAddress, 1000)) {
DatanodeDetails datanodeDetails = randomDatanodeDetails();
conf.setBoolean(OzoneConfigKeys.DFS_CONTAINER_RATIS_DATASTREAM_ENABLED,
true);
conf.setBoolean(
OzoneConfigKeys.DFS_CONTAINER_RATIS_DATASTREAM_RANDOM_PORT, true);
OzoneContainer ozoneContainer = new OzoneContainer(
Expand All @@ -170,6 +172,8 @@ public void testCheckVersionResponse() throws Exception {
true);
conf.setBoolean(OzoneConfigKeys.DFS_CONTAINER_RATIS_IPC_RANDOM_PORT,
true);
conf.setBoolean(OzoneConfigKeys.DFS_CONTAINER_RATIS_DATASTREAM_ENABLED,
true);
conf.setBoolean(
OzoneConfigKeys.DFS_CONTAINER_RATIS_DATASTREAM_RANDOM_PORT, true);
conf.setFromObject(new ReplicationConfig().setPort(0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ abstract class Builder {

protected Boolean randomContainerPort = true;
protected Boolean randomContainerStreamPort = true;
protected Boolean enableContainerDatastream = true;
protected Optional<String> datanodeReservedSpace = Optional.empty();
protected Optional<Integer> chunkSize = Optional.empty();
protected OptionalInt streamBufferSize = OptionalInt.empty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,8 @@ private void configureHddsDatanodes() {
randomContainerPort);
conf.setBoolean(OzoneConfigKeys.DFS_CONTAINER_RATIS_IPC_RANDOM_PORT,
randomContainerPort);
conf.setBoolean(OzoneConfigKeys.DFS_CONTAINER_RATIS_DATASTREAM_ENABLED,
enableContainerDatastream);
conf.setBoolean(DFS_CONTAINER_RATIS_DATASTREAM_RANDOM_PORT,
randomContainerStreamPort);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ public void testContainerRandomPort() throws IOException {
ozoneConf.setBoolean(OzoneConfigKeys.DFS_CONTAINER_IPC_RANDOM_PORT, true);
ozoneConf.setBoolean(OzoneConfigKeys.DFS_CONTAINER_RATIS_IPC_RANDOM_PORT,
true);
conf.setBoolean(OzoneConfigKeys.DFS_CONTAINER_RATIS_DATASTREAM_ENABLED,
true);
ozoneConf.setBoolean(
OzoneConfigKeys.DFS_CONTAINER_RATIS_DATASTREAM_RANDOM_PORT, true);
List<DatanodeStateMachine> stateMachines = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ static XceiverServerRatis newXceiverServerRatis(
DatanodeDetails dn, OzoneConfiguration conf) throws IOException {
conf.setInt(OzoneConfigKeys.DFS_CONTAINER_RATIS_IPC_PORT,
dn.getPort(DatanodeDetails.Port.Name.RATIS).getValue());
conf.setBoolean(OzoneConfigKeys.DFS_CONTAINER_RATIS_DATASTREAM_ENABLED,
true);
conf.setBoolean(
OzoneConfigKeys.DFS_CONTAINER_RATIS_DATASTREAM_RANDOM_PORT, true);
final String dir = TEST_DIR + dn.getUuid();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ public FSDataOutputStream createNonRecursive(Path path,
private FSDataOutputStream createOutputStream(String key, short replication,
boolean overwrite, boolean recursive) throws IOException {
boolean isRatisStreamingEnabled = getConf().getBoolean(
OzoneConfigKeys.OZONE_FS_DATASTREAM_ENABLE,
OzoneConfigKeys.OZONE_FS_DATASTREAM_ENABLE_DEFAULT);
OzoneConfigKeys.OZONE_FS_DATASTREAM_ENABLED,
OzoneConfigKeys.OZONE_FS_DATASTREAM_ENABLED_DEFAULT);
if (isRatisStreamingEnabled) {
return new FSDataOutputStream(adapter.createStreamFile(key,
replication, overwrite, recursive), statistics);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ public FSDataOutputStream createNonRecursive(Path path,
private FSDataOutputStream createOutputStream(String key, short replication,
boolean overwrite, boolean recursive) throws IOException {
boolean isRatisStreamingEnabled = getConf().getBoolean(
OzoneConfigKeys.OZONE_FS_DATASTREAM_ENABLE,
OzoneConfigKeys.OZONE_FS_DATASTREAM_ENABLE_DEFAULT);
OzoneConfigKeys.OZONE_FS_DATASTREAM_ENABLED,
OzoneConfigKeys.OZONE_FS_DATASTREAM_ENABLED_DEFAULT);
if (isRatisStreamingEnabled) {
return new FSDataOutputStream(adapter.createStreamFile(key,
replication, overwrite, recursive), statistics);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.apache.hadoop.hdds.protocol.StorageType;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.ozone.OzoneAcl;
import org.apache.hadoop.ozone.client.io.OzoneDataStreamOutput;
import org.apache.hadoop.ozone.client.io.OzoneInputStream;
import org.apache.hadoop.ozone.client.io.OzoneOutputStream;
import org.apache.hadoop.ozone.client.protocol.ClientProtocol;
Expand Down Expand Up @@ -570,4 +571,27 @@ Map<DatanodeDetails, OzoneInputStream>> getKeysEveryReplicas(
String volumeName, String bucketName, String keyName) throws IOException {
return null;
}

@Override
public OzoneDataStreamOutput createStreamKey(
String volumeName, String bucketName, String keyName, long size,
ReplicationConfig replicationConfig, Map<String, String> metadata)
throws IOException {
return null;
}

@Override
public OzoneDataStreamOutput createMultipartStreamKey(
String volumeName, String bucketName, String keyName, long size,
int partNumber, String uploadID) throws IOException {
return null;
}

@Override
public OzoneDataStreamOutput createStreamFile(
String volumeName, String bucketName, String keyName, long size,
ReplicationConfig replicationConf, boolean overWrite, boolean recursive)
throws IOException {
return null;
}
}