diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/bucket/OMBucketDeleteResponse.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/bucket/OMBucketDeleteResponse.java index 0079851d2a..0e0b3982bb 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/bucket/OMBucketDeleteResponse.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/bucket/OMBucketDeleteResponse.java @@ -25,7 +25,6 @@ import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos; import org.apache.hadoop.hdds.utils.db.BatchOperation; -import javax.annotation.Nullable; import javax.annotation.Nonnull; /** diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMKeyCommitResponse.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMKeyCommitResponse.java index 0592bae487..0eb97f326a 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMKeyCommitResponse.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMKeyCommitResponse.java @@ -36,7 +36,8 @@ public class OMKeyCommitResponse extends OMClientResponse { private OmKeyInfo omKeyInfo; private long openKeySessionID; - public OMKeyCommitResponse(@Nullable OmKeyInfo omKeyInfo, long openKeySessionID, + public OMKeyCommitResponse(@Nullable OmKeyInfo omKeyInfo, + long openKeySessionID, @Nonnull OzoneManagerProtocolProtos.OMResponse omResponse) { super(omResponse); this.omKeyInfo = omKeyInfo; diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMKeyDeleteResponse.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMKeyDeleteResponse.java index b9b5f79754..1a8ce1b3a8 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMKeyDeleteResponse.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMKeyDeleteResponse.java @@ -38,8 +38,8 @@ public class OMKeyDeleteResponse extends OMClientResponse { private OmKeyInfo omKeyInfo; - - public OMKeyDeleteResponse(@Nullable OmKeyInfo omKeyInfo, @Nonnull OMResponse omResponse) { + public OMKeyDeleteResponse(@Nullable OmKeyInfo omKeyInfo, + @Nonnull OMResponse omResponse) { super(omResponse); this.omKeyInfo = omKeyInfo; } @@ -69,7 +69,7 @@ public void addToDBBatch(OMMetadataManager omMetadataManager, // instance in deletedTable. RepeatedOmKeyInfo repeatedOmKeyInfo = omMetadataManager.getDeletedTable().get(ozoneKey); - if(repeatedOmKeyInfo == null) { + if (repeatedOmKeyInfo == null) { repeatedOmKeyInfo = new RepeatedOmKeyInfo(omKeyInfo); } else { repeatedOmKeyInfo.addOmKeyInfo(omKeyInfo); @@ -83,10 +83,14 @@ public void addToDBBatch(OMMetadataManager omMetadataManager, /** * Check if the key is empty or not. Key will be empty if it does not have * blocks. + * * @param keyInfo * @return if empty true, else false. */ private boolean isKeyEmpty(@Nullable OmKeyInfo keyInfo) { + if (keyInfo == null) { + return true; + } for (OmKeyLocationInfoGroup keyLocationList : keyInfo .getKeyLocationVersions()) { if (keyLocationList.getLocationList().size() != 0) { diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMKeyPurgeResponse.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMKeyPurgeResponse.java index d71068ad52..513b94d29a 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMKeyPurgeResponse.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMKeyPurgeResponse.java @@ -36,7 +36,8 @@ public class OMKeyPurgeResponse extends OMClientResponse { private List purgeKeyList; - public OMKeyPurgeResponse(List keyList, @Nonnull OMResponse omResponse) { + public OMKeyPurgeResponse(List keyList, + @Nonnull OMResponse omResponse) { super(omResponse); this.purgeKeyList = keyList; } diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMKeyRenameResponse.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMKeyRenameResponse.java index 3800cdd294..0e9ae17577 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMKeyRenameResponse.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/key/OMKeyRenameResponse.java @@ -39,8 +39,8 @@ public class OMKeyRenameResponse extends OMClientResponse { private final String toKeyName; private final String fromKeyName; - public OMKeyRenameResponse(@Nullable OmKeyInfo renameKeyInfo, String toKeyName, - String fromKeyName, @Nonnull OMResponse omResponse) { + public OMKeyRenameResponse(@Nullable OmKeyInfo renameKeyInfo, + String toKeyName, String fromKeyName, @Nonnull OMResponse omResponse) { super(omResponse); this.renameKeyInfo = renameKeyInfo; this.toKeyName = toKeyName; diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/s3/multipart/S3MultipartUploadAbortResponse.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/s3/multipart/S3MultipartUploadAbortResponse.java index cabbfd2163..4fd270a8c6 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/s3/multipart/S3MultipartUploadAbortResponse.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/s3/multipart/S3MultipartUploadAbortResponse.java @@ -45,7 +45,8 @@ public class S3MultipartUploadAbortResponse extends OMClientResponse { private OmMultipartKeyInfo omMultipartKeyInfo; public S3MultipartUploadAbortResponse(String multipartKey, - @Nullable OmMultipartKeyInfo omMultipartKeyInfo, @Nonnull OMResponse omResponse) { + @Nullable OmMultipartKeyInfo omMultipartKeyInfo, + @Nonnull OMResponse omResponse) { super(omResponse); this.multipartKey = multipartKey; this.omMultipartKeyInfo = omMultipartKeyInfo;