Skip to content
Merged
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 @@ -18,10 +18,15 @@

package org.apache.hadoop.ozone.freon;

import org.apache.hadoop.hdds.HddsConfigKeys;
import org.apache.hadoop.hdds.client.ReplicationFactor;
import org.apache.hadoop.hdds.client.ReplicationType;
import org.apache.hadoop.hdds.conf.DatanodeRatisServerConfig;
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.apache.hadoop.hdds.protocol.proto.HddsProtos;
import org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos;
import org.apache.hadoop.hdds.ratis.RatisHelper;
import org.apache.hadoop.hdds.scm.ScmConfigKeys;
import org.apache.hadoop.hdds.scm.pipeline.Pipeline;
import org.apache.hadoop.hdds.scm.pipeline.PipelineID;
import org.apache.hadoop.hdds.scm.pipeline.PipelineManager;
Expand All @@ -30,13 +35,14 @@
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;

import java.util.concurrent.TimeUnit;

/**
* Tests Freon with Pipeline destroy.
*/
@Ignore

public class TestFreonWithPipelineDestroy {

private static MiniOzoneCluster cluster;
Expand All @@ -51,6 +57,27 @@ public class TestFreonWithPipelineDestroy {
@BeforeClass
public static void init() throws Exception {
conf = new OzoneConfiguration();
conf.setTimeDuration(ScmConfigKeys.OZONE_SCM_PIPELINE_DESTROY_TIMEOUT,
1, TimeUnit.SECONDS);
conf.setTimeDuration(HddsConfigKeys.HDDS_PIPELINE_REPORT_INTERVAL,
1, TimeUnit.SECONDS);
conf.setTimeDuration(
RatisHelper.HDDS_DATANODE_RATIS_SERVER_PREFIX_KEY + "." +
DatanodeRatisServerConfig.RATIS_SERVER_REQUEST_TIMEOUT_KEY,
3, TimeUnit.SECONDS);
conf.setTimeDuration(
RatisHelper.HDDS_DATANODE_RATIS_SERVER_PREFIX_KEY + "." +
DatanodeRatisServerConfig.
RATIS_SERVER_WATCH_REQUEST_TIMEOUT_KEY,
3, TimeUnit.SECONDS);
conf.setTimeDuration(
RatisHelper.HDDS_DATANODE_RATIS_CLIENT_PREFIX_KEY+ "." +
"rpc.request.timeout",
3, TimeUnit.SECONDS);
conf.setTimeDuration(
RatisHelper.HDDS_DATANODE_RATIS_CLIENT_PREFIX_KEY+ "." +
"watch.request.timeout",
3, TimeUnit.SECONDS);
cluster = MiniOzoneCluster.newBuilder(conf)
.setHbProcessorInterval(1000)
.setHbInterval(1000)
Expand All @@ -74,12 +101,14 @@ public static void shutdown() {
public void testRestart() throws Exception {
startFreon();
destroyPipeline();
cluster.waitForPipelineTobeReady(HddsProtos.ReplicationFactor.THREE,
180000);
startFreon();
}

private void startFreon() throws Exception {
RandomKeyGenerator randomKeyGenerator =
new RandomKeyGenerator((OzoneConfiguration) cluster.getConf());
new RandomKeyGenerator(cluster.getConf());
randomKeyGenerator.setNumOfVolumes(1);
randomKeyGenerator.setNumOfBuckets(1);
randomKeyGenerator.setNumOfKeys(1);
Expand Down