HDDS-2182. Fix checkstyle violations introduced by HDDS-1738

Closes #1529
This commit is contained in:
Vivek Ratnavel Subramanian 2019-09-26 12:09:28 +02:00 committed by Márton Elek
parent 587a8eeec8
commit 7b6219a8d1
No known key found for this signature in database
GPG Key ID: D51EA8F00EE79B28
6 changed files with 15 additions and 9 deletions

View File

@ -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;
/** /**

View File

@ -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;

View File

@ -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;
} }
@ -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) {

View File

@ -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;
} }

View File

@ -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;

View File

@ -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;