Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ public final class NetConstants {
private NetConstants() {
// Prevent instantiation
}
public final static char PATH_SEPARATOR = '/';
public static final char PATH_SEPARATOR = '/';
/** Path separator as a string. */
public final static String PATH_SEPARATOR_STR = "/";
public final static String SCOPE_REVERSE_STR = "~";
public static final String PATH_SEPARATOR_STR = "/";
public static final String SCOPE_REVERSE_STR = "~";
/** string representation of root. */
public final static String ROOT = "";
public final static int INNER_NODE_COST_DEFAULT = 1;
public final static int NODE_COST_DEFAULT = 0;
public final static int ANCESTOR_GENERATION_DEFAULT = 0;
public final static int ROOT_LEVEL = 1;
public final static String NODE_COST_PREFIX = "$";
public final static String DEFAULT_RACK = "/default-rack";
public final static String DEFAULT_NODEGROUP = "/default-nodegroup";
public final static String DEFAULT_DATACENTER = "/default-datacenter";
public final static String DEFAULT_REGION = "/default-dataregion";
public static final String ROOT = "";
public static final int INNER_NODE_COST_DEFAULT = 1;
public static final int NODE_COST_DEFAULT = 0;
public static final int ANCESTOR_GENERATION_DEFAULT = 0;
public static final int ROOT_LEVEL = 1;
public static final String NODE_COST_PREFIX = "$";
public static final String DEFAULT_RACK = "/default-rack";
public static final String DEFAULT_NODEGROUP = "/default-nodegroup";
public static final String DEFAULT_DATACENTER = "/default-datacenter";
public static final String DEFAULT_REGION = "/default-dataregion";

// Build-in network topology node schema
public static final NodeSchema ROOT_SCHEMA =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public final class NodeSchemaLoader {
private static final String LAYER_DEFAULT_NAME = "default";

private static final int LAYOUT_VERSION = 1;
private volatile static NodeSchemaLoader instance = null;
private static volatile NodeSchemaLoader instance = null;
private NodeSchemaLoader() {}

public static NodeSchemaLoader getInstance() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public final class NodeSchemaManager {
// max level, includes ROOT level
private int maxLevel = -1;

private volatile static NodeSchemaManager instance = null;
private static volatile NodeSchemaManager instance = null;

private NodeSchemaManager() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public final class OzoneConsts {

public static final String FILE_HASH = "SHA-256";
public static final String MD5_HASH = "MD5";
public final static String CHUNK_OVERWRITE = "OverWriteRequested";
public static final String CHUNK_OVERWRITE = "OverWriteRequested";

public static final int CHUNK_SIZE = 1 * 1024 * 1024; // 1 MB
public static final long KB = 1024L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ protected StorageInfo getStorageInfo() {
return storageInfo;
}

abstract protected Properties getNodeProperties();
protected abstract Properties getNodeProperties();

/**
* Sets the Node properties specific to OM/SCM.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
public final class VersionInfo {

// We will just be normal and use positive counting numbers for versions.
private final static VersionInfo[] VERSION_INFOS =
private static final VersionInfo[] VERSION_INFOS =
{new VersionInfo("First version of SCM", 1)};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
public final class DataNodeLayoutVersion {

// We will just be normal and use positive counting numbers for versions.
private final static DataNodeLayoutVersion[] VERSION_INFOS =
private static final DataNodeLayoutVersion[] VERSION_INFOS =
{new DataNodeLayoutVersion(1, "HDDS Datanode LayOut Version 1")};

private final String description;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,22 @@
public class StateContext {

@VisibleForTesting
final static String CONTAINER_REPORTS_PROTO_NAME =
static final String CONTAINER_REPORTS_PROTO_NAME =
ContainerReportsProto.getDescriptor().getFullName();
@VisibleForTesting
final static String NODE_REPORT_PROTO_NAME =
static final String NODE_REPORT_PROTO_NAME =
NodeReportProto.getDescriptor().getFullName();
@VisibleForTesting
final static String PIPELINE_REPORTS_PROTO_NAME =
static final String PIPELINE_REPORTS_PROTO_NAME =
PipelineReportsProto.getDescriptor().getFullName();
@VisibleForTesting
final static String COMMAND_STATUS_REPORTS_PROTO_NAME =
static final String COMMAND_STATUS_REPORTS_PROTO_NAME =
CommandStatusReportsProto.getDescriptor().getFullName();
@VisibleForTesting
final static String INCREMENTAL_CONTAINER_REPORT_PROTO_NAME =
static final String INCREMENTAL_CONTAINER_REPORT_PROTO_NAME =
IncrementalContainerReportProto.getDescriptor().getFullName();
// Accepted types of reports that can be queued to incrementalReportsQueue
private final static Set<String> ACCEPTED_INCREMENTAL_REPORT_TYPE_SET =
private static final Set<String> ACCEPTED_INCREMENTAL_REPORT_TYPE_SET =
Sets.newHashSet(COMMAND_STATUS_REPORTS_PROTO_NAME,
INCREMENTAL_CONTAINER_REPORT_PROTO_NAME);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public ContainerCacheMetrics getMetrics() {
* @param conf - Configuration.
* @return A instance of {@link ContainerCache}.
*/
public synchronized static ContainerCache getInstance(
public static synchronized ContainerCache getInstance(
ConfigurationSource conf) {
if (cache == null) {
int cacheSize = conf.getInt(OzoneConfigKeys.OZONE_CONTAINER_CACHE_SIZE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ public class BlockDeletingService extends BackgroundService {
private final int containerLimitPerInterval;

// Task priority is useful when a to-delete block has weight.
private final static int TASK_PRIORITY_DEFAULT = 1;
private static final int TASK_PRIORITY_DEFAULT = 1;
// Core pool size for container tasks
private final static int BLOCK_DELETING_SERVICE_CORE_POOL_SIZE = 10;
private static final int BLOCK_DELETING_SERVICE_CORE_POOL_SIZE = 10;

public BlockDeletingService(OzoneContainer ozoneContainer,
long serviceInterval, long serviceTimeout, TimeUnit timeUnit,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class TestHddsSecureDatanodeInit {
private static KeyCodec keyCodec;
private static CertificateCodec certCodec;
private static X509CertificateHolder certHolder;
private final static String DN_COMPONENT = DNCertificateClient.COMPONENT_NAME;
private static final String DN_COMPONENT = DNCertificateClient.COMPONENT_NAME;

@BeforeClass
public static void setUp() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class TestKeyValueHandler {
private static HddsDispatcher dispatcher;
private static KeyValueHandler handler;

private final static String DATANODE_UUID = UUID.randomUUID().toString();
private static final String DATANODE_UUID = UUID.randomUUID().toString();

private static final long DUMMY_CONTAINER_ID = 9999;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class TestKeyValueHandlerWithUnhealthyContainer {
public static final Logger LOG = LoggerFactory.getLogger(
TestKeyValueHandlerWithUnhealthyContainer.class);

private final static String DATANODE_UUID = UUID.randomUUID().toString();
private static final String DATANODE_UUID = UUID.randomUUID().toString();
private static final long DUMMY_CONTAINER_ID = 9999;

@Test
Expand Down
2 changes: 2 additions & 0 deletions hadoop-hdds/dev-support/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -200,5 +200,7 @@
<!--<module name="TodoComment"/>-->
<module name="UpperEll"/>

<module name="ModifierOrder"/>

</module>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class BlockTokenVerifier implements TokenVerifier {
private final CertificateClient caClient;
private final SecurityConfig conf;
private static boolean testStub = false;
private final static Logger LOGGER =
private static final Logger LOGGER =
LoggerFactory.getLogger(BlockTokenVerifier.class);

public BlockTokenVerifier(SecurityConfig conf, CertificateClient caClient) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@
* tools like OpenSSL can be used to read and decode these files.
*/
public class KeyCodec {
public final static String PRIVATE_KEY = "PRIVATE KEY";
public final static String PUBLIC_KEY = "PUBLIC KEY";
public final static Charset DEFAULT_CHARSET = StandardCharsets.UTF_8;
private final static Logger LOG =
public static final String PRIVATE_KEY = "PRIVATE KEY";
public static final String PUBLIC_KEY = "PUBLIC KEY";
public static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8;
private static final Logger LOG =
LoggerFactory.getLogger(KeyCodec.class);
private final Path location;
private final SecurityConfig securityConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class RocksDBStoreMBean implements DynamicMBean, MetricsSource {
private static final Logger LOG =
LoggerFactory.getLogger(RocksDBStoreMBean.class);

public final static String ROCKSDB_CONTEXT_PREFIX = "Rocksdb_";
public static final String ROCKSDB_CONTEXT_PREFIX = "Rocksdb_";

public RocksDBStoreMBean(Statistics statistics, String dbName) {
this.contextName = ROCKSDB_CONTEXT_PREFIX + dbName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class TypedTable<KEY, VALUE> implements Table<KEY, VALUE> {

private final TableCache<CacheKey<KEY>, CacheValue<VALUE>> cache;

private final static long EPOCH_DEFAULT = -1L;
private static final long EPOCH_DEFAULT = -1L;

/**
* Create an TypedTable from the raw table.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public class TestCertificateClientInit {
private KeyCodec dnKeyCodec;
private KeyCodec omKeyCodec;
private X509Certificate x509Certificate;
private final static String DN_COMPONENT = DNCertificateClient.COMPONENT_NAME;
private final static String OM_COMPONENT = OMCertificateClient.COMPONENT_NAME;
private static final String DN_COMPONENT = DNCertificateClient.COMPONENT_NAME;
private static final String OM_COMPONENT = OMCertificateClient.COMPONENT_NAME;

@Parameter
public boolean pvtKeyPresent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ public class TestDefaultCertificateClient {
private Path dnMetaDirPath;
private SecurityConfig omSecurityConfig;
private SecurityConfig dnSecurityConfig;
private final static String DN_COMPONENT = DNCertificateClient.COMPONENT_NAME;
private final static String OM_COMPONENT = OMCertificateClient.COMPONENT_NAME;
private static final String DN_COMPONENT = DNCertificateClient.COMPONENT_NAME;
private static final String OM_COMPONENT = OMCertificateClient.COMPONENT_NAME;
private KeyCodec omKeyCodec;
private KeyCodec dnKeyCodec;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
@RunWith(Parameterized.class)
public class TestMetadataStore {

private final static int MAX_GETRANGE_LENGTH = 100;
private static final int MAX_GETRANGE_LENGTH = 100;
private final String storeImpl;
@Rule
public ExpectedException expectedException = ExpectedException.none();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
* DBConf tests.
*/
public class TestDBConfigFromFile {
private final static String DB_FILE = "test.db";
private final static String INI_FILE = getOptionsFileNameFromDB(DB_FILE);
private static final String DB_FILE = "test.db";
private static final String INI_FILE = getOptionsFileNameFromDB(DB_FILE);
@Rule
public TemporaryFolder folder = new TemporaryFolder();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class SCMBlockDeletingService extends BackgroundService {
public static final Logger LOG =
LoggerFactory.getLogger(SCMBlockDeletingService.class);

private final static int BLOCK_DELETING_SERVICE_CORE_POOL_SIZE = 1;
private static final int BLOCK_DELETING_SERVICE_CORE_POOL_SIZE = 1;
private final DeletedBlockLog deletedBlockLog;
private final ContainerManager containerManager;
private final NodeManager nodeManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
*/
public final class ContainerReplica implements Comparable<ContainerReplica> {

final private ContainerID containerID;
final private ContainerReplicaProto.State state;
final private DatanodeDetails datanodeDetails;
final private UUID placeOfBirth;
private final ContainerID containerID;
private final ContainerReplicaProto.State state;
private final DatanodeDetails datanodeDetails;
private final UUID placeOfBirth;

private Long sequenceId;
final private long keyCount;
final private long bytesUsed;
private final long keyCount;
private final long bytesUsed;


private ContainerReplica(final ContainerID containerID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public class ContainerStateMap {
private static final Logger LOG =
LoggerFactory.getLogger(ContainerStateMap.class);

private final static NavigableSet<ContainerID> EMPTY_SET =
private static final NavigableSet<ContainerID> EMPTY_SET =
Collections.unmodifiableNavigableSet(new TreeSet<>());

private final ContainerAttribute<LifeCycleState> lifeCycleStateMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public class TestBlockManager {
private MockNodeManager nodeManager;
private SCMPipelineManager pipelineManager;
private BlockManagerImpl blockManager;
private final static long DEFAULT_BLOCK_SIZE = 128 * MB;
private static final long DEFAULT_BLOCK_SIZE = 128 * MB;
private static HddsProtos.ReplicationFactor factor;
private static HddsProtos.ReplicationType type;
private EventQueue eventQueue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
* Test Helper for testing container Mapping.
*/
public class MockNodeManager implements NodeManager {
public final static int NUM_PIPELINE_PER_METADATA_DISK = 2;
private final static NodeData[] NODES = {
public static final int NUM_PIPELINE_PER_METADATA_DISK = 2;
private static final NodeData[] NODES = {
new NodeData(10L * OzoneConsts.TB, OzoneConsts.GB),
new NodeData(64L * OzoneConsts.TB, 100 * OzoneConsts.GB),
new NodeData(128L * OzoneConsts.TB, 256 * OzoneConsts.GB),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
* Test Node Storage Map.
*/
public class TestSCMNodeStorageStatMap {
private final static int DATANODE_COUNT = 100;
private static final int DATANODE_COUNT = 100;
private final long capacity = 10L * OzoneConsts.GB;
private final long used = 2L * OzoneConsts.GB;
private final long remaining = capacity - used;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
* Test classes for Node2ContainerMap.
*/
public class TestNode2ContainerMap {
private final static int DATANODE_COUNT = 300;
private final static int CONTAINER_COUNT = 1000;
private static final int DATANODE_COUNT = 300;
private static final int CONTAINER_COUNT = 1000;
private final Map<UUID, TreeSet<ContainerID>> testData = new
ConcurrentHashMap<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public void testRackAwarenessNotEnabledWithFallBack() throws SCMException{
results.get(2).getNetworkLocation());
}

private final static Node[] NODES = new NodeImpl[] {
private static final Node[] NODES = new NodeImpl[] {
new NodeImpl("h1", "/r1", NetConstants.NODE_COST_DEFAULT),
new NodeImpl("h2", "/r1", NetConstants.NODE_COST_DEFAULT),
new NodeImpl("h3", "/r2", NetConstants.NODE_COST_DEFAULT),
Expand All @@ -297,7 +297,7 @@ public void testRackAwarenessNotEnabledWithFallBack() throws SCMException{
};

// 3 racks with single node.
private final static Node[] SINGLE_NODE_RACK = new NodeImpl[] {
private static final Node[] SINGLE_NODE_RACK = new NodeImpl[] {
new NodeImpl("h1", "/r1", NetConstants.NODE_COST_DEFAULT),
new NodeImpl("h2", "/r2", NetConstants.NODE_COST_DEFAULT),
new NodeImpl("h3", "/r3", NetConstants.NODE_COST_DEFAULT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ private OzonePBHelper() {
* This map should not be accessed directly. Used the getFixedByteString
* methods instead.
*/
private final static ConcurrentHashMap<Object, ByteString>
private static final ConcurrentHashMap<Object, ByteString>
FIXED_BYTESTRING_CACHE = new ConcurrentHashMap<>();

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
public class OzoneTokenIdentifier extends
AbstractDelegationTokenIdentifier {

public final static Text KIND_NAME = new Text("OzoneToken");
public static final Text KIND_NAME = new Text("OzoneToken");
private String omCertSerialId;
private Type tokenType;
private String awsAccessId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,5 +216,5 @@ public String getLongestPrefix(String path) {
// root of a radix tree has a name of "/" and may optionally has it value.
private RadixNode root;

private final static String PATH_DELIMITER = OzoneConsts.OZONE_URI_DELIMITER;
private static final String PATH_DELIMITER = OzoneConsts.OZONE_URI_DELIMITER;
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
* Tests OMFailoverProxyProvider failover behaviour.
*/
public class TestOMFailoverProxyProvider {
private final static String OM_SERVICE_ID = "om-service-test1";
private final static String NODE_ID_BASE_STR = "omNode-";
private final static String DUMMY_NODE_ADDR = "0.0.0.0:8080";
private static final String OM_SERVICE_ID = "om-service-test1";
private static final String NODE_ID_BASE_STR = "omNode-";
private static final String DUMMY_NODE_ADDR = "0.0.0.0:8080";
private OMFailoverProxyProvider provider;
private long waitBetweenRetries;
private int numNodes = 3;
Expand Down
Loading