HDDS-305. Datanode StateContext#addContainerActionIfAbsent will add container action even if there already is a ContainerAction. Contributed by Nanda kumar.
This commit is contained in:
parent
3e06a5dcea
commit
7631e0adae
@ -168,19 +168,8 @@ private void sendCloseContainerActionIfNeeded(Container container) {
|
||||
double containerUsedPercentage = 1.0f * containerData.getBytesUsed() /
|
||||
StorageUnit.GB.toBytes(containerData.getMaxSizeGB());
|
||||
if (containerUsedPercentage >= containerCloseThreshold) {
|
||||
|
||||
ContainerInfo containerInfo = ContainerInfo.newBuilder()
|
||||
.setContainerID(containerData.getContainerID())
|
||||
.setReadCount(containerData.getReadCount())
|
||||
.setWriteCount(containerData.getWriteCount())
|
||||
.setReadBytes(containerData.getReadBytes())
|
||||
.setWriteBytes(containerData.getWriteBytes())
|
||||
.setUsed(containerData.getBytesUsed())
|
||||
.setState(HddsProtos.LifeCycleState.OPEN)
|
||||
.build();
|
||||
|
||||
ContainerAction action = ContainerAction.newBuilder()
|
||||
.setContainer(containerInfo)
|
||||
.setContainerID(containerData.getContainerID())
|
||||
.setAction(ContainerAction.Action.CLOSE)
|
||||
.setReason(ContainerAction.Reason.CONTAINER_FULL)
|
||||
.build();
|
||||
|
@ -157,7 +157,7 @@ message ContainerAction {
|
||||
CONTAINER_FULL = 1;
|
||||
}
|
||||
|
||||
required ContainerInfo container = 1;
|
||||
required int64 containerID = 1;
|
||||
required Action action = 2;
|
||||
optional Reason reason = 3;
|
||||
}
|
||||
|
@ -289,10 +289,7 @@ private HeartbeatEndpointTask getHeartbeatEndpointTask(
|
||||
|
||||
private ContainerAction getContainerAction() {
|
||||
ContainerAction.Builder builder = ContainerAction.newBuilder();
|
||||
ContainerInfo containerInfo = ContainerInfo.newBuilder()
|
||||
.setContainerID(1L)
|
||||
.build();
|
||||
builder.setContainer(containerInfo)
|
||||
builder.setContainerID(1L)
|
||||
.setAction(ContainerAction.Action.CLOSE)
|
||||
.setReason(ContainerAction.Reason.CONTAINER_FULL);
|
||||
return builder.build();
|
||||
|
Loading…
Reference in New Issue
Block a user