Gargi-jais11 commented on code in PR #8932:
URL: https://github.com/apache/ozone/pull/8932#discussion_r2300614246
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueHandler.java:
##########
@@ -1338,30 +1338,30 @@ private boolean checkContainerClose(KeyValueContainer
kvContainer) {
@Override
public Container importContainer(ContainerData originalContainerData,
final InputStream rawContainerStream,
- final TarContainerPacker packer)
- throws IOException {
- Preconditions.checkState(originalContainerData instanceof
- KeyValueContainerData, "Should be KeyValueContainerData instance");
-
- KeyValueContainerData containerData = new KeyValueContainerData(
- (KeyValueContainerData) originalContainerData);
-
- KeyValueContainer container = new KeyValueContainer(containerData,
- conf);
+ final TarContainerPacker packer) throws IOException {
+ KeyValueContainer container = createNewContainer(originalContainerData);
HddsVolume targetVolume = originalContainerData.getVolume();
populateContainerPathFields(container, targetVolume);
container.importContainerData(rawContainerStream, packer);
- ContainerLogger.logImported(containerData);
+ ContainerLogger.logImported(container.getContainerData());
sendICR(container);
return container;
+ }
+ @Override
+ public Container importContainer(ContainerData targetTempContainerData)
throws IOException {
+ KeyValueContainer container = createNewContainer(targetTempContainerData);
+ HddsVolume targetVolume = targetTempContainerData.getVolume();
+ populateContainerPathFields(container, targetVolume);
+ container.importContainerData((KeyValueContainerData)
targetTempContainerData);
Review Comment:
We already support ContainerLogger after successful move operation of
container.
The `importContainer` call is its internal workflow of moving a container
from one disk to another on the same node. This point is not a perfect place
for **ContainerLogger** as even after import of container if some failure
happens then move operation is not successful.
The existing operational logging via **ContainerLogger.logMoveSuccess** is
the appropriate mechanism for recording this activity and there is no need of
**ContainerLogger or ICR** at this point.
https://github.com/apache/ozone/blob/00ca998a966d42487f816393a59db6d20a7ac387/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/diskbalancer/DiskBalancerService.java#L598-L611
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]