Gargi-jais11 commented on PR #8915:
URL: https://github.com/apache/ozone/pull/8915#issuecomment-3318510922
2. > Another way is to get the container's size in
ReplicateContainerCommandHandler#handle and use a setter to set that in
ReplicationTask.
- Need to get Container Size using `ReplicateContainerCommandHandler` using
the **OzoneContainer** instance already present and set it for **ReplicateTask**
- Create setter and getter for containerSize in **ReplicateTask** and use
this in `PushReplicator` to get size in it.
```
public void replicate(ReplicationTask task) {
// rest code....
try {
Long containerSize = task.getContainerSize();
output = new CountingOutputStream(
uploader.startUpload(containerID, target, fut, compression,
containerSize));
......
}
```
- This causes interface modification of **ContainerUploader#startUpload** to
include containerSize.
- Then we can use this containerSize in the **startupload** method in
**GrpcContainerUploader** and after that it follows the same way as above
approach.
So this approach adds 3 steps extra which can be avoided. And for this we
need to add multiple test cases for PushReplicator class as well.
--
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]