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 @@ -47,14 +47,6 @@ public class ContainerReportHandler extends AbstractContainerReportHandler
private static final Logger LOG =
LoggerFactory.getLogger(ContainerReportHandler.class);

enum UnknownContainerAction {
WARN, DELETE;

static UnknownContainerAction parse(String s) {
return s.equals(DELETE.name()) ? DELETE : WARN;
}
}

private final UnknownContainerAction unknownContainerHandleAction;

/**
Expand Down Expand Up @@ -273,4 +265,12 @@ private void processMissingReplicas(final DatanodeDetails datanodeDetails,
}
}
}

enum UnknownContainerAction {
WARN, DELETE;

static UnknownContainerAction parse(String s) {
return s.equals(DELETE.name()) ? DELETE : WARN;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,55 +53,6 @@
public final class MoveManager implements
ContainerReplicaPendingOpsSubscriber {

/**
* Various move return results.
*/
public enum MoveResult {
// both replication and deletion are completed
COMPLETED,
// RM is not ratis leader
FAIL_LEADER_NOT_READY,
// replication fail because the container does not exist in src
REPLICATION_FAIL_NOT_EXIST_IN_SOURCE,
// replication fail because the container exists in target
REPLICATION_FAIL_EXIST_IN_TARGET,
// replication fail because the container is not cloesed
REPLICATION_FAIL_CONTAINER_NOT_CLOSED,
// replication fail because the container is in inflightDeletion
REPLICATION_FAIL_INFLIGHT_DELETION,
// replication fail because the container is in inflightReplication
REPLICATION_FAIL_INFLIGHT_REPLICATION,
// replication fail because of timeout
REPLICATION_FAIL_TIME_OUT,
// replication fail because of node is not in service
REPLICATION_FAIL_NODE_NOT_IN_SERVICE,
// replication fail because node is unhealthy
REPLICATION_FAIL_NODE_UNHEALTHY,
// replication succeed, but deletion fail because of timeout
DELETION_FAIL_TIME_OUT,
// deletion fail because of node is not in service
DELETION_FAIL_NODE_NOT_IN_SERVICE,
// replication succeed, but deletion fail because because
// node is unhealthy
DELETION_FAIL_NODE_UNHEALTHY,
// replication succeed, but if we delete the container from
// the source datanode , the policy(eg, replica num or
// rack location) will not be satisfied, so we should not delete
// the container
DELETE_FAIL_POLICY,
/*
Container is not healthy if it has issues such as under, over, or mis
replication. We don't try to move replicas of such containers.
*/
REPLICATION_NOT_HEALTHY_BEFORE_MOVE,
// replicas + target - src does not satisfy placement policy
REPLICATION_NOT_HEALTHY_AFTER_MOVE,
// A move is already scheduled for this container
FAIL_CONTAINER_ALREADY_BEING_MOVED,
// Unexpected error
FAIL_UNEXPECTED_ERROR
}

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

Expand Down Expand Up @@ -502,4 +453,53 @@ void setMoveTimeout(long moveTimeout) {
void setReplicationTimeout(long replicationTimeout) {
this.replicationTimeout = replicationTimeout;
}

/**
* Various move return results.
*/
public enum MoveResult {
// both replication and deletion are completed
COMPLETED,
// RM is not ratis leader
FAIL_LEADER_NOT_READY,
// replication fail because the container does not exist in src
REPLICATION_FAIL_NOT_EXIST_IN_SOURCE,
// replication fail because the container exists in target
REPLICATION_FAIL_EXIST_IN_TARGET,
// replication fail because the container is not cloesed
REPLICATION_FAIL_CONTAINER_NOT_CLOSED,
// replication fail because the container is in inflightDeletion
REPLICATION_FAIL_INFLIGHT_DELETION,
// replication fail because the container is in inflightReplication
REPLICATION_FAIL_INFLIGHT_REPLICATION,
// replication fail because of timeout
REPLICATION_FAIL_TIME_OUT,
// replication fail because of node is not in service
REPLICATION_FAIL_NODE_NOT_IN_SERVICE,
// replication fail because node is unhealthy
REPLICATION_FAIL_NODE_UNHEALTHY,
// replication succeed, but deletion fail because of timeout
DELETION_FAIL_TIME_OUT,
// deletion fail because of node is not in service
DELETION_FAIL_NODE_NOT_IN_SERVICE,
// replication succeed, but deletion fail because because
// node is unhealthy
DELETION_FAIL_NODE_UNHEALTHY,
// replication succeed, but if we delete the container from
// the source datanode , the policy(eg, replica num or
// rack location) will not be satisfied, so we should not delete
// the container
DELETE_FAIL_POLICY,
/*
Container is not healthy if it has issues such as under, over, or mis
replication. We don't try to move replicas of such containers.
*/
REPLICATION_NOT_HEALTHY_BEFORE_MOVE,
// replicas + target - src does not satisfy placement policy
REPLICATION_NOT_HEALTHY_AFTER_MOVE,
// A move is already scheduled for this container
FAIL_CONTAINER_ALREADY_BEING_MOVED,
// Unexpected error
FAIL_UNEXPECTED_ERROR
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,6 @@
*/
public class ContainerHealthResult {

/**
* All possible container health states.
*/
public enum HealthState {
HEALTHY,
UNHEALTHY,
UNDER_REPLICATED,
OVER_REPLICATED,
MIS_REPLICATED
}

private final ContainerInfo containerInfo;
private final HealthState healthState;
private final List<SCMCommand<?>> commands = new ArrayList<>();
Expand Down Expand Up @@ -402,4 +391,15 @@ public void setIsSafelyOverReplicated(boolean isSafelyOverReplicated) {
this.isSafelyOverReplicated = isSafelyOverReplicated;
}
}

/**
* All possible container health states.
*/
public enum HealthState {
HEALTHY,
UNHEALTHY,
UNDER_REPLICATED,
OVER_REPLICATED,
MIS_REPLICATED
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@
*/
public class ContainerReplicaOp {

/**
* Enum representing different types of pending Ops.
*/
public enum PendingOpType {
ADD, DELETE
}

private final PendingOpType opType;
private final DatanodeDetails target;
private final int replicaIndex;
Expand Down Expand Up @@ -72,4 +65,10 @@ public long getDeadlineEpochMillis() {
return deadlineEpochMillis;
}

/**
* Enum representing different types of pending Ops.
*/
public enum PendingOpType {
ADD, DELETE
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1132,14 +1132,6 @@ public static class ReplicationManagerConfiguration
+ "retried.")
private long eventTimeout = Duration.ofMinutes(12).toMillis();

public void setInterval(Duration interval) {
this.interval = interval;
}

public void setEventTimeout(Duration timeout) {
this.eventTimeout = timeout.toMillis();
}

/**
* When a command has a deadline in SCM, the datanode timeout should be
* slightly less. This duration is the number of seconds to subtract from
Expand All @@ -1157,14 +1149,6 @@ public void setEventTimeout(Duration timeout) {
+ "should have expired.")
private long datanodeTimeoutOffset = Duration.ofMinutes(6).toMillis();

public long getDatanodeTimeoutOffset() {
return datanodeTimeoutOffset;
}

public void setDatanodeTimeoutOffset(long val) {
datanodeTimeoutOffset = val;
}

/**
* The number of container replica which must be available for a node to
* enter maintenance.
Expand All @@ -1181,10 +1165,6 @@ public void setDatanodeTimeoutOffset(long val) {
" entering maintenance state until a new replica is created.")
private int maintenanceReplicaMinimum = 2;

public void setMaintenanceReplicaMinimum(int replicaCount) {
this.maintenanceReplicaMinimum = replicaCount;
}

/**
* Defines how many redundant replicas of a container must be online for a
* node to enter maintenance. Currently, only used for EC containers. We
Expand Down Expand Up @@ -1235,10 +1215,6 @@ public void setMaintenanceReplicaMinimum(int replicaCount) {
)
private int datanodeReplicationLimit = 20;

public int getDatanodeReplicationLimit() {
return datanodeReplicationLimit;
}

@Config(key = "datanode.reconstruction.weight",
type = ConfigType.INT,
defaultValue = "3",
Expand All @@ -1251,10 +1227,6 @@ public int getDatanodeReplicationLimit() {
)
private int reconstructionCommandWeight = 3;

public int getReconstructionCommandWeight() {
return reconstructionCommandWeight;
}

@Config(key = "datanode.delete.container.limit",
type = ConfigType.INT,
defaultValue = "40",
Expand All @@ -1267,10 +1239,6 @@ public int getReconstructionCommandWeight() {
)
private int datanodeDeleteLimit = 40;

public int getDatanodeDeleteLimit() {
return datanodeDeleteLimit;
}

@Config(key = "inflight.limit.factor",
type = ConfigType.DOUBLE,
defaultValue = "0.75",
Expand All @@ -1289,6 +1257,22 @@ public int getDatanodeDeleteLimit() {
)
private double inflightReplicationLimitFactor = 0.75;

public long getDatanodeTimeoutOffset() {
return datanodeTimeoutOffset;
}

public void setDatanodeTimeoutOffset(long val) {
datanodeTimeoutOffset = val;
}

public int getReconstructionCommandWeight() {
return reconstructionCommandWeight;
}

public int getDatanodeDeleteLimit() {
return datanodeDeleteLimit;
}

public double getInflightReplicationLimitFactor() {
return inflightReplicationLimitFactor;
}
Expand All @@ -1297,6 +1281,10 @@ public void setInflightReplicationLimitFactor(double factor) {
this.inflightReplicationLimitFactor = factor;
}

public int getDatanodeReplicationLimit() {
return datanodeReplicationLimit;
}

public void setDatanodeReplicationLimit(int limit) {
this.datanodeReplicationLimit = limit;
}
Expand All @@ -1313,6 +1301,10 @@ public Duration getInterval() {
return interval;
}

public void setInterval(Duration interval) {
this.interval = interval;
}

public Duration getUnderReplicatedInterval() {
return underReplicatedInterval;
}
Expand All @@ -1333,10 +1325,18 @@ public long getEventTimeout() {
return eventTimeout;
}

public void setEventTimeout(Duration timeout) {
this.eventTimeout = timeout.toMillis();
}

public int getMaintenanceReplicaMinimum() {
return maintenanceReplicaMinimum;
}

public void setMaintenanceReplicaMinimum(int replicaCount) {
this.maintenanceReplicaMinimum = replicaCount;
}

public boolean isPush() {
return push;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,11 @@
*/
public final class ReplicationManagerUtil {

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

private ReplicationManagerUtil() {
}

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

/**
* Using the passed placement policy attempt to select a list of datanodes to
* use as new targets. If the placement policy is unable to select enough
Expand Down
Loading