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
10 changes: 5 additions & 5 deletions dev-support/pmd/pmd-ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.io/ruleset_2_0_0.xsd">

<description>
PMD Ruleset for Apache Ozone
</description>
<description>
PMD Ruleset for Apache Ozone
</description>

<rule ref="category/java/bestpractices.xml/MissingOverride" />
<rule ref="category/java/bestpractices.xml/MissingOverride"/>

<exclude-pattern>.*/generated-sources/.*</exclude-pattern>
<exclude-pattern>.*/generated-sources/.*</exclude-pattern>
</ruleset>
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ public synchronized void setFailIndexes(Integer... fail) {
failIndexes.addAll(Arrays.asList(fail));
}

@Override
public synchronized BlockExtendedInputStream create(
ReplicationConfig repConfig,
BlockLocationInfo blockInfo, Pipeline pipeline,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ public synchronized List<TestBlockInputStream> getBlockStreams() {
return blockStreams;
}

@Override
public synchronized BlockExtendedInputStream create(
ReplicationConfig repConfig, BlockLocationInfo blockInfo,
Pipeline pipeline, Token<OzoneBlockTokenIdentifier> token,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public class TestBackgroundContainerDataScanner extends

private BackgroundContainerDataScanner scanner;

@Override
@BeforeEach
public void setup() {
super.setup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class TestBackgroundContainerMetadataScanner extends

private BackgroundContainerMetadataScanner scanner;

@Override
@BeforeEach
public void setup() {
super.setup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
public class TestOnDemandContainerDataScanner extends
TestContainerScannersAbstract {

@Override
@BeforeEach
public void setup() {
super.setup();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ protected OutputStream createSubject() {
getContainerId(), getBufferSize());
}

@Override
protected ByteString verifyPart(CopyContainerResponseProto response,
int expectedOffset, int size) {
assertEquals(getContainerId(), response.getContainerID());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ void usesCompression(CopyContainerCompression compression) throws Exception {
verify(getObserver()).onCompleted();
}

@Override
protected ByteString verifyPart(SendContainerRequest response,
int expectedOffset, int size) {
assertEquals(getContainerId(), response.getContainerID());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,22 @@ public void testGetCoderByNameWrong() {
@Test
public void testUpdateCoders() {
class RSUserDefinedIncorrectFactory implements RawErasureCoderFactory {
@Override
public RawErasureEncoder createEncoder(ECReplicationConfig coderOptions) {
return null;
}

@Override
public RawErasureDecoder createDecoder(ECReplicationConfig coderOptions) {
return null;
}

@Override
public String getCoderName() {
return "rs_java";
}

@Override
public String getCodecName() {
return ECReplicationConfig.EcCodec.RS.name().toLowerCase();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public void testCodingNegative6x3ErasingTooMany() {
testCodingWithErasingTooMany();
}

@Override
@Test
public void testCoding10x4ErasingD0P0() {
prepare(null, 10, 4, new int[] {0}, new int[] {0});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ public void addAction(UpgradeActionType type, UpgradeAction action) {
this.actions.put(type, action);
}

@Override
public Optional<? extends UpgradeAction> action(UpgradeActionType phase) {
return Optional.ofNullable(actions.get(phase));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ enum FailureService {
OZONE_MANAGER,
STORAGE_CONTAINER_MANAGER;

@Override
public String toString() {
switch (this) {
case DATANODE:
Expand Down Expand Up @@ -407,11 +408,13 @@ public Set<StorageContainerManager> scmToFail() {
return scms;
}

@Override
public void shutdownStorageContainerManager(StorageContainerManager scm) {
super.shutdownStorageContainerManager(scm);
failedScmSet.add(scm);
}

@Override
public StorageContainerManager restartStorageContainerManager(
StorageContainerManager scm, boolean waitForScm)
throws IOException, TimeoutException, InterruptedException,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ public void validateFailure(MiniOzoneChaosCluster cluster) {
*/
public static class StorageContainerManagerStartStopFailure
extends ScmFailures {
@Override
public void fail(MiniOzoneChaosCluster cluster) {
// Get the number of OzoneManager to fail in the cluster.
boolean shouldStop = cluster.shouldStopScm();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public void teardown() throws Exception {
* @return a path to use in the test
* @throws IOException failure to build the path name up.
*/
@Override
protected Path methodPath() throws IOException {
return path(getMethodName());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ public void testListFilesRecursive() throws Exception {
/**
* Case-2) Cannot rename a directory to its own subdirectory.
*/
@Override
@Test
public void testRenameDirToItsOwnSubDir() throws Exception {
final String root = "/root";
Expand All @@ -262,6 +263,7 @@ public void testRenameDirToItsOwnSubDir() throws Exception {
* is not yet supported.
* Fails if the (a) parent of dst does not exist or (b) parent is a file.
*/
@Override
@Test
public void testRenameDestinationParentDoesntExist() throws Exception {
final String root = "/root_dir";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ void restartHddsDatanode(DatanodeDetails dn, boolean waitForDatanode)
*/
void shutdown();

@Override
default void close() {
shutdown();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ public void shutdownHddsDatanode(DatanodeDetails dn) throws IOException {
shutdownHddsDatanode(getHddsDatanodeIndex(dn));
}

@Override
public String getClusterId() {
return scm.getClientProtocolServer().getScmInfo().getClusterId();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ public String getClusterId() {
.getClientProtocolServer().getScmInfo().getClusterId();
}

@Override
public StorageContainerManager getActiveSCM() {
for (StorageContainerManager scm : scmhaService.getServices()) {
if (scm.checkLeader()) {
Expand All @@ -267,6 +268,7 @@ public StorageContainerManager getActiveSCM() {
return null;
}

@Override
public void waitForSCMToBeReady()
throws TimeoutException, InterruptedException {
GenericTestUtils.waitFor(() -> {
Expand Down Expand Up @@ -1018,6 +1020,7 @@ public List<StorageContainerManager> getStorageContainerManagers() {
return new ArrayList<>(this.scmhaService.getServices());
}

@Override
public StorageContainerManager getStorageContainerManager() {
return getStorageContainerManagers().get(0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ public void testS3Auth() throws Exception {
public void testZReadKeyWithUnhealthyContainerReplica() {
}

@Override
@Test
public void testGetServerDefaults() throws IOException {
assertNotNull(getClient().getProxy().getServerDefaults());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
public class TestHadoopDirTreeGeneratorWithFSO
extends TestHadoopDirTreeGenerator {

@Override
protected OzoneConfiguration getOzoneConfiguration() {
OzoneConfiguration conf = new OzoneConfiguration();
OMRequestTestUtils.configureFSOptimizedPaths(conf, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,17 @@ private void setupRangerIgnoreServerCertificate() {
// Create a trust manager that does not validate certificate chains
TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
@Override
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}

@Override
public void checkClientTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
}

@Override
public void checkServerTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public abstract class AbstractContractDistCpTest
* are allowed to take time, especially to remote stores.
* @return the current test timeout
*/
@Override
protected int getTestTimeoutMillis() {
return 15 * 60 * 1000;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,25 @@ public void reset() throws IOException {
init();
}

@Override
@VisibleForTesting
public void setException(Throwable e) {
ex = e;
}

@Override
@VisibleForTesting
public Throwable getException() {
return ex;
}

@Override
@VisibleForTesting
public void setType(ContainerProtos.Type type) {
this.type = type;
}

@Override
@VisibleForTesting
public ContainerProtos.Type getType() {
return type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
/** Test Ozone with non-HA cluster. */
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public class TestOzoneIntegrationNonHA extends NonHATests {
@Override
protected MiniOzoneCluster createCluster() throws Exception {
return newClusterBuilder()
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public void toAndFromPersistedFormat() throws Exception {
assertEquals(transactionInfo, convertedTransactionInfo);
}

@Override
@Test
public void testInvalidProtocolBuffer() {
IllegalArgumentException ex = assertThrows(IllegalArgumentException.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ private OMBucketCreateRequest doPreExecute(String volumeName,
return new OMBucketCreateRequest(modifiedRequest);
}

@Override
protected void doValidateAndUpdateCache(String volumeName, String bucketName,
OMRequest modifiedRequest) throws Exception {
String bucketKey = omMetadataManager.getBucketKey(volumeName, bucketName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
*/
public class TestOMFileCreateRequestWithFSO extends TestOMFileCreateRequest {

@Override
@Test
public void testValidateAndUpdateCacheWithNonRecursive() throws Exception {
testNonRecursivePath(UUID.randomUUID().toString(), false, false, false);
Expand Down Expand Up @@ -76,6 +77,7 @@ public void testValidateAndUpdateCacheWithNonRecursive() throws Exception {
testNonRecursivePath("a/b/e", false, false, false);
}

@Override
@Test
public void testValidateAndUpdateCacheWithNamespaceQuotaExceeded()
throws Exception {
Expand All @@ -100,6 +102,7 @@ public void testValidateAndUpdateCacheWithNamespaceQuotaExceeded()
OzoneManagerProtocolProtos.Status.QUOTA_EXCEEDED);
}

@Override
@Test
public void testValidateAndUpdateCacheWithRecursiveAndOverWrite()
throws Exception {
Expand Down Expand Up @@ -129,6 +132,7 @@ public void testValidateAndUpdateCacheWithRecursiveAndOverWrite()
testNonRecursivePath(key, false, true, true);
}

@Override
@Test
public void testValidateAndUpdateCacheWithNonRecursiveAndOverWrite()
throws Exception {
Expand Down Expand Up @@ -159,6 +163,7 @@ public void testValidateAndUpdateCacheWithNonRecursiveAndOverWrite()
testNonRecursivePath(key, false, false, true);
}

@Override
@Test
public void testCreateFileInheritParentDefaultAcls()
throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
*/
public class TestOMKeyAclRequestWithFSO extends TestOMKeyAclRequest {

@Override
protected String addKeyToTable() throws Exception {
String parentDir = "c/d/e";
String fileName = "file1";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,14 @@ protected String addKeyToOpenKeyTable(List<OmKeyLocationInfo> locationList)
return addKeyToOpenKeyTable(locationList, omKeyInfoFSO);
}

@Override
@Nonnull
protected OMKeyCommitRequest getOmKeyCommitRequest(OMRequest omRequest) {
return new OMKeyCommitRequestWithFSO(omRequest,
BucketLayout.FILE_SYSTEM_OPTIMIZED);
}

@Override
public BucketLayout getBucketLayout() {
return BucketLayout.FILE_SYSTEM_OPTIMIZED;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public void testDirSetTimesRequest() throws Exception {
* Verify that setTimes() on key works as expected.
* @throws Exception
*/
@Override
@Test
public void testKeySetTimesRequest() throws Exception {
OMRequestTestUtils.addVolumeAndBucketToDB(volumeName, bucketName,
Expand Down Expand Up @@ -105,6 +106,7 @@ public void testKeySetTimesRequest() throws Exception {
assertEquals(mtime, keyMtime);
}

@Override
protected String addKeyToTable() throws Exception {
String key = PARENT_DIR + "/" + FILE_NAME;
keyName = key; // updated key name
Expand Down Expand Up @@ -132,6 +134,7 @@ protected String addKeyToTable() throws Exception {
volumeId, bucketId, omKeyInfo.getParentObjectID(), FILE_NAME);
}

@Override
protected OMKeySetTimesRequest getOmKeySetTimesRequest(
OMRequest setTimesRequest) {
return new OMKeySetTimesRequestWithFSO(setTimesRequest, getBucketLayout());
Expand Down
Loading