diff --git a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/security/x509/certificate/CertInfo.java b/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/security/x509/certificate/CertInfo.java index 154f1c2d858..79f41fba865 100644 --- a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/security/x509/certificate/CertInfo.java +++ b/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/security/x509/certificate/CertInfo.java @@ -134,7 +134,6 @@ public String toString() { /** * Builder class for CertInfo. */ - @SuppressWarnings("checkstyle:hiddenfield") public static class Builder { private X509Certificate x509Certificate; private long timestamp; diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/upgrade/FinalizationManagerImpl.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/upgrade/FinalizationManagerImpl.java index a3ea5189c3d..520a550e293 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/upgrade/FinalizationManagerImpl.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/upgrade/FinalizationManagerImpl.java @@ -183,7 +183,6 @@ public void onLeaderReady() { /** * Builds a {@link FinalizationManagerImpl}. */ - @SuppressWarnings("checkstyle:hiddenfield") public static class Builder { private OzoneConfiguration conf; private HDDSLayoutVersionManager versionManager; @@ -196,14 +195,14 @@ public Builder() { executor = new DefaultUpgradeFinalizationExecutor<>(); } - public Builder setConfiguration(OzoneConfiguration conf) { - this.conf = conf; + public Builder setConfiguration(OzoneConfiguration configuration) { + this.conf = configuration; return this; } public Builder setLayoutVersionManager( - HDDSLayoutVersionManager versionManager) { - this.versionManager = versionManager; + HDDSLayoutVersionManager layoutVersionManager) { + this.versionManager = layoutVersionManager; return this; } @@ -212,8 +211,8 @@ public Builder setStorage(SCMStorageConfig storage) { return this; } - public Builder setHAManager(SCMHAManager scmHAManager) { - this.scmHAManager = scmHAManager; + public Builder setHAManager(SCMHAManager haManager) { + this.scmHAManager = haManager; return this; } @@ -224,8 +223,8 @@ public Builder setFinalizationStore( } public Builder setFinalizationExecutor( - UpgradeFinalizationExecutor executor) { - this.executor = executor; + UpgradeFinalizationExecutor finalizationExecutor) { + this.executor = finalizationExecutor; return this; } diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/upgrade/SCMUpgradeFinalizationContext.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/upgrade/SCMUpgradeFinalizationContext.java index 95c85a4c744..d166f8774f6 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/upgrade/SCMUpgradeFinalizationContext.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/upgrade/SCMUpgradeFinalizationContext.java @@ -80,7 +80,6 @@ public SCMStorageConfig getStorage() { /** * Builds an {@link SCMUpgradeFinalizationContext}. */ - @SuppressWarnings("checkstyle:hiddenfield") public static final class Builder { private PipelineManager pipelineManager; private NodeManager nodeManager; @@ -120,13 +119,13 @@ public Builder setStorage(SCMStorageConfig storage) { } public Builder setLayoutVersionManager( - HDDSLayoutVersionManager versionManager) { - this.versionManager = versionManager; + HDDSLayoutVersionManager layoutVersionManager) { + this.versionManager = layoutVersionManager; return this; } - public Builder setConfiguration(OzoneConfiguration conf) { - this.conf = conf; + public Builder setConfiguration(OzoneConfiguration configuration) { + this.conf = configuration; return this; } diff --git a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/TenantArgs.java b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/TenantArgs.java index eed7a6829c9..9a0083b0210 100644 --- a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/TenantArgs.java +++ b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/TenantArgs.java @@ -59,14 +59,13 @@ public boolean getForceCreationWhenVolumeExists() { * * @return Builder */ - public static TenantArgs.Builder newBuilder() { - return new TenantArgs.Builder(); + public static Builder newBuilder() { + return new Builder(); } /** * Builder for TenantArgs. */ - @SuppressWarnings("checkstyle:hiddenfield") public static class Builder { private String volumeName; private boolean forceCreationWhenVolumeExists; @@ -77,12 +76,12 @@ public static class Builder { public Builder() { } - public TenantArgs.Builder setVolumeName(String volumeName) { + public Builder setVolumeName(String volumeName) { this.volumeName = volumeName; return this; } - public TenantArgs.Builder setForceCreationWhenVolumeExists( + public Builder setForceCreationWhenVolumeExists( boolean forceCreationWhenVolumeExists) { this.forceCreationWhenVolumeExists = forceCreationWhenVolumeExists; return this; diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/DeleteTenantState.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/DeleteTenantState.java index 5fe53ee1ea3..1ffae273f0f 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/DeleteTenantState.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/DeleteTenantState.java @@ -66,7 +66,6 @@ public static DeleteTenantState.Builder newBuilder() { /** * Builder for TenantDeleted. */ - @SuppressWarnings("checkstyle:hiddenfield") public static final class Builder { private String volumeName; private long volRefCount; diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmDBAccessIdInfo.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmDBAccessIdInfo.java index 862cce21fe9..258aa1ace98 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmDBAccessIdInfo.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmDBAccessIdInfo.java @@ -112,7 +112,6 @@ public boolean getIsDelegatedAdmin() { /** * Builder for OmDBAccessIdInfo. */ - @SuppressWarnings("checkstyle:hiddenfield") public static final class Builder { private String tenantId; private String userPrincipal; diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmDBTenantState.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmDBTenantState.java index a1d51cab361..9aaf04f640b 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmDBTenantState.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmDBTenantState.java @@ -168,7 +168,6 @@ public static OmDBTenantState getFromProtobuf(TenantState proto) { /** * Builder for OmDBTenantState. */ - @SuppressWarnings("checkstyle:hiddenfield") public static final class Builder { private String tenantId; private String bucketNamespaceName; diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmDBUserPrincipalInfo.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmDBUserPrincipalInfo.java index 4d93fc54134..a511e2cb047 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmDBUserPrincipalInfo.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmDBUserPrincipalInfo.java @@ -90,7 +90,6 @@ public static OmDBUserPrincipalInfo getFromProtobuf( /** * Builder for OmDBUserPrincipalInfo. */ - @SuppressWarnings("checkstyle:hiddenfield") public static final class Builder { private Set accessIds; diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmRangerSyncArgs.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmRangerSyncArgs.java index fff6f38a37f..a09d5ef0902 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmRangerSyncArgs.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmRangerSyncArgs.java @@ -45,7 +45,6 @@ public static OmRangerSyncArgs.Builder newBuilder() { /** * Builder for OmRangerSyncArgs. */ - @SuppressWarnings("checkstyle:hiddenfield") public static class Builder { private long newServiceVersion; /** diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmTenantArgs.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmTenantArgs.java index bf331c48a14..bd1997641a7 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmTenantArgs.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmTenantArgs.java @@ -77,7 +77,6 @@ public static OmTenantArgs.Builder newBuilder() { /** * Builder for OmTenantArgs. */ - @SuppressWarnings("checkstyle:hiddenfield") public static class Builder { private String tenantId; private String volumeName; diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/S3VolumeContext.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/S3VolumeContext.java index dbbc3544765..4763c411934 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/S3VolumeContext.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/S3VolumeContext.java @@ -69,7 +69,6 @@ public static S3VolumeContext.Builder newBuilder() { /** * Builder for S3VolumeContext. */ - @SuppressWarnings("checkstyle:hiddenfield") public static final class Builder { private OmVolumeArgs omVolumeArgs; private String userPrincipal; diff --git a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/NodeEndpoint.java b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/NodeEndpoint.java index 717a9d74f74..543b8e388a9 100644 --- a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/NodeEndpoint.java +++ b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/NodeEndpoint.java @@ -152,28 +152,28 @@ public Response getDatanodes() { } }); try { - builder.withContainers(nodeManager.getContainerCount(datanode)); - builder.withOpenContainers(openContainers.get()); + builder.setContainers(nodeManager.getContainerCount(datanode)); + builder.setOpenContainers(openContainers.get()); } catch (NodeNotFoundException ex) { LOG.warn("Cannot get containers, datanode {} not found.", datanode.getUuid(), ex); } DatanodeInfo dnInfo = (DatanodeInfo) datanode; - datanodes.add(builder.withHostname(nodeManager.getHostName(datanode)) - .withDatanodeStorageReport(storageReport) - .withLastHeartbeat(nodeManager.getLastHeartbeat(datanode)) - .withState(nodeState) - .withOperationalState(nodeOpState) - .withPipelines(pipelines) - .withLeaderCount(leaderCount.get()) - .withUUid(datanode.getUuidString()) - .withVersion(nodeManager.getVersion(datanode)) - .withSetupTime(nodeManager.getSetupTime(datanode)) - .withRevision(nodeManager.getRevision(datanode)) - .withLayoutVersion( + datanodes.add(builder.setHostname(nodeManager.getHostName(datanode)) + .setDatanodeStorageReport(storageReport) + .setLastHeartbeat(nodeManager.getLastHeartbeat(datanode)) + .setState(nodeState) + .setOperationalState(nodeOpState) + .setPipelines(pipelines) + .setLeaderCount(leaderCount.get()) + .setUuid(datanode.getUuidString()) + .setVersion(nodeManager.getVersion(datanode)) + .setSetupTime(nodeManager.getSetupTime(datanode)) + .setRevision(nodeManager.getRevision(datanode)) + .setLayoutVersion( dnInfo.getLastKnownLayoutVersion().getMetadataLayoutVersion()) - .withNetworkLocation(datanode.getNetworkLocation()) + .setNetworkLocation(datanode.getNetworkLocation()) .build()); }); @@ -220,26 +220,26 @@ public Response removeDatanodes(List uuids) { try { if (preChecksSuccess(nodeByUuid, failedNodeErrorResponseMap)) { removedDatanodes.add(DatanodeMetadata.newBuilder() - .withHostname(nodeManager.getHostName(nodeByUuid)) - .withUUid(uuid) - .withState(nodeManager.getNodeStatus(nodeByUuid).getHealth()) + .setHostname(nodeManager.getHostName(nodeByUuid)) + .setUuid(uuid) + .setState(nodeManager.getNodeStatus(nodeByUuid).getHealth()) .build()); nodeManager.removeNode(nodeByUuid); LOG.info("Node {} removed successfully !!!", uuid); } else { failedDatanodes.add(DatanodeMetadata.newBuilder() - .withHostname(nodeManager.getHostName(nodeByUuid)) - .withUUid(uuid) - .withOperationalState(nodeByUuid.getPersistedOpState()) - .withState(nodeManager.getNodeStatus(nodeByUuid).getHealth()) + .setHostname(nodeManager.getHostName(nodeByUuid)) + .setUuid(uuid) + .setOperationalState(nodeByUuid.getPersistedOpState()) + .setState(nodeManager.getNodeStatus(nodeByUuid).getHealth()) .build()); } } catch (NodeNotFoundException nnfe) { LOG.error("Selected node {} not found : {} ", uuid, nnfe); notFoundDatanodes.add(DatanodeMetadata.newBuilder() - .withHostname("") - .withState(NodeState.DEAD) - .withUUid(uuid).build()); + .setHostname("") + .setState(NodeState.DEAD) + .setUuid(uuid).build()); } } } catch (Exception exp) { diff --git a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/AclMetadata.java b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/AclMetadata.java index fae47b3b368..51994abfbad 100644 --- a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/AclMetadata.java +++ b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/AclMetadata.java @@ -73,7 +73,6 @@ public static Builder newBuilder() { /** * Builder for AclMetadata. */ - @SuppressWarnings("checkstyle:hiddenfield") public static final class Builder { private String type; private String name; @@ -84,23 +83,23 @@ public Builder() { } - public Builder withType(String type) { + public Builder setType(String type) { this.type = type; return this; } - public Builder withName(String name) { + public Builder setName(String name) { this.name = name; return this; } - public Builder withScope(String scope) { + public Builder setScope(String scope) { this.scope = scope; return this; } - public Builder withAclList(List aclList) { + public Builder setAclList(List aclList) { this.aclList = aclList; return this; } @@ -127,10 +126,10 @@ public static AclMetadata fromOzoneAcl(OzoneAcl ozoneAcl) { AclMetadata.Builder builder = AclMetadata.newBuilder(); - return builder.withType(ozoneAcl.getType().toString().toUpperCase()) - .withName(ozoneAcl.getName()) - .withScope(ozoneAcl.getAclScope().toString().toUpperCase()) - .withAclList(ozoneAcl.getAclStringList()) + return builder.setType(ozoneAcl.getType().toString().toUpperCase()) + .setName(ozoneAcl.getName()) + .setScope(ozoneAcl.getAclScope().toString().toUpperCase()) + .setAclList(ozoneAcl.getAclStringList()) .build(); } } diff --git a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/ClusterStateResponse.java b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/ClusterStateResponse.java index 6e595891c4d..424584a2be4 100644 --- a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/ClusterStateResponse.java +++ b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/ClusterStateResponse.java @@ -138,7 +138,6 @@ private ClusterStateResponse(Builder b) { /** * Builder for ClusterStateResponse. */ - @SuppressWarnings("checkstyle:hiddenfield") public static final class Builder { private int pipelines; private int totalDatanodes; diff --git a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/DatanodeMetadata.java b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/DatanodeMetadata.java index ec7ab6cf8ee..ef64e921a31 100644 --- a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/DatanodeMetadata.java +++ b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/DatanodeMetadata.java @@ -182,7 +182,6 @@ public static Builder newBuilder() { /** * Builder for DatanodeMetadata. */ - @SuppressWarnings("checkstyle:hiddenfield") public static final class Builder { private String hostname; private String uuid; @@ -206,78 +205,78 @@ public Builder() { this.leaderCount = 0; } - public Builder withHostname(String hostname) { + public Builder setHostname(String hostname) { this.hostname = hostname; return this; } - public Builder withState(NodeState state) { + public Builder setState(NodeState state) { this.state = state; return this; } - public Builder withOperationalState(NodeOperationalState opState) { - this.opState = opState; + public Builder setOperationalState(NodeOperationalState operationalState) { + this.opState = operationalState; return this; } - public Builder withLastHeartbeat(long lastHeartbeat) { + public Builder setLastHeartbeat(long lastHeartbeat) { this.lastHeartbeat = lastHeartbeat; return this; } - public Builder withDatanodeStorageReport(DatanodeStorageReport + public Builder setDatanodeStorageReport(DatanodeStorageReport datanodeStorageReport) { this.datanodeStorageReport = datanodeStorageReport; return this; } - public Builder withPipelines(List pipelines) { + public Builder setPipelines(List pipelines) { this.pipelines = pipelines; return this; } - public Builder withContainers(int containers) { + public Builder setContainers(int containers) { this.containers = containers; return this; } - public Builder withOpenContainers(int openContainers) { + public Builder setOpenContainers(int openContainers) { this.openContainers = openContainers; return this; } - public Builder withLeaderCount(int leaderCount) { + public Builder setLeaderCount(int leaderCount) { this.leaderCount = leaderCount; return this; } - public Builder withUUid(String uuid) { + public Builder setUuid(String uuid) { this.uuid = uuid; return this; } - public Builder withVersion(String version) { + public Builder setVersion(String version) { this.version = version; return this; } - public Builder withSetupTime(long setupTime) { + public Builder setSetupTime(long setupTime) { this.setupTime = setupTime; return this; } - public Builder withRevision(String revision) { + public Builder setRevision(String revision) { this.revision = revision; return this; } - public Builder withLayoutVersion(int layoutVersion) { + public Builder setLayoutVersion(int layoutVersion) { this.layoutVersion = layoutVersion; return this; } - public Builder withNetworkLocation(String networkLocation) { + public Builder setNetworkLocation(String networkLocation) { this.networkLocation = networkLocation; return this; } diff --git a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/NamespaceSummaryResponse.java b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/NamespaceSummaryResponse.java index 5ccfd988731..ccbaa35788c 100644 --- a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/NamespaceSummaryResponse.java +++ b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/NamespaceSummaryResponse.java @@ -49,8 +49,8 @@ public class NamespaceSummaryResponse { * * @return Builder */ - public static NamespaceSummaryResponse.Builder newBuilder() { - return new NamespaceSummaryResponse.Builder(); + public static Builder newBuilder() { + return new Builder(); } public NamespaceSummaryResponse(Builder b) { @@ -104,7 +104,6 @@ public void setObjectDBInfo(ObjectDBInfo objectDBInfo) { /** * Builder for NamespaceSummaryResponse. */ - @SuppressWarnings("checkstyle:hiddenfield") public static final class Builder { private String path; private EntityType entityType; @@ -119,30 +118,30 @@ public Builder() { this.entityType = EntityType.ROOT; } - public NamespaceSummaryResponse.Builder setPath(String path) { + public Builder setPath(String path) { this.path = path; return this; } - public NamespaceSummaryResponse.Builder setEntityType( + public Builder setEntityType( EntityType entityType) { this.entityType = entityType; return this; } - public NamespaceSummaryResponse.Builder setCountStats( + public Builder setCountStats( CountStats countStats) { this.countStats = countStats; return this; } - public NamespaceSummaryResponse.Builder setObjectDBInfo( + public Builder setObjectDBInfo( ObjectDBInfo objectDBInfo) { this.objectDBInfo = objectDBInfo; return this; } - public NamespaceSummaryResponse.Builder setStatus( + public Builder setStatus( ResponseStatus status) { this.status = status; return this; diff --git a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/PipelineMetadata.java b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/PipelineMetadata.java index d26f87f6f78..2a2f223bb95 100644 --- a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/PipelineMetadata.java +++ b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/PipelineMetadata.java @@ -133,7 +133,6 @@ private PipelineMetadata(Builder b) { /** * Builder for PipelineMetadata. */ - @SuppressWarnings("checkstyle:hiddenfield") public static class Builder { private UUID pipelineId; private PipelineState status;