HDDS-2182. Fix checkstyle violations introduced by HDDS-1738
Closes #1529
This commit is contained in:
parent
587a8eeec8
commit
7b6219a8d1
@ -25,7 +25,6 @@
|
|||||||
import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos;
|
import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos;
|
||||||
import org.apache.hadoop.hdds.utils.db.BatchOperation;
|
import org.apache.hadoop.hdds.utils.db.BatchOperation;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -36,7 +36,8 @@ public class OMKeyCommitResponse extends OMClientResponse {
|
|||||||
private OmKeyInfo omKeyInfo;
|
private OmKeyInfo omKeyInfo;
|
||||||
private long openKeySessionID;
|
private long openKeySessionID;
|
||||||
|
|
||||||
public OMKeyCommitResponse(@Nullable OmKeyInfo omKeyInfo, long openKeySessionID,
|
public OMKeyCommitResponse(@Nullable OmKeyInfo omKeyInfo,
|
||||||
|
long openKeySessionID,
|
||||||
@Nonnull OzoneManagerProtocolProtos.OMResponse omResponse) {
|
@Nonnull OzoneManagerProtocolProtos.OMResponse omResponse) {
|
||||||
super(omResponse);
|
super(omResponse);
|
||||||
this.omKeyInfo = omKeyInfo;
|
this.omKeyInfo = omKeyInfo;
|
||||||
|
@ -38,8 +38,8 @@
|
|||||||
public class OMKeyDeleteResponse extends OMClientResponse {
|
public class OMKeyDeleteResponse extends OMClientResponse {
|
||||||
private OmKeyInfo omKeyInfo;
|
private OmKeyInfo omKeyInfo;
|
||||||
|
|
||||||
|
public OMKeyDeleteResponse(@Nullable OmKeyInfo omKeyInfo,
|
||||||
public OMKeyDeleteResponse(@Nullable OmKeyInfo omKeyInfo, @Nonnull OMResponse omResponse) {
|
@Nonnull OMResponse omResponse) {
|
||||||
super(omResponse);
|
super(omResponse);
|
||||||
this.omKeyInfo = omKeyInfo;
|
this.omKeyInfo = omKeyInfo;
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ public void addToDBBatch(OMMetadataManager omMetadataManager,
|
|||||||
// instance in deletedTable.
|
// instance in deletedTable.
|
||||||
RepeatedOmKeyInfo repeatedOmKeyInfo =
|
RepeatedOmKeyInfo repeatedOmKeyInfo =
|
||||||
omMetadataManager.getDeletedTable().get(ozoneKey);
|
omMetadataManager.getDeletedTable().get(ozoneKey);
|
||||||
if(repeatedOmKeyInfo == null) {
|
if (repeatedOmKeyInfo == null) {
|
||||||
repeatedOmKeyInfo = new RepeatedOmKeyInfo(omKeyInfo);
|
repeatedOmKeyInfo = new RepeatedOmKeyInfo(omKeyInfo);
|
||||||
} else {
|
} else {
|
||||||
repeatedOmKeyInfo.addOmKeyInfo(omKeyInfo);
|
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
|
* Check if the key is empty or not. Key will be empty if it does not have
|
||||||
* blocks.
|
* blocks.
|
||||||
|
*
|
||||||
* @param keyInfo
|
* @param keyInfo
|
||||||
* @return if empty true, else false.
|
* @return if empty true, else false.
|
||||||
*/
|
*/
|
||||||
private boolean isKeyEmpty(@Nullable OmKeyInfo keyInfo) {
|
private boolean isKeyEmpty(@Nullable OmKeyInfo keyInfo) {
|
||||||
|
if (keyInfo == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
for (OmKeyLocationInfoGroup keyLocationList : keyInfo
|
for (OmKeyLocationInfoGroup keyLocationList : keyInfo
|
||||||
.getKeyLocationVersions()) {
|
.getKeyLocationVersions()) {
|
||||||
if (keyLocationList.getLocationList().size() != 0) {
|
if (keyLocationList.getLocationList().size() != 0) {
|
||||||
|
@ -36,7 +36,8 @@ public class OMKeyPurgeResponse extends OMClientResponse {
|
|||||||
|
|
||||||
private List<String> purgeKeyList;
|
private List<String> purgeKeyList;
|
||||||
|
|
||||||
public OMKeyPurgeResponse(List<String> keyList, @Nonnull OMResponse omResponse) {
|
public OMKeyPurgeResponse(List<String> keyList,
|
||||||
|
@Nonnull OMResponse omResponse) {
|
||||||
super(omResponse);
|
super(omResponse);
|
||||||
this.purgeKeyList = keyList;
|
this.purgeKeyList = keyList;
|
||||||
}
|
}
|
||||||
|
@ -39,8 +39,8 @@ public class OMKeyRenameResponse extends OMClientResponse {
|
|||||||
private final String toKeyName;
|
private final String toKeyName;
|
||||||
private final String fromKeyName;
|
private final String fromKeyName;
|
||||||
|
|
||||||
public OMKeyRenameResponse(@Nullable OmKeyInfo renameKeyInfo, String toKeyName,
|
public OMKeyRenameResponse(@Nullable OmKeyInfo renameKeyInfo,
|
||||||
String fromKeyName, @Nonnull OMResponse omResponse) {
|
String toKeyName, String fromKeyName, @Nonnull OMResponse omResponse) {
|
||||||
super(omResponse);
|
super(omResponse);
|
||||||
this.renameKeyInfo = renameKeyInfo;
|
this.renameKeyInfo = renameKeyInfo;
|
||||||
this.toKeyName = toKeyName;
|
this.toKeyName = toKeyName;
|
||||||
|
@ -45,7 +45,8 @@ public class S3MultipartUploadAbortResponse extends OMClientResponse {
|
|||||||
private OmMultipartKeyInfo omMultipartKeyInfo;
|
private OmMultipartKeyInfo omMultipartKeyInfo;
|
||||||
|
|
||||||
public S3MultipartUploadAbortResponse(String multipartKey,
|
public S3MultipartUploadAbortResponse(String multipartKey,
|
||||||
@Nullable OmMultipartKeyInfo omMultipartKeyInfo, @Nonnull OMResponse omResponse) {
|
@Nullable OmMultipartKeyInfo omMultipartKeyInfo,
|
||||||
|
@Nonnull OMResponse omResponse) {
|
||||||
super(omResponse);
|
super(omResponse);
|
||||||
this.multipartKey = multipartKey;
|
this.multipartKey = multipartKey;
|
||||||
this.omMultipartKeyInfo = omMultipartKeyInfo;
|
this.omMultipartKeyInfo = omMultipartKeyInfo;
|
||||||
|
Loading…
Reference in New Issue
Block a user