adoroszlai commented on a change in pull request #649: HDDS-3120. Freon work
with OM HA.
URL: https://github.com/apache/hadoop-ozone/pull/649#discussion_r389915796
##########
File path:
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/BaseFreonGenerator.java
##########
@@ -374,53 +369,45 @@ public String generateObjectName(long counter) {
/**
* Create missing target volume/bucket.
*/
- public void ensureVolumeAndBucketExist(OzoneConfiguration ozoneConfiguration,
+ public void ensureVolumeAndBucketExist(OzoneClient rpcClient,
String volumeName, String bucketName) throws IOException {
- try (OzoneClient rpcClient = OzoneClientFactory
- .getRpcClient(ozoneConfiguration)) {
-
- OzoneVolume volume = null;
- try {
+ OzoneVolume volume = null;
+ try {
+ volume = rpcClient.getObjectStore().getVolume(volumeName);
+ } catch (OMException ex) {
+ if (ex.getResult() == ResultCodes.VOLUME_NOT_FOUND) {
+ rpcClient.getObjectStore().createVolume(volumeName);
volume = rpcClient.getObjectStore().getVolume(volumeName);
- } catch (OMException ex) {
- if (ex.getResult() == ResultCodes.VOLUME_NOT_FOUND) {
- rpcClient.getObjectStore().createVolume(volumeName);
- volume = rpcClient.getObjectStore().getVolume(volumeName);
- } else {
- throw ex;
- }
+ } else {
+ throw ex;
Review comment:
Now that `rpcClient` is passed as a parameter, can we merge this block and
`ensureVolumeExists`?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]