From 679415fb0af5c98a49b714eae04aa1caab4dd81e Mon Sep 17 00:00:00 2001 From: Chia-Chuan Yu Date: Sun, 27 Apr 2025 19:21:40 +0800 Subject: [PATCH 01/26] HDDS-12575. Set default JUnit5 timeout via property --- .../test/resources/junit-platform.properties | 18 ++++++++++++++++++ .../test/resources/junit-platform.properties | 18 ++++++++++++++++++ .../test/resources/junit-platform.properties | 18 ++++++++++++++++++ .../test/resources/junit-platform.properties | 18 ++++++++++++++++++ .../test/resources/junit-platform.properties | 18 ++++++++++++++++++ .../test/resources/junit-platform.properties | 18 ++++++++++++++++++ .../test/resources/junit-platform.properties | 18 ++++++++++++++++++ .../test/resources/junit-platform.properties | 18 ++++++++++++++++++ .../test/resources/junit-platform.properties | 18 ++++++++++++++++++ .../test/resources/junit-platform.properties | 18 ++++++++++++++++++ .../test/resources/junit-platform.properties | 18 ++++++++++++++++++ .../test/resources/junit-platform.properties | 18 ++++++++++++++++++ .../test/resources/junit-platform.properties | 18 ++++++++++++++++++ .../test/resources/junit-platform.properties | 18 ++++++++++++++++++ .../test/resources/junit-platform.properties | 18 ++++++++++++++++++ .../test/resources/junit-platform.properties | 18 ++++++++++++++++++ .../test/resources/junit-platform.properties | 18 ++++++++++++++++++ .../test/resources/junit-platform.properties | 18 ++++++++++++++++++ .../test/resources/junit-platform.properties | 18 ++++++++++++++++++ 19 files changed, 342 insertions(+) create mode 100644 hadoop-hdds/client/src/test/resources/junit-platform.properties create mode 100644 hadoop-hdds/common/src/test/resources/junit-platform.properties create mode 100644 hadoop-hdds/config/src/test/resources/junit-platform.properties create mode 100644 hadoop-hdds/container-service/src/test/resources/junit-platform.properties create mode 100644 hadoop-hdds/framework/src/test/resources/junit-platform.properties create mode 100644 hadoop-hdds/rocks-native/src/test/resources/junit-platform.properties create mode 100644 hadoop-hdds/rocksdb-checkpoint-differ/src/test/resources/junit-platform.properties create mode 100644 hadoop-hdds/server-scm/src/test/resources/junit-platform.properties create mode 100644 hadoop-hdds/test-utils/src/test/resources/junit-platform.properties create mode 100644 hadoop-ozone/common/src/test/resources/junit-platform.properties create mode 100644 hadoop-ozone/fault-injection-test/mini-chaos-tests/src/test/resources/junit-platform.properties create mode 100644 hadoop-ozone/httpfsgateway/src/test/resources/junit-platform.properties create mode 100644 hadoop-ozone/insight/src/test/resources/junit-platform.properties create mode 100644 hadoop-ozone/integration-test-s3/src/test/resources/junit-platform.properties create mode 100644 hadoop-ozone/integration-test/src/test/resources/junit-platform.properties create mode 100644 hadoop-ozone/ozone-manager/src/test/resources/junit-platform.properties create mode 100644 hadoop-ozone/ozonefs-common/src/test/resources/junit-platform.properties create mode 100644 hadoop-ozone/s3gateway/src/test/resources/junit-platform.properties create mode 100644 hadoop-ozone/tools/src/test/resources/junit-platform.properties diff --git a/hadoop-hdds/client/src/test/resources/junit-platform.properties b/hadoop-hdds/client/src/test/resources/junit-platform.properties new file mode 100644 index 000000000000..ae871152f910 --- /dev/null +++ b/hadoop-hdds/client/src/test/resources/junit-platform.properties @@ -0,0 +1,18 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-hdds/common/src/test/resources/junit-platform.properties b/hadoop-hdds/common/src/test/resources/junit-platform.properties new file mode 100644 index 000000000000..ae871152f910 --- /dev/null +++ b/hadoop-hdds/common/src/test/resources/junit-platform.properties @@ -0,0 +1,18 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-hdds/config/src/test/resources/junit-platform.properties b/hadoop-hdds/config/src/test/resources/junit-platform.properties new file mode 100644 index 000000000000..ae871152f910 --- /dev/null +++ b/hadoop-hdds/config/src/test/resources/junit-platform.properties @@ -0,0 +1,18 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-hdds/container-service/src/test/resources/junit-platform.properties b/hadoop-hdds/container-service/src/test/resources/junit-platform.properties new file mode 100644 index 000000000000..ae871152f910 --- /dev/null +++ b/hadoop-hdds/container-service/src/test/resources/junit-platform.properties @@ -0,0 +1,18 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-hdds/framework/src/test/resources/junit-platform.properties b/hadoop-hdds/framework/src/test/resources/junit-platform.properties new file mode 100644 index 000000000000..ae871152f910 --- /dev/null +++ b/hadoop-hdds/framework/src/test/resources/junit-platform.properties @@ -0,0 +1,18 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-hdds/rocks-native/src/test/resources/junit-platform.properties b/hadoop-hdds/rocks-native/src/test/resources/junit-platform.properties new file mode 100644 index 000000000000..ae871152f910 --- /dev/null +++ b/hadoop-hdds/rocks-native/src/test/resources/junit-platform.properties @@ -0,0 +1,18 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-hdds/rocksdb-checkpoint-differ/src/test/resources/junit-platform.properties b/hadoop-hdds/rocksdb-checkpoint-differ/src/test/resources/junit-platform.properties new file mode 100644 index 000000000000..ae871152f910 --- /dev/null +++ b/hadoop-hdds/rocksdb-checkpoint-differ/src/test/resources/junit-platform.properties @@ -0,0 +1,18 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-hdds/server-scm/src/test/resources/junit-platform.properties b/hadoop-hdds/server-scm/src/test/resources/junit-platform.properties new file mode 100644 index 000000000000..ae871152f910 --- /dev/null +++ b/hadoop-hdds/server-scm/src/test/resources/junit-platform.properties @@ -0,0 +1,18 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-hdds/test-utils/src/test/resources/junit-platform.properties b/hadoop-hdds/test-utils/src/test/resources/junit-platform.properties new file mode 100644 index 000000000000..ae871152f910 --- /dev/null +++ b/hadoop-hdds/test-utils/src/test/resources/junit-platform.properties @@ -0,0 +1,18 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-ozone/common/src/test/resources/junit-platform.properties b/hadoop-ozone/common/src/test/resources/junit-platform.properties new file mode 100644 index 000000000000..ae871152f910 --- /dev/null +++ b/hadoop-ozone/common/src/test/resources/junit-platform.properties @@ -0,0 +1,18 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-ozone/fault-injection-test/mini-chaos-tests/src/test/resources/junit-platform.properties b/hadoop-ozone/fault-injection-test/mini-chaos-tests/src/test/resources/junit-platform.properties new file mode 100644 index 000000000000..ae871152f910 --- /dev/null +++ b/hadoop-ozone/fault-injection-test/mini-chaos-tests/src/test/resources/junit-platform.properties @@ -0,0 +1,18 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-ozone/httpfsgateway/src/test/resources/junit-platform.properties b/hadoop-ozone/httpfsgateway/src/test/resources/junit-platform.properties new file mode 100644 index 000000000000..ae871152f910 --- /dev/null +++ b/hadoop-ozone/httpfsgateway/src/test/resources/junit-platform.properties @@ -0,0 +1,18 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-ozone/insight/src/test/resources/junit-platform.properties b/hadoop-ozone/insight/src/test/resources/junit-platform.properties new file mode 100644 index 000000000000..ae871152f910 --- /dev/null +++ b/hadoop-ozone/insight/src/test/resources/junit-platform.properties @@ -0,0 +1,18 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-ozone/integration-test-s3/src/test/resources/junit-platform.properties b/hadoop-ozone/integration-test-s3/src/test/resources/junit-platform.properties new file mode 100644 index 000000000000..ae871152f910 --- /dev/null +++ b/hadoop-ozone/integration-test-s3/src/test/resources/junit-platform.properties @@ -0,0 +1,18 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-ozone/integration-test/src/test/resources/junit-platform.properties b/hadoop-ozone/integration-test/src/test/resources/junit-platform.properties new file mode 100644 index 000000000000..ae871152f910 --- /dev/null +++ b/hadoop-ozone/integration-test/src/test/resources/junit-platform.properties @@ -0,0 +1,18 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-ozone/ozone-manager/src/test/resources/junit-platform.properties b/hadoop-ozone/ozone-manager/src/test/resources/junit-platform.properties new file mode 100644 index 000000000000..ae871152f910 --- /dev/null +++ b/hadoop-ozone/ozone-manager/src/test/resources/junit-platform.properties @@ -0,0 +1,18 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-ozone/ozonefs-common/src/test/resources/junit-platform.properties b/hadoop-ozone/ozonefs-common/src/test/resources/junit-platform.properties new file mode 100644 index 000000000000..ae871152f910 --- /dev/null +++ b/hadoop-ozone/ozonefs-common/src/test/resources/junit-platform.properties @@ -0,0 +1,18 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-ozone/s3gateway/src/test/resources/junit-platform.properties b/hadoop-ozone/s3gateway/src/test/resources/junit-platform.properties new file mode 100644 index 000000000000..ae871152f910 --- /dev/null +++ b/hadoop-ozone/s3gateway/src/test/resources/junit-platform.properties @@ -0,0 +1,18 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-ozone/tools/src/test/resources/junit-platform.properties b/hadoop-ozone/tools/src/test/resources/junit-platform.properties new file mode 100644 index 000000000000..ae871152f910 --- /dev/null +++ b/hadoop-ozone/tools/src/test/resources/junit-platform.properties @@ -0,0 +1,18 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +junit.jupiter.execution.timeout.default=5m From a4d0428598298e9f3da8cefcc7140131469cf78d Mon Sep 17 00:00:00 2001 From: Chia-Chuan Yu Date: Mon, 28 Apr 2025 18:21:48 +0800 Subject: [PATCH 02/26] Removed timeout annotations --- .../apache/hadoop/hdds/scm/client/TestHddsClientUtils.java | 2 -- .../hadoop/hdds/scm/net/TestNetworkTopologyImpl.java | 2 -- .../apache/hadoop/hdds/scm/net/TestNodeSchemaLoader.java | 2 -- .../apache/hadoop/hdds/scm/net/TestNodeSchemaManager.java | 2 -- .../apache/hadoop/hdds/scm/net/TestYamlSchemaLoader.java | 2 -- .../org/apache/hadoop/hdds/utils/TestResourceCache.java | 4 ---- .../org/apache/hadoop/ozone/common/TestChunkBuffer.java | 4 ---- .../ozone/container/common/TestBlockDeletingService.java | 2 -- .../ozone/container/common/helpers/TestBlockData.java | 2 -- .../container/common/impl/TestContainerPersistence.java | 2 -- .../ozone/container/common/interfaces/TestHandler.java | 2 -- .../commandhandler/TestDeleteBlocksCommandHandler.java | 2 -- .../container/common/volume/TestPeriodicVolumeChecker.java | 2 -- .../container/common/volume/TestStorageVolumeChecker.java | 2 -- .../ozone/container/common/volume/TestVolumeSet.java | 2 -- .../container/common/volume/TestVolumeSetDiskChecks.java | 2 -- .../keyvalue/TestKeyValueContainerMarkUnhealthy.java | 2 -- .../ozone/container/keyvalue/TestKeyValueHandler.java | 2 -- .../ozone/container/replication/TestPushReplicator.java | 2 -- .../replication/TestSimpleContainerDownloader.java | 2 -- .../org/apache/hadoop/hdds/scm/TestHddsServerUtil.java | 2 -- .../org/apache/hadoop/hdds/scm/TestHddsServerUtils.java | 2 -- .../org/apache/hadoop/hdds/scm/block/TestBlockManager.java | 4 ---- .../hdds/scm/container/balancer/TestContainerBalancer.java | 2 -- .../hadoop/hdds/scm/safemode/TestSCMSafeModeManager.java | 2 -- .../src/test/java/org/apache/hadoop/ozone/TestOmUtils.java | 2 -- .../hadoop/ozone/client/io/TestSelectorOutputStream.java | 2 -- .../apache/hadoop/ozone/om/lock/TestOzoneManagerLock.java | 2 -- .../org/apache/hadoop/ozone/s3/awssdk/v1/TestS3SDKV1.java | 2 -- .../ozone/s3/awssdk/v1/TestS3SDKV1WithRatisStreaming.java | 2 -- .../org/apache/hadoop/ozone/s3/awssdk/v2/TestS3SDKV2.java | 2 -- .../ozone/s3/awssdk/v2/TestS3SDKV2WithRatisStreaming.java | 2 -- .../fs/ozone/TestDirectoryDeletingServiceWithFSO.java | 2 -- .../test/java/org/apache/hadoop/fs/ozone/TestHSync.java | 2 -- .../java/org/apache/hadoop/fs/ozone/TestHSyncUpgrade.java | 2 -- .../java/org/apache/hadoop/fs/ozone/TestLeaseRecovery.java | 2 -- .../org/apache/hadoop/fs/ozone/TestOzoneFSInputStream.java | 2 -- .../hadoop/fs/ozone/TestOzoneFSWithObjectStoreCreate.java | 2 -- .../org/apache/hadoop/fs/ozone/TestOzoneFileChecksum.java | 2 -- .../apache/hadoop/fs/ozone/TestOzoneFileSystemMetrics.java | 2 -- .../hadoop/fs/ozone/TestOzoneFileSystemPrefixParser.java | 2 -- .../hadoop/fs/ozone/TestOzoneFileSystemWithStreaming.java | 2 -- .../java/org/apache/hadoop/fs/ozone/TestOzoneFsHAURLs.java | 2 -- .../org/apache/hadoop/fs/ozone/TestOzoneFsSnapshot.java | 2 -- .../org/apache/hadoop/fs/ozone/TestRootedDDSWithFSO.java | 2 -- .../test/java/org/apache/hadoop/fs/ozone/TestSafeMode.java | 2 -- .../org/apache/hadoop/hdds/scm/TestAllocateContainer.java | 2 -- .../java/org/apache/hadoop/hdds/scm/TestCommitInRatis.java | 2 -- .../apache/hadoop/hdds/scm/TestContainerOperations.java | 2 -- .../hadoop/hdds/scm/TestContainerReportWithKeys.java | 2 -- .../org/apache/hadoop/hdds/scm/TestContainerSmallFile.java | 2 -- .../hdds/scm/TestGetCommittedBlockLengthAndPutKey.java | 2 -- .../apache/hadoop/hdds/scm/TestRatisPipelineLeader.java | 5 ++--- .../apache/hadoop/hdds/scm/TestSCMDbCheckpointServlet.java | 2 -- .../hadoop/hdds/scm/TestSCMInstallSnapshotWithHA.java | 2 -- .../java/org/apache/hadoop/hdds/scm/TestSCMMXBean.java | 2 -- .../apache/hadoop/hdds/scm/TestSCMNodeManagerMXBean.java | 2 -- .../org/apache/hadoop/hdds/scm/TestSecretKeySnapshot.java | 2 -- .../java/org/apache/hadoop/hdds/scm/TestSecretKeysApi.java | 3 --- .../hadoop/hdds/scm/TestStorageContainerManager.java | 2 -- .../hadoop/hdds/scm/TestStorageContainerManagerHA.java | 2 -- .../scm/TestStorageContainerManagerHAWithAllRunning.java | 2 -- .../org/apache/hadoop/hdds/scm/TestXceiverClientGrpc.java | 4 ---- .../apache/hadoop/hdds/scm/TestXceiverClientManager.java | 2 -- .../apache/hadoop/hdds/scm/TestXceiverClientMetrics.java | 2 -- .../hdds/scm/container/TestScmApplyTransactionFailure.java | 2 -- .../container/metrics/TestSCMContainerManagerMetrics.java | 2 -- .../hadoop/hdds/scm/pipeline/TestLeaderChoosePolicy.java | 7 +++---- .../hadoop/hdds/scm/pipeline/TestNode2PipelineMap.java | 2 -- .../apache/hadoop/hdds/scm/pipeline/TestPipelineClose.java | 2 -- .../hdds/scm/pipeline/TestPipelineManagerMXBean.java | 2 -- .../scm/pipeline/TestRatisPipelineCreateAndDestroy.java | 7 +++---- .../scm/pipeline/TestSCMPipelineBytesWrittenMetrics.java | 2 -- .../hadoop/hdds/scm/pipeline/TestSCMPipelineMetrics.java | 2 -- .../apache/hadoop/hdds/scm/pipeline/TestSCMRestart.java | 2 -- .../apache/hadoop/hdds/scm/storage/TestCommitWatcher.java | 2 -- .../org/apache/hadoop/hdds/upgrade/TestHDDSUpgrade.java | 2 -- .../test/java/org/apache/hadoop/ozone/TestBlockTokens.java | 3 --- .../java/org/apache/hadoop/ozone/TestBlockTokensCLI.java | 3 --- .../hadoop/ozone/TestContainerBalancerOperations.java | 2 -- .../java/org/apache/hadoop/ozone/TestDelegationToken.java | 2 -- .../apache/hadoop/ozone/TestGetClusterTreeInformation.java | 2 -- .../java/org/apache/hadoop/ozone/TestMiniOzoneCluster.java | 6 ++---- .../java/org/apache/hadoop/ozone/TestOMSortDatanodes.java | 2 -- .../org/apache/hadoop/ozone/TestSecureOzoneCluster.java | 2 -- .../hadoop/ozone/admin/om/lease/TestLeaseRecoverer.java | 3 --- .../java/org/apache/hadoop/ozone/client/rpc/TestBCSID.java | 2 -- .../hadoop/ozone/client/rpc/TestBlockDataStreamOutput.java | 2 -- .../hadoop/ozone/client/rpc/TestBlockOutputStream.java | 2 -- .../client/rpc/TestBlockOutputStreamWithFailures.java | 2 -- .../client/rpc/TestCloseContainerHandlingByClient.java | 2 -- .../hadoop/ozone/client/rpc/TestContainerStateMachine.java | 2 -- .../client/rpc/TestContainerStateMachineFailureOnRead.java | 3 +-- .../client/rpc/TestContainerStateMachineFlushDelay.java | 2 -- .../ozone/client/rpc/TestContainerStateMachineStream.java | 2 -- .../ozone/client/rpc/TestDiscardPreallocatedBlocks.java | 2 -- .../ozone/client/rpc/TestFailureHandlingByClient.java | 2 -- .../client/rpc/TestFailureHandlingByClientFlushDelay.java | 2 -- .../ozone/client/rpc/TestHybridPipelineOnDatanode.java | 2 -- .../client/rpc/TestMultiBlockWritesWithDnFailures.java | 2 -- .../client/rpc/TestOzoneClientMultipartUploadWithFSO.java | 2 -- .../rpc/TestOzoneClientRetriesOnExceptionFlushDelay.java | 2 -- .../client/rpc/TestOzoneClientRetriesOnExceptions.java | 2 -- .../apache/hadoop/ozone/client/rpc/TestOzoneRpcClient.java | 2 -- .../apache/hadoop/ozone/client/rpc/TestReadRetries.java | 2 -- .../hadoop/ozone/container/TestContainerReplication.java | 2 -- .../commandhandler/TestCloseContainerHandler.java | 2 -- .../commandhandler/TestDeleteContainerHandler.java | 2 -- .../statemachine/commandhandler/TestFinalizeBlock.java | 2 -- .../commandhandler/TestRefreshVolumeUsageHandler.java | 2 -- .../ozone/container/metrics/TestContainerMetrics.java | 2 -- .../ozone/container/metrics/TestDatanodeQueueMetrics.java | 2 -- .../ozone/container/ozoneimpl/TestOzoneContainer.java | 2 -- .../container/ozoneimpl/TestOzoneContainerWithTLS.java | 2 -- .../container/ozoneimpl/TestSecureOzoneContainer.java | 2 -- .../container/replication/TestContainerReplication.java | 2 -- .../apache/hadoop/ozone/dn/ratis/TestDnRatisLogParser.java | 2 -- .../scanner/TestContainerScannerIntegrationAbstract.java | 2 -- .../dn/volume/TestDatanodeHddsVolumeFailureDetection.java | 2 -- .../dn/volume/TestDatanodeHddsVolumeFailureToleration.java | 2 -- .../ozone/freon/TestDataValidateWithDummyContainers.java | 3 --- .../freon/TestDataValidateWithSafeByteOperations.java | 3 --- .../freon/TestDataValidateWithUnsafeByteOperations.java | 3 --- .../ozone/freon/TestFreonWithDatanodeFastRestart.java | 2 -- .../apache/hadoop/ozone/freon/TestRandomKeyGenerator.java | 2 -- .../org/apache/hadoop/ozone/fsck/TestContainerMapper.java | 3 --- .../apache/hadoop/ozone/om/TestAddRemoveOzoneManager.java | 2 -- .../hadoop/ozone/om/TestBucketLayoutWithOlderClient.java | 2 -- .../java/org/apache/hadoop/ozone/om/TestBucketOwner.java | 2 -- .../org/apache/hadoop/ozone/om/TestKeyManagerImpl.java | 2 -- .../java/org/apache/hadoop/ozone/om/TestKeyPurging.java | 2 -- .../test/java/org/apache/hadoop/ozone/om/TestListKeys.java | 2 -- .../org/apache/hadoop/ozone/om/TestListKeysWithFSO.java | 2 -- .../java/org/apache/hadoop/ozone/om/TestListStatus.java | 2 -- .../apache/hadoop/ozone/om/TestOMBucketLayoutUpgrade.java | 2 -- .../apache/hadoop/ozone/om/TestOMDbCheckpointServlet.java | 2 -- .../org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java | 4 ---- .../hadoop/ozone/om/TestOMStartupWithBucketLayout.java | 2 -- .../java/org/apache/hadoop/ozone/om/TestObjectStore.java | 2 -- .../org/apache/hadoop/ozone/om/TestObjectStoreWithFSO.java | 2 -- .../hadoop/ozone/om/TestObjectStoreWithLegacyFS.java | 2 -- .../test/java/org/apache/hadoop/ozone/om/TestOmAcls.java | 2 -- .../org/apache/hadoop/ozone/om/TestOmBlockVersioning.java | 2 -- .../hadoop/ozone/om/TestOmContainerLocationCache.java | 2 -- .../test/java/org/apache/hadoop/ozone/om/TestOmInit.java | 2 -- .../java/org/apache/hadoop/ozone/om/TestOmMetrics.java | 2 -- .../hadoop/ozone/om/TestOzoneManagerConfiguration.java | 2 -- .../org/apache/hadoop/ozone/om/TestOzoneManagerHA.java | 2 -- .../hadoop/ozone/om/TestOzoneManagerListVolumes.java | 2 -- .../hadoop/ozone/om/TestOzoneManagerListVolumesSecure.java | 2 -- .../hadoop/ozone/om/TestOzoneManagerRestInterface.java | 2 -- .../apache/hadoop/ozone/om/TestOzoneManagerRestart.java | 2 -- .../hadoop/ozone/om/TestOzoneManagerRocksDBLogging.java | 2 -- .../apache/hadoop/ozone/om/TestRecursiveAclWithFSO.java | 2 -- .../java/org/apache/hadoop/ozone/om/TestScmSafeMode.java | 2 -- .../org/apache/hadoop/ozone/om/TestSecureOzoneManager.java | 2 -- .../hadoop/ozone/om/service/TestRangerBGSyncService.java | 2 -- .../hadoop/ozone/om/snapshot/TestOmSnapshotDisabled.java | 2 -- .../ozone/om/snapshot/TestOmSnapshotDisabledRestart.java | 2 -- .../hadoop/ozone/om/snapshot/TestOmSnapshotFileSystem.java | 2 -- .../ozone/om/snapshot/TestOmSnapshotFileSystemFso.java | 2 -- .../TestOmSnapshotFileSystemFsoWithLinkedBuckets.java | 2 -- .../ozone/om/snapshot/TestOmSnapshotFileSystemLegacy.java | 2 -- .../TestOmSnapshotFileSystemLegacyWithLinkedBuckets.java | 2 -- .../ozone/om/snapshot/TestOmSnapshotFsoWithNativeLib.java | 2 -- .../TestOmSnapshotFsoWithNativeLibWithLinkedBuckets.java | 2 -- .../om/snapshot/TestOmSnapshotFsoWithoutNativeLib.java | 2 -- ...TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets.java | 2 -- .../ozone/om/snapshot/TestOmSnapshotObjectStore.java | 2 -- .../TestOmSnapshotObjectStoreWithLinkedBuckets.java | 2 -- .../om/snapshot/TestOmSnapshotWithBucketLinkingLegacy.java | 2 -- .../snapshot/TestOmSnapshotWithoutBucketLinkingLegacy.java | 2 -- .../ozone/om/snapshot/TestOzoneManagerHASnapshot.java | 2 -- .../ozone/om/snapshot/TestOzoneManagerSnapshotAcl.java | 2 -- .../om/snapshot/TestOzoneManagerSnapshotProvider.java | 2 -- .../hadoop/ozone/om/snapshot/TestOzoneSnapshotRestore.java | 2 -- .../ozone/om/snapshot/TestSnapshotBackgroundServices.java | 2 -- .../TestSnapshotDeletingServiceIntegrationTest.java | 2 -- .../om/snapshot/TestSnapshotDirectoryCleaningService.java | 2 -- .../hadoop/ozone/parser/TestOzoneHARatisLogParser.java | 2 -- .../hadoop/ozone/recon/TestReconAndAdminContainerCLI.java | 2 -- .../apache/hadoop/ozone/recon/TestReconAsPassiveScm.java | 2 -- .../apache/hadoop/ozone/recon/TestReconScmSnapshot.java | 2 -- .../java/org/apache/hadoop/ozone/recon/TestReconTasks.java | 2 -- .../hadoop/ozone/recon/TestReconWithOzoneManager.java | 2 -- .../hadoop/ozone/recon/TestReconWithOzoneManagerFSO.java | 2 -- .../hadoop/ozone/recon/TestReconWithOzoneManagerHA.java | 2 -- .../hadoop/ozone/reconfig/ReconfigurationTestBase.java | 2 -- .../org/apache/hadoop/ozone/shell/TestNSSummaryAdmin.java | 2 -- .../apache/hadoop/ozone/shell/TestOzoneDatanodeShell.java | 2 -- .../org/apache/hadoop/ozone/shell/TestOzoneShellHA.java | 3 --- .../apache/hadoop/ozone/shell/TestOzoneTenantShell.java | 2 -- .../org/apache/hadoop/ozone/shell/TestReconfigShell.java | 2 -- .../ozone/shell/TestReplicationConfigPreference.java | 2 -- .../apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java | 2 -- .../TestOzoneManagerDoubleBufferWithDummyResponse.java | 2 -- .../ozone/om/ratis/TestOzoneManagerRatisRequest.java | 2 -- .../hadoop/ozone/om/service/TestCompactionService.java | 4 ---- .../hadoop/ozone/om/service/TestKeyDeletingService.java | 2 -- .../om/service/TestMultipartUploadCleanupService.java | 2 -- .../hadoop/ozone/om/service/TestOpenKeyCleanupService.java | 3 --- .../hadoop/ozone/protocolPB/TestGrpcOmTransport.java | 2 -- 202 files changed, 11 insertions(+), 433 deletions(-) diff --git a/hadoop-hdds/client/src/test/java/org/apache/hadoop/hdds/scm/client/TestHddsClientUtils.java b/hadoop-hdds/client/src/test/java/org/apache/hadoop/hdds/scm/client/TestHddsClientUtils.java index 8d0eae226c8a..df72218bb1d6 100644 --- a/hadoop-hdds/client/src/test/java/org/apache/hadoop/hdds/scm/client/TestHddsClientUtils.java +++ b/hadoop-hdds/client/src/test/java/org/apache/hadoop/hdds/scm/client/TestHddsClientUtils.java @@ -46,14 +46,12 @@ import org.apache.hadoop.ozone.OzoneConsts; import org.apache.hadoop.ozone.ha.ConfUtils; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * This test class verifies the parsing of SCM endpoint config settings. The * parsing logic is in * {@link org.apache.hadoop.hdds.scm.client.HddsClientUtils}. */ -@Timeout(300) public class TestHddsClientUtils { /** diff --git a/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/scm/net/TestNetworkTopologyImpl.java b/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/scm/net/TestNetworkTopologyImpl.java index f07f4ca408b8..be85104aa4b1 100644 --- a/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/scm/net/TestNetworkTopologyImpl.java +++ b/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/scm/net/TestNetworkTopologyImpl.java @@ -60,7 +60,6 @@ import org.apache.hadoop.hdds.scm.ScmConfigKeys; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -68,7 +67,6 @@ import org.slf4j.LoggerFactory; /** Test the network topology functions. */ -@Timeout(30) class TestNetworkTopologyImpl { private static final Logger LOG = LoggerFactory.getLogger( TestNetworkTopologyImpl.class); diff --git a/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/scm/net/TestNodeSchemaLoader.java b/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/scm/net/TestNodeSchemaLoader.java index ac7e6eeda8bb..e3645beb8b0b 100644 --- a/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/scm/net/TestNodeSchemaLoader.java +++ b/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/scm/net/TestNodeSchemaLoader.java @@ -26,13 +26,11 @@ import java.net.URL; import java.util.stream.Stream; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; /** Test the node schema loader. */ -@Timeout(2) public class TestNodeSchemaLoader { /** diff --git a/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/scm/net/TestNodeSchemaManager.java b/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/scm/net/TestNodeSchemaManager.java index 7115b006fa9a..58e86e5f5072 100644 --- a/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/scm/net/TestNodeSchemaManager.java +++ b/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/scm/net/TestNodeSchemaManager.java @@ -27,10 +27,8 @@ import org.apache.hadoop.hdds.conf.OzoneConfiguration; import org.apache.hadoop.hdds.scm.ScmConfigKeys; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** Test the node schema loader. */ -@Timeout(30) class TestNodeSchemaManager { private final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); diff --git a/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/scm/net/TestYamlSchemaLoader.java b/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/scm/net/TestYamlSchemaLoader.java index 12825cbada06..e370910be533 100644 --- a/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/scm/net/TestYamlSchemaLoader.java +++ b/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/scm/net/TestYamlSchemaLoader.java @@ -26,13 +26,11 @@ import java.io.FileNotFoundException; import java.util.stream.Stream; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; /** Test the node schema loader. */ -@Timeout(30) class TestYamlSchemaLoader { private final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); diff --git a/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/utils/TestResourceCache.java b/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/utils/TestResourceCache.java index 159e7a5b2978..4b6761b9bac7 100644 --- a/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/utils/TestResourceCache.java +++ b/hadoop-hdds/common/src/test/java/org/apache/hadoop/hdds/utils/TestResourceCache.java @@ -24,7 +24,6 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.function.Consumer; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test for ResourceCache. @@ -66,19 +65,16 @@ public void testResourceCache() throws InterruptedException { } @Test - @Timeout(5) public void testRemove() throws Exception { testRemove(cache -> cache.remove(2), 2); } @Test - @Timeout(5) public void testRemoveIf() throws Exception { testRemove(cache -> cache.removeIf(k -> k <= 2), 1, 2); } @Test - @Timeout(5) public void testClear() throws Exception { testRemove(Cache::clear, 1, 2, 3); } diff --git a/hadoop-hdds/common/src/test/java/org/apache/hadoop/ozone/common/TestChunkBuffer.java b/hadoop-hdds/common/src/test/java/org/apache/hadoop/ozone/common/TestChunkBuffer.java index 43aab09a7e9f..d8520bebb8ad 100644 --- a/hadoop-hdds/common/src/test/java/org/apache/hadoop/ozone/common/TestChunkBuffer.java +++ b/hadoop-hdds/common/src/test/java/org/apache/hadoop/ozone/common/TestChunkBuffer.java @@ -38,7 +38,6 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test {@link ChunkBuffer} implementations. @@ -59,7 +58,6 @@ public void after() throws Exception { } @Test - @Timeout(1) void testImplWithByteBuffer() throws IOException { runTestImplWithByteBuffer(1); runTestImplWithByteBuffer(1 << 10); @@ -77,7 +75,6 @@ private static void runTestImplWithByteBuffer(int n) throws IOException { } @Test - @Timeout(1) void testIncrementalChunkBuffer() throws IOException { runTestIncrementalChunkBuffer(1, 1); runTestIncrementalChunkBuffer(4, 8); @@ -98,7 +95,6 @@ private static void runTestIncrementalChunkBuffer(int increment, int n) throws I } @Test - @Timeout(1) void testImplWithList() throws IOException { runTestImplWithList(4, 8); runTestImplWithList(16, 1 << 10); diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/TestBlockDeletingService.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/TestBlockDeletingService.java index d97651822d2e..ad9251042886 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/TestBlockDeletingService.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/TestBlockDeletingService.java @@ -106,7 +106,6 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -114,7 +113,6 @@ /** * Tests to test block deleting service. */ -@Timeout(30) public class TestBlockDeletingService { private static final Logger LOG = LoggerFactory.getLogger(TestBlockDeletingService.class); diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/helpers/TestBlockData.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/helpers/TestBlockData.java index b585fb1a2b4f..7b6813a68260 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/helpers/TestBlockData.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/helpers/TestBlockData.java @@ -26,14 +26,12 @@ import org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos; import org.apache.hadoop.ozone.common.Checksum; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Tests to test block deleting service. */ -@Timeout(10) public class TestBlockData { static final Logger LOG = LoggerFactory.getLogger(TestBlockData.class); diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestContainerPersistence.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestContainerPersistence.java index d052f89f2417..cf75342efdf2 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestContainerPersistence.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestContainerPersistence.java @@ -96,7 +96,6 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -106,7 +105,6 @@ * these tests are specific to {@link KeyValueContainer}. If a new {@link * ContainerProtos.ContainerType} is added, the tests need to be modified. */ -@Timeout(300) public class TestContainerPersistence { private static final String DATANODE_UUID = UUID.randomUUID().toString(); private static final String SCM_ID = UUID.randomUUID().toString(); diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/interfaces/TestHandler.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/interfaces/TestHandler.java index 829f8c55ee50..b8a6ccf447d3 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/interfaces/TestHandler.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/interfaces/TestHandler.java @@ -39,12 +39,10 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Tests Handler interface. */ -@Timeout(300) public class TestHandler { private OzoneConfiguration conf; diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestDeleteBlocksCommandHandler.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestDeleteBlocksCommandHandler.java index fe3872e2dbde..bc9c33197a0c 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestDeleteBlocksCommandHandler.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestDeleteBlocksCommandHandler.java @@ -77,7 +77,6 @@ import org.apache.hadoop.ozone.protocol.commands.DeleteBlocksCommand; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; @@ -85,7 +84,6 @@ /** * Test cases for TestDeleteBlocksCommandHandler. */ -@Timeout(300) public class TestDeleteBlocksCommandHandler { @TempDir private Path folder; diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestPeriodicVolumeChecker.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestPeriodicVolumeChecker.java index 0d51b2b95403..7ffc73f08681 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestPeriodicVolumeChecker.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestPeriodicVolumeChecker.java @@ -34,7 +34,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -42,7 +41,6 @@ /** * Test periodic volume checker in StorageVolumeChecker. */ -@Timeout(150) public class TestPeriodicVolumeChecker { private static final Logger LOG = LoggerFactory.getLogger( diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java index 424de5d78651..bbcf50a6e1c8 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java @@ -59,7 +59,6 @@ import org.apache.hadoop.util.FakeTimer; import org.apache.ozone.test.GenericTestUtils; import org.junit.jupiter.api.TestInfo; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -70,7 +69,6 @@ /** * Tests for {@link StorageVolumeChecker}. */ -@Timeout(300) public class TestStorageVolumeChecker { private static final Logger LOG = LoggerFactory.getLogger( TestStorageVolumeChecker.class); diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSet.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSet.java index 510028442895..51b4e68257f9 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSet.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSet.java @@ -41,13 +41,11 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; /** * Tests {@link MutableVolumeSet} operations. */ -@Timeout(300) public class TestVolumeSet { private OzoneConfiguration conf; diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java index 85e5fe1580cc..a88cc818770c 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java @@ -64,7 +64,6 @@ import org.apache.hadoop.util.Timer; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -73,7 +72,6 @@ * Verify that {@link MutableVolumeSet} correctly checks for failed disks * during initialization. */ -@Timeout(30) public class TestVolumeSetDiskChecks { @TempDir private Path tempDir; diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerMarkUnhealthy.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerMarkUnhealthy.java index 06f56a192d34..85c9f574b525 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerMarkUnhealthy.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerMarkUnhealthy.java @@ -41,7 +41,6 @@ import org.apache.hadoop.ozone.container.common.volume.RoundRobinVolumeChoosingPolicy; import org.apache.hadoop.ozone.container.common.volume.VolumeSet; import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -50,7 +49,6 @@ * Tests unhealthy container functionality in the {@link KeyValueContainer} * class. */ -@Timeout(600) public class TestKeyValueContainerMarkUnhealthy { private static final Logger LOG = LoggerFactory.getLogger( TestKeyValueContainerMarkUnhealthy.class); diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueHandler.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueHandler.java index 76e696e91dd5..b688248d5111 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueHandler.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueHandler.java @@ -72,14 +72,12 @@ import org.apache.ozone.test.GenericTestUtils.LogCapturer; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.mockito.Mockito; /** * Unit tests for {@link KeyValueHandler}. */ -@Timeout(300) public class TestKeyValueHandler { @TempDir diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/replication/TestPushReplicator.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/replication/TestPushReplicator.java index 6b6a511ce0db..a4463410cea5 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/replication/TestPushReplicator.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/replication/TestPushReplicator.java @@ -39,7 +39,6 @@ import org.apache.ozone.test.SpyOutputStream; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; import org.mockito.ArgumentCaptor; @@ -47,7 +46,6 @@ /** * Test for {@link PushReplicator}. */ -@Timeout(30) class TestPushReplicator { private OzoneConfiguration conf; diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/replication/TestSimpleContainerDownloader.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/replication/TestSimpleContainerDownloader.java index 9724022521d3..076fb17c711b 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/replication/TestSimpleContainerDownloader.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/replication/TestSimpleContainerDownloader.java @@ -36,7 +36,6 @@ import org.apache.hadoop.hdds.protocol.DatanodeDetails; import org.apache.hadoop.hdds.protocol.MockDatanodeDetails; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; /** @@ -112,7 +111,6 @@ public void testGetContainerDataFromReplicasAsyncFailure() throws Exception { * Test if different datanode is used for each download attempt. */ @Test - @Timeout(10) public void testRandomSelection() throws Exception { //GIVEN diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtil.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtil.java index 888b205e8876..6feba1a48f31 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtil.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtil.java @@ -25,12 +25,10 @@ import org.apache.hadoop.hdds.utils.HddsServerUtil; import org.apache.hadoop.net.NetUtils; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test the HDDS server side utilities. */ -@Timeout(300) public class TestHddsServerUtil { /** diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java index d1335ae41c58..fe3b6d9d4a30 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java @@ -40,14 +40,12 @@ import org.apache.hadoop.net.NetUtils; import org.apache.hadoop.test.PathUtils; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Unit tests for {@link HddsServerUtil}. */ -@Timeout(300) public class TestHddsServerUtils { private static final Logger LOG = LoggerFactory.getLogger( TestHddsServerUtils.class); diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/block/TestBlockManager.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/block/TestBlockManager.java index eb2fb3437bdc..9f6091d1aba6 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/block/TestBlockManager.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/block/TestBlockManager.java @@ -86,7 +86,6 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; /** @@ -473,7 +472,6 @@ public void testAllocateBlockSucInSafeMode() throws Exception { } @Test - @Timeout(100) public void testMultipleBlockAllocation() throws IOException, TimeoutException, InterruptedException { @@ -516,7 +514,6 @@ private boolean verifyNumberOfContainersInPipelines( } @Test - @Timeout(100) public void testMultipleBlockAllocationWithClosedContainer() throws IOException, TimeoutException, InterruptedException { nodeManager.setNumPipelinePerDatanode(1); @@ -571,7 +568,6 @@ public void testMultipleBlockAllocationWithClosedContainer() } @Test - @Timeout(100) public void testBlockAllocationWithNoAvailablePipelines() throws IOException { for (Pipeline pipeline : pipelineManager.getPipelines()) { diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/balancer/TestContainerBalancer.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/balancer/TestContainerBalancer.java index 840ff132803a..c0897814b052 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/balancer/TestContainerBalancer.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/balancer/TestContainerBalancer.java @@ -50,7 +50,6 @@ import org.apache.ozone.test.GenericTestUtils.LogCapturer; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.event.Level; @@ -58,7 +57,6 @@ /** * Tests for {@link ContainerBalancer}. */ -@Timeout(60) public class TestContainerBalancer { private static final Logger LOG = LoggerFactory.getLogger(TestContainerBalancer.class); diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/safemode/TestSCMSafeModeManager.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/safemode/TestSCMSafeModeManager.java index f43a7047c0ec..b00f5b4ea5c5 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/safemode/TestSCMSafeModeManager.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/safemode/TestSCMSafeModeManager.java @@ -72,7 +72,6 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -82,7 +81,6 @@ /** Test class for SCMSafeModeManager. */ -@Timeout(300) public class TestSCMSafeModeManager { private EventQueue queue; diff --git a/hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/TestOmUtils.java b/hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/TestOmUtils.java index ec6babde6bb3..5ed2efded207 100644 --- a/hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/TestOmUtils.java +++ b/hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/TestOmUtils.java @@ -43,13 +43,11 @@ import org.apache.hadoop.hdds.conf.OzoneConfiguration; import org.apache.hadoop.ozone.om.OMConfigKeys; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; /** * Unit tests for {@link OmUtils}. */ -@Timeout(60) public class TestOmUtils { @TempDir diff --git a/hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/client/io/TestSelectorOutputStream.java b/hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/client/io/TestSelectorOutputStream.java index 2fb6846d6e89..22ed243edb43 100644 --- a/hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/client/io/TestSelectorOutputStream.java +++ b/hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/client/io/TestSelectorOutputStream.java @@ -31,14 +31,12 @@ import org.apache.ratis.util.function.CheckedConsumer; import org.apache.ratis.util.function.CheckedFunction; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Test {@link SelectorOutputStream}. */ -@Timeout(30) class TestSelectorOutputStream { private static final Logger LOG = LoggerFactory.getLogger( TestSelectorOutputStream.class); diff --git a/hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/om/lock/TestOzoneManagerLock.java b/hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/om/lock/TestOzoneManagerLock.java index 49377c8cf282..3f1e7ca83c60 100644 --- a/hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/om/lock/TestOzoneManagerLock.java +++ b/hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/om/lock/TestOzoneManagerLock.java @@ -35,14 +35,12 @@ import org.apache.hadoop.metrics2.impl.MetricsCollectorImpl; import org.apache.hadoop.ozone.om.lock.OzoneManagerLock.Resource; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; /** * Class tests OzoneManagerLock. */ -@Timeout(300) class TestOzoneManagerLock { @ParameterizedTest diff --git a/hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v1/TestS3SDKV1.java b/hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v1/TestS3SDKV1.java index 3c4c35a6d51e..ec7e35e25341 100644 --- a/hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v1/TestS3SDKV1.java +++ b/hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v1/TestS3SDKV1.java @@ -22,12 +22,10 @@ import org.apache.hadoop.hdds.scm.ScmConfigKeys; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Timeout; /** * Tests the AWS S3 SDK basic operations with OM Ratis enabled. */ -@Timeout(300) public class TestS3SDKV1 extends AbstractS3SDKV1Tests { @BeforeAll diff --git a/hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v1/TestS3SDKV1WithRatisStreaming.java b/hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v1/TestS3SDKV1WithRatisStreaming.java index 19593fa0f403..52814ffd4eda 100644 --- a/hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v1/TestS3SDKV1WithRatisStreaming.java +++ b/hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v1/TestS3SDKV1WithRatisStreaming.java @@ -23,12 +23,10 @@ import org.apache.hadoop.ozone.OzoneConfigKeys; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Timeout; /** * Tests the AWS S3 SDK basic operations with OM Ratis enabled and Streaming Write Pipeline. */ -@Timeout(300) public class TestS3SDKV1WithRatisStreaming extends AbstractS3SDKV1Tests { @BeforeAll diff --git a/hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v2/TestS3SDKV2.java b/hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v2/TestS3SDKV2.java index b4d8d3a3c5fc..bcfca490eb75 100644 --- a/hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v2/TestS3SDKV2.java +++ b/hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v2/TestS3SDKV2.java @@ -22,12 +22,10 @@ import org.apache.hadoop.hdds.scm.ScmConfigKeys; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Timeout; /** * Tests the AWS S3 SDK V2 basic operations with OM Ratis enabled. */ -@Timeout(300) public class TestS3SDKV2 extends AbstractS3SDKV2Tests { @BeforeAll diff --git a/hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v2/TestS3SDKV2WithRatisStreaming.java b/hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v2/TestS3SDKV2WithRatisStreaming.java index ccaad5147328..6fe287c46e47 100644 --- a/hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v2/TestS3SDKV2WithRatisStreaming.java +++ b/hadoop-ozone/integration-test-s3/src/test/java/org/apache/hadoop/ozone/s3/awssdk/v2/TestS3SDKV2WithRatisStreaming.java @@ -23,12 +23,10 @@ import org.apache.hadoop.ozone.OzoneConfigKeys; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Timeout; /** * Tests the AWS S3 SDK basic operations with OM Ratis enabled and Streaming Write Pipeline. */ -@Timeout(300) public class TestS3SDKV2WithRatisStreaming extends AbstractS3SDKV2Tests { @BeforeAll diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestDirectoryDeletingServiceWithFSO.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestDirectoryDeletingServiceWithFSO.java index 7dcbe2e0e1ce..4c6a21f1cbb5 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestDirectoryDeletingServiceWithFSO.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestDirectoryDeletingServiceWithFSO.java @@ -86,7 +86,6 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.mockito.ArgumentMatchers; import org.mockito.Mockito; import org.slf4j.Logger; @@ -95,7 +94,6 @@ /** * Directory deletion service test cases. */ -@Timeout(300) public class TestDirectoryDeletingServiceWithFSO { private static final Logger LOG = diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestHSync.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestHSync.java index 4493c90696d2..ff11c6129266 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestHSync.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestHSync.java @@ -133,7 +133,6 @@ import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -144,7 +143,6 @@ /** * Test HSync. */ -@Timeout(value = 300) @TestMethodOrder(OrderAnnotation.class) public class TestHSync { private static final Logger LOG = diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestHSyncUpgrade.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestHSyncUpgrade.java index feb3e0749b17..d60f983f7a55 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestHSyncUpgrade.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestHSyncUpgrade.java @@ -72,13 +72,11 @@ import org.junit.jupiter.api.MethodOrderer.OrderAnnotation; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; -import org.junit.jupiter.api.Timeout; import org.slf4j.event.Level; /** * Test HSync upgrade. */ -@Timeout(value = 300) @TestMethodOrder(OrderAnnotation.class) public class TestHSyncUpgrade { private MiniOzoneCluster cluster; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestLeaseRecovery.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestLeaseRecovery.java index 35adfdaa83e3..eaf98317c789 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestLeaseRecovery.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestLeaseRecovery.java @@ -84,7 +84,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; import org.junit.jupiter.api.TestMethodOrder; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import org.slf4j.event.Level; @@ -92,7 +91,6 @@ /** * Test cases for recoverLease() API. */ -@Timeout(300) @Flaky("HDDS-11323") @TestInstance(TestInstance.Lifecycle.PER_CLASS) @TestMethodOrder(MethodOrderer.OrderAnnotation.class) diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFSInputStream.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFSInputStream.java index 448d0fe22d0f..e039e14e47d0 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFSInputStream.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFSInputStream.java @@ -54,7 +54,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -62,7 +61,6 @@ * Test OzoneFSInputStream by reading through multiple interfaces. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public abstract class TestOzoneFSInputStream implements NonHATests.TestCase { private OzoneClient client; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFSWithObjectStoreCreate.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFSWithObjectStoreCreate.java index b31a4812b78f..012c7a600722 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFSWithObjectStoreCreate.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFSWithObjectStoreCreate.java @@ -67,7 +67,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -75,7 +74,6 @@ * Class tests create with object store and getFileStatus. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public abstract class TestOzoneFSWithObjectStoreCreate implements NonHATests.TestCase { private OzoneClient client; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileChecksum.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileChecksum.java index 34ff65afc2b3..3e4c991d4b06 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileChecksum.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileChecksum.java @@ -57,7 +57,6 @@ import org.apache.hadoop.util.StringUtils; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -65,7 +64,6 @@ /** * Test FileChecksum API. */ -@Timeout(300) public class TestOzoneFileChecksum { private static final boolean[] TOPOLOGY_AWARENESS = new boolean[] { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystemMetrics.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystemMetrics.java index 8d1f0188fafe..b57e298b7bee 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystemMetrics.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystemMetrics.java @@ -40,13 +40,11 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; /** * Test OM Metrics for OzoneFileSystem operations. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public abstract class TestOzoneFileSystemMetrics implements NonHATests.TestCase { private OzoneClient client; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystemPrefixParser.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystemPrefixParser.java index 5d7ea49ce2fe..facea4409650 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystemPrefixParser.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystemPrefixParser.java @@ -37,12 +37,10 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test Ozone Prefix Parser. */ -@Timeout(120) public class TestOzoneFileSystemPrefixParser { private static MiniOzoneCluster cluster = null; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystemWithStreaming.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystemWithStreaming.java index 58f5a70f37be..c141f3fb37fa 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystemWithStreaming.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFileSystemWithStreaming.java @@ -53,14 +53,12 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Ozone file system tests with Streaming. */ -@Timeout(value = 300) public class TestOzoneFileSystemWithStreaming { private static final Logger LOG = LoggerFactory.getLogger( TestOzoneFileSystemWithStreaming.class); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFsHAURLs.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFsHAURLs.java index 1b7e6dc4eb93..4647605a01ca 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFsHAURLs.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFsHAURLs.java @@ -49,7 +49,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -57,7 +56,6 @@ * Test client-side URI handling with Ozone Manager HA. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public abstract class TestOzoneFsHAURLs implements HATests.TestCase { /** diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFsSnapshot.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFsSnapshot.java index 6c08ba8929a6..0291b556c6e0 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFsSnapshot.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFsSnapshot.java @@ -57,7 +57,6 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -68,7 +67,6 @@ * Test client-side CRUD snapshot operations with Ozone Manager. * Setting a timeout for every test method to 300 seconds. */ -@Timeout(value = 300) class TestOzoneFsSnapshot { private static MiniOzoneCluster cluster; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestRootedDDSWithFSO.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestRootedDDSWithFSO.java index 1806e2be9dde..3c2cfa914edc 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestRootedDDSWithFSO.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestRootedDDSWithFSO.java @@ -57,7 +57,6 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -65,7 +64,6 @@ * Directory deletion service test cases using rooted ozone filesystem * ofs://volume/bucket/path. */ -@Timeout(300) public class TestRootedDDSWithFSO { private static final Logger LOG = diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestSafeMode.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestSafeMode.java index bbb3c66087c5..1300c61b1f8d 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestSafeMode.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestSafeMode.java @@ -46,9 +46,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; -@Timeout(120) class TestSafeMode { private static final String VOLUME = "vol"; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestAllocateContainer.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestAllocateContainer.java index ea0931e770e2..60e329790fa8 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestAllocateContainer.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestAllocateContainer.java @@ -31,13 +31,11 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; /** * Test allocate container calls. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public abstract class TestAllocateContainer implements NonHATests.TestCase { private OzoneConfiguration conf; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestCommitInRatis.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestCommitInRatis.java index 277b3cfa9668..44b32bd5c642 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestCommitInRatis.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestCommitInRatis.java @@ -44,14 +44,12 @@ import org.apache.hadoop.ozone.container.ContainerTestHelper; import org.apache.ozone.test.GenericTestUtils.LogCapturer; import org.apache.ratis.proto.RaftProtos; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; /** * This class tests the 2 way and 3 way commit in Ratis. */ -@Timeout(300) public class TestCommitInRatis { private MiniOzoneCluster cluster; private OzoneClient client; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestContainerOperations.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestContainerOperations.java index b697b5cffe99..cc0d515f1982 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestContainerOperations.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestContainerOperations.java @@ -56,14 +56,12 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; /** * This class tests container operations (TODO currently only supports create) * from cblock clients. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public abstract class TestContainerOperations implements NonHATests.TestCase { private static final int CONTAINER_LIST_LIMIT = 1; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestContainerReportWithKeys.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestContainerReportWithKeys.java index fe68a8d1661c..28c60a76e587 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestContainerReportWithKeys.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestContainerReportWithKeys.java @@ -43,7 +43,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -51,7 +50,6 @@ * This class tests container report with DN container state info. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public abstract class TestContainerReportWithKeys implements NonHATests.TestCase { private static final Logger LOG = LoggerFactory.getLogger( TestContainerReportWithKeys.class); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestContainerSmallFile.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestContainerSmallFile.java index 086ddb7cdf95..8140ea3eb453 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestContainerSmallFile.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestContainerSmallFile.java @@ -42,13 +42,11 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; /** * Test Container calls. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public abstract class TestContainerSmallFile implements NonHATests.TestCase { private OzoneConfiguration ozoneConfig; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestGetCommittedBlockLengthAndPutKey.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestGetCommittedBlockLengthAndPutKey.java index 4e9bd38e76e8..8fa1d6bed71c 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestGetCommittedBlockLengthAndPutKey.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestGetCommittedBlockLengthAndPutKey.java @@ -45,7 +45,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -53,7 +52,6 @@ * Test Container calls. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public abstract class TestGetCommittedBlockLengthAndPutKey implements NonHATests.TestCase { private static final Logger LOG = LoggerFactory.getLogger(TestGetCommittedBlockLengthAndPutKey.class); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestRatisPipelineLeader.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestRatisPipelineLeader.java index 9299ee9143a7..dc54838d8514 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestRatisPipelineLeader.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestRatisPipelineLeader.java @@ -42,7 +42,6 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.slf4j.event.Level; @@ -75,7 +74,7 @@ public static void shutdown() throws Exception { } } - @Test @Timeout(unit = TimeUnit.MILLISECONDS, value = 120000) + @Test public void testLeaderIdUsedOnFirstCall() throws Exception { List pipelines = cluster.getStorageContainerManager() .getPipelineManager().getPipelines(RatisReplicationConfig.getInstance( @@ -111,7 +110,7 @@ public void testLeaderIdUsedOnFirstCall() throws Exception { .doesNotContain("org.apache.ratis.protocol.NotLeaderException"); } - @Test @Timeout(unit = TimeUnit.MILLISECONDS, value = 120000) + @Test public void testLeaderIdAfterLeaderChange() throws Exception { List pipelines = cluster.getStorageContainerManager() .getPipelineManager().getPipelines(RatisReplicationConfig.getInstance( diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMDbCheckpointServlet.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMDbCheckpointServlet.java index 7915751dda15..8a4f0ca5600f 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMDbCheckpointServlet.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMDbCheckpointServlet.java @@ -62,7 +62,6 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -71,7 +70,6 @@ /** * Class used for testing the SCM DB Checkpoint provider servlet. */ -@Timeout(240) public class TestSCMDbCheckpointServlet { private MiniOzoneCluster cluster = null; private StorageContainerManager scm; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMInstallSnapshotWithHA.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMInstallSnapshotWithHA.java index eba99e42ed46..d63e94dc045f 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMInstallSnapshotWithHA.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMInstallSnapshotWithHA.java @@ -57,14 +57,12 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.event.Level; /** * Tests the Ratis snapshot feature in SCM. */ -@Timeout(500) @Flaky("HDDS-5631") public class TestSCMInstallSnapshotWithHA { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMMXBean.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMMXBean.java index fb9cec776ff3..bde82b2ab951 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMMXBean.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMMXBean.java @@ -43,7 +43,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -52,7 +51,6 @@ * This class is to test JMX management interface for scm information. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public abstract class TestSCMMXBean implements NonHATests.TestCase { private static final Logger LOG = LoggerFactory.getLogger(TestSCMMXBean.class); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMNodeManagerMXBean.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMNodeManagerMXBean.java index f420fcb4fab7..ff2a13564062 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMNodeManagerMXBean.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMNodeManagerMXBean.java @@ -35,7 +35,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -43,7 +42,6 @@ * Class which tests the SCMNodeManagerInfo Bean. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public abstract class TestSCMNodeManagerMXBean implements NonHATests.TestCase { private static final Logger LOG = LoggerFactory.getLogger(TestSCMMXBean.class); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSecretKeySnapshot.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSecretKeySnapshot.java index 384c4e33190f..6252f1f5f2f0 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSecretKeySnapshot.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSecretKeySnapshot.java @@ -67,7 +67,6 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -76,7 +75,6 @@ * Integration test to verify that symmetric secret keys are correctly * synchronized from leader to follower during snapshot installation. */ -@Timeout(500) public final class TestSecretKeySnapshot { private static final Logger LOG = LoggerFactory .getLogger(TestSecretKeySnapshot.class); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSecretKeysApi.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSecretKeysApi.java index 0e069e108812..e4e2dcdd1940 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSecretKeysApi.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSecretKeysApi.java @@ -51,7 +51,6 @@ import java.util.List; import java.util.Properties; import java.util.UUID; -import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import org.apache.hadoop.hdds.annotation.InterfaceAudience; import org.apache.hadoop.hdds.conf.OzoneConfiguration; @@ -73,7 +72,6 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -82,7 +80,6 @@ * Integration test to verify symmetric SecretKeys APIs in a secure cluster. */ -@Timeout(value = 500, unit = TimeUnit.SECONDS) @InterfaceAudience.Private public final class TestSecretKeysApi { private static final Logger LOG = LoggerFactory diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManager.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManager.java index 4df849e6e0ef..cd93f8905ca7 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManager.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManager.java @@ -146,7 +146,6 @@ import org.apache.ratis.protocol.RaftGroupId; import org.apache.ratis.server.RaftServerConfigKeys; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -154,7 +153,6 @@ /** * Test class that exercises the StorageContainerManager. */ -@Timeout(900) public class TestStorageContainerManager { private static final int KEY_COUNT = 5; private static final String LOCALHOST_IP = "127.0.0.1"; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManagerHA.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManagerHA.java index 41399311d4bf..7de9cdd0150c 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManagerHA.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManagerHA.java @@ -34,14 +34,12 @@ import org.apache.hadoop.ozone.MiniOzoneHAClusterImpl; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Tests for SCM HA. */ -@Timeout(300) public class TestStorageContainerManagerHA { private static final Logger LOG = LoggerFactory.getLogger(TestStorageContainerManagerHA.class); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManagerHAWithAllRunning.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManagerHAWithAllRunning.java index a882de3ff697..bfc3d61953de 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManagerHAWithAllRunning.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManagerHAWithAllRunning.java @@ -51,12 +51,10 @@ import org.apache.ozone.test.HATests; import org.apache.ratis.statemachine.SnapshotInfo; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Tests for SCM HA. */ -@Timeout(300) public abstract class TestStorageContainerManagerHAWithAllRunning implements HATests.TestCase { private static final int OM_COUNT = 3; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestXceiverClientGrpc.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestXceiverClientGrpc.java index d6b69e3a0375..89ea363609d8 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestXceiverClientGrpc.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestXceiverClientGrpc.java @@ -43,7 +43,6 @@ import org.apache.hadoop.ozone.OzoneConfigKeys; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Tests for TestXceiverClientGrpc, to ensure topology aware reads work @@ -86,7 +85,6 @@ public void testCorrectDnsReturnedFromPipeline() throws IOException { } @Test - @Timeout(5) public void testLeaderNodeIsCommandTarget() throws IOException { final Set seenDN = new HashSet<>(); conf.setBoolean( @@ -111,7 +109,6 @@ public XceiverClientReply sendCommandAsync( } @Test - @Timeout(5) public void testGetBlockRetryAlNodes() { final ArrayList allDNs = new ArrayList<>(dns); assertThat(allDNs.size()).isGreaterThan(1); @@ -132,7 +129,6 @@ public XceiverClientReply sendCommandAsync( } @Test - @Timeout(5) public void testReadChunkRetryAllNodes() { final ArrayList allDNs = new ArrayList<>(dns); assertThat(allDNs.size()).isGreaterThan(1); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestXceiverClientManager.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestXceiverClientManager.java index bd28fba0b28b..06d19e557587 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestXceiverClientManager.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestXceiverClientManager.java @@ -45,7 +45,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -54,7 +53,6 @@ * Test for XceiverClientManager caching and eviction. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public abstract class TestXceiverClientManager implements NonHATests.TestCase { private StorageContainerLocationProtocolClientSideTranslatorPB diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestXceiverClientMetrics.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestXceiverClientMetrics.java index 50b21fd9032f..e1003859f8f4 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestXceiverClientMetrics.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestXceiverClientMetrics.java @@ -44,13 +44,11 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; /** * This class tests the metrics of XceiverClient. */ -@Timeout(300) public class TestXceiverClientMetrics { // only for testing diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/container/TestScmApplyTransactionFailure.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/container/TestScmApplyTransactionFailure.java index 2bb67e9a8842..399e1b237282 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/container/TestScmApplyTransactionFailure.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/container/TestScmApplyTransactionFailure.java @@ -41,13 +41,11 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; /** * Test-cases to verify SCMStateMachine.applyTransaction failure scenarios. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public abstract class TestScmApplyTransactionFailure implements HATests.TestCase { private ContainerManager containerManager; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/container/metrics/TestSCMContainerManagerMetrics.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/container/metrics/TestSCMContainerManagerMetrics.java index 300ea81e520a..71d8e39338a1 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/container/metrics/TestSCMContainerManagerMetrics.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/container/metrics/TestSCMContainerManagerMetrics.java @@ -45,13 +45,11 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; /** * Class used to test {@link SCMContainerManagerMetrics}. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public abstract class TestSCMContainerManagerMetrics implements NonHATests.TestCase { private StorageContainerManager scm; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestLeaderChoosePolicy.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestLeaderChoosePolicy.java index 3c19a039e141..188793c0eb24 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestLeaderChoosePolicy.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestLeaderChoosePolicy.java @@ -43,7 +43,6 @@ import org.apache.ozone.test.tag.Unhealthy; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Tests for LeaderChoosePolicy. @@ -102,7 +101,7 @@ private void checkLeaderBalance(int dnNum, int leaderNumOfEachDn) } } - @Test @Timeout(unit = TimeUnit.MILLISECONDS, value = 360000) + @Test public void testRestoreSuggestedLeader() throws Exception { conf.setBoolean(OZONE_SCM_PIPELINE_AUTO_CREATE_FACTOR_ONE, false); conf.set(OZONE_SCM_PIPELINE_LEADER_CHOOSING_POLICY, @@ -151,7 +150,7 @@ public void testRestoreSuggestedLeader() throws Exception { } } - @Test @Timeout(unit = TimeUnit.MILLISECONDS, value = 360000) + @Test public void testMinLeaderCountChoosePolicy() throws Exception { conf.setBoolean(OZONE_SCM_PIPELINE_AUTO_CREATE_FACTOR_ONE, false); conf.set(OZONE_SCM_PIPELINE_LEADER_CHOOSING_POLICY, @@ -193,7 +192,7 @@ public void testMinLeaderCountChoosePolicy() throws Exception { } } - @Test @Timeout(unit = TimeUnit.MILLISECONDS, value = 60000) + @Test public void testDefaultLeaderChoosePolicy() throws Exception { conf.setBoolean(OZONE_SCM_PIPELINE_AUTO_CREATE_FACTOR_ONE, false); conf.set(OZONE_SCM_PIPELINE_LEADER_CHOOSING_POLICY, diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestNode2PipelineMap.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestNode2PipelineMap.java index 17c9f48d2520..d5441276c8b0 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestNode2PipelineMap.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestNode2PipelineMap.java @@ -37,12 +37,10 @@ import org.apache.ozone.test.NonHATests; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test for the Node2Pipeline map. */ -@Timeout(300) public abstract class TestNode2PipelineMap implements NonHATests.TestCase { private StorageContainerManager scm; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineClose.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineClose.java index 292c20958e81..dd70fa970f80 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineClose.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineClose.java @@ -65,14 +65,12 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.mockito.ArgumentCaptor; /** * Tests for Pipeline Closing. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public class TestPipelineClose { private MiniOzoneCluster cluster; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineManagerMXBean.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineManagerMXBean.java index f5faca5836fb..9a16abda982f 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineManagerMXBean.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineManagerMXBean.java @@ -29,12 +29,10 @@ import org.apache.ozone.test.NonHATests; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test cases to verify the metrics exposed by SCMPipelineManager via MXBean. */ -@Timeout(3000) public abstract class TestPipelineManagerMXBean implements NonHATests.TestCase { private MBeanServer mbs; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestRatisPipelineCreateAndDestroy.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestRatisPipelineCreateAndDestroy.java index 699c03c6c941..e54b04884c4c 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestRatisPipelineCreateAndDestroy.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestRatisPipelineCreateAndDestroy.java @@ -43,7 +43,6 @@ import org.apache.ozone.test.GenericTestUtils; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Tests for RatisPipelineUtils. @@ -75,7 +74,7 @@ public void cleanup() { cluster.shutdown(); } - @Test @Timeout(unit = TimeUnit.MILLISECONDS, value = 180000) + @Test public void testAutomaticPipelineCreationOnPipelineDestroy() throws Exception { int numOfDatanodes = 6; @@ -96,7 +95,7 @@ public void testAutomaticPipelineCreationOnPipelineDestroy() waitForPipelines(2); } - @Test @Timeout(unit = TimeUnit.MILLISECONDS, value = 180000) + @Test public void testAutomaticPipelineCreationDisablingFactorONE() throws Exception { conf.setBoolean(OZONE_SCM_PIPELINE_AUTO_CREATE_FACTOR_ONE, false); @@ -119,7 +118,7 @@ public void testAutomaticPipelineCreationDisablingFactorONE() waitForPipelines(2); } - @Test @Timeout(unit = TimeUnit.MILLISECONDS, value = 180000) + @Test public void testPipelineCreationOnNodeRestart() throws Exception { conf.setTimeDuration(OZONE_SCM_STALENODE_INTERVAL, 5, TimeUnit.SECONDS); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestSCMPipelineBytesWrittenMetrics.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestSCMPipelineBytesWrittenMetrics.java index 5f1b1d28d706..f45f29afb70e 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestSCMPipelineBytesWrittenMetrics.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestSCMPipelineBytesWrittenMetrics.java @@ -47,12 +47,10 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test cases to verify the SCM pipeline bytesWritten metrics. */ -@Timeout(300) public class TestSCMPipelineBytesWrittenMetrics { private MiniOzoneCluster cluster; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestSCMPipelineMetrics.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestSCMPipelineMetrics.java index 902cdc4ebdf0..f0ebb60078c1 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestSCMPipelineMetrics.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestSCMPipelineMetrics.java @@ -38,13 +38,11 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; /** * Test cases to verify the metrics exposed by SCMPipelineManager. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public abstract class TestSCMPipelineMetrics implements NonHATests.TestCase { private MiniOzoneCluster cluster; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestSCMRestart.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestSCMRestart.java index f54db6f359aa..c6443842d37d 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestSCMRestart.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestSCMRestart.java @@ -36,12 +36,10 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test SCM restart and recovery wrt pipelines. */ -@Timeout(300) public class TestSCMRestart { private static MiniOzoneCluster cluster; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/storage/TestCommitWatcher.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/storage/TestCommitWatcher.java index 590818ecc493..efd0fe25bc53 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/storage/TestCommitWatcher.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/storage/TestCommitWatcher.java @@ -67,12 +67,10 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Class to test CommitWatcher functionality. */ -@Timeout(value = 300, unit = TimeUnit.SECONDS) public class TestCommitWatcher { private MiniOzoneCluster cluster; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/upgrade/TestHDDSUpgrade.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/upgrade/TestHDDSUpgrade.java index 547ea0dfe863..b524d7fa1e95 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/upgrade/TestHDDSUpgrade.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/upgrade/TestHDDSUpgrade.java @@ -94,14 +94,12 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Test SCM and DataNode Upgrade sequence. */ -@Timeout(11000) @Flaky({"HDDS-6028", "HDDS-6049"}) @Slow public class TestHDDSUpgrade { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestBlockTokens.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestBlockTokens.java index b658c780785d..a3e56f659c27 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestBlockTokens.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestBlockTokens.java @@ -53,7 +53,6 @@ import java.util.Objects; import java.util.Properties; import java.util.UUID; -import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.function.Function; import org.apache.commons.lang3.RandomStringUtils; @@ -88,7 +87,6 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -97,7 +95,6 @@ * Integration test to verify block tokens in a secure cluster. */ @InterfaceAudience.Private -@Timeout(value = 180, unit = TimeUnit.SECONDS) public final class TestBlockTokens { private static final Logger LOG = LoggerFactory.getLogger(TestBlockTokens.class); private static final String TEST_VOLUME = "testvolume"; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestBlockTokensCLI.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestBlockTokensCLI.java index 393009d18e86..6904ad6c1ed5 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestBlockTokensCLI.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestBlockTokensCLI.java @@ -51,7 +51,6 @@ import java.time.Instant; import java.util.Map; import java.util.Properties; -import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import org.apache.hadoop.hdds.annotation.InterfaceAudience; import org.apache.hadoop.hdds.conf.OzoneConfiguration; @@ -70,7 +69,6 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -80,7 +78,6 @@ * secure cluster. */ @InterfaceAudience.Private -@Timeout(value = 180, unit = TimeUnit.SECONDS) public final class TestBlockTokensCLI { private static final Logger LOG = LoggerFactory .getLogger(TestBlockTokensCLI.class); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestContainerBalancerOperations.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestContainerBalancerOperations.java index 0ec8fa1b1510..77ac238ee404 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestContainerBalancerOperations.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestContainerBalancerOperations.java @@ -34,13 +34,11 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * This class tests container balancer operations * from cblock clients. */ -@Timeout(value = 300) public class TestContainerBalancerOperations { private static ScmClient containerBalancerClient; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestDelegationToken.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestDelegationToken.java index a6686052ce78..53d1f3610c8a 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestDelegationToken.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestDelegationToken.java @@ -94,7 +94,6 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -104,7 +103,6 @@ /** * Test class to for security enabled Ozone cluster. */ -@Timeout(80) public final class TestDelegationToken { private static final String TEST_USER = "testUgiUser@EXAMPLE.COM"; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestGetClusterTreeInformation.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestGetClusterTreeInformation.java index 5d2779adaf38..7cc308feee7a 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestGetClusterTreeInformation.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestGetClusterTreeInformation.java @@ -30,7 +30,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -40,7 +39,6 @@ * information from SCM. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public abstract class TestGetClusterTreeInformation implements HATests.TestCase { private static final Logger LOG = diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestMiniOzoneCluster.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestMiniOzoneCluster.java index de53b851eb4e..086a3f045bcb 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestMiniOzoneCluster.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestMiniOzoneCluster.java @@ -48,13 +48,11 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; /** * Test cases for mini ozone cluster. */ -@Timeout(300) public class TestMiniOzoneCluster { private MiniOzoneCluster cluster; @@ -204,7 +202,7 @@ public void testKeepPortsWhenRestartDN() throws Exception { * Test that a DN can register with SCM even if it was started before the SCM. * @throws Exception */ - @Test @Timeout(100) + @Test public void testDNstartAfterSCM() throws Exception { // Start a cluster with 3 DN cluster = MiniOzoneCluster.newBuilder(conf) @@ -249,7 +247,7 @@ public void testDNstartAfterSCM() throws Exception { * Test that multiple datanode directories are created in MiniOzoneCluster. * @throws Exception */ - @Test @Timeout(60) + @Test public void testMultipleDataDirs() throws Exception { // Start a cluster with 3 DN and configure reserved space in each DN String reservedSpace = "1B"; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestOMSortDatanodes.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestOMSortDatanodes.java index c7f7a843fee4..c3ecf6649426 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestOMSortDatanodes.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestOMSortDatanodes.java @@ -47,7 +47,6 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; /** @@ -55,7 +54,6 @@ * sortDatanodes tests for * {@link org.apache.hadoop.ozone.om.KeyManagerImpl#sortDatanodes(List, String)}. */ -@Timeout(300) public class TestOMSortDatanodes { @TempDir diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestSecureOzoneCluster.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestSecureOzoneCluster.java index c33f1712e822..9e5aa5b69cc3 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestSecureOzoneCluster.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestSecureOzoneCluster.java @@ -168,7 +168,6 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -176,7 +175,6 @@ /** * Test class to for security enabled Ozone cluster. */ -@Timeout(80) final class TestSecureOzoneCluster { private static final String COMPONENT = "om"; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/admin/om/lease/TestLeaseRecoverer.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/admin/om/lease/TestLeaseRecoverer.java index ef98ea859663..a93add3e9cc0 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/admin/om/lease/TestLeaseRecoverer.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/admin/om/lease/TestLeaseRecoverer.java @@ -29,7 +29,6 @@ import java.io.StringWriter; import java.net.URI; import java.util.concurrent.ThreadLocalRandom; -import java.util.concurrent.TimeUnit; import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; @@ -45,14 +44,12 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import picocli.CommandLine; /** * Test cases for LeaseRecoverer. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(value = 120000, unit = TimeUnit.MILLISECONDS) public abstract class TestLeaseRecoverer implements NonHATests.TestCase { private OzoneBucket fsoOzoneBucket; private OzoneClient client; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBCSID.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBCSID.java index e5d772b20d0e..19a2752f85cf 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBCSID.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBCSID.java @@ -47,12 +47,10 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Tests the validity BCSID of a container. */ -@Timeout(300) public class TestBCSID { private static OzoneConfiguration conf = new OzoneConfiguration(); private static MiniOzoneCluster cluster; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockDataStreamOutput.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockDataStreamOutput.java index 8a01464b5295..3fa28a0da366 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockDataStreamOutput.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockDataStreamOutput.java @@ -66,7 +66,6 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -75,7 +74,6 @@ * Tests BlockDataStreamOutput class. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public class TestBlockDataStreamOutput { private MiniOzoneCluster cluster; private static final int CHUNK_SIZE = 100; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockOutputStream.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockOutputStream.java index 12eede0eb03c..579b64822018 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockOutputStream.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockOutputStream.java @@ -62,13 +62,11 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) class TestBlockOutputStream { static final int CHUNK_SIZE = 100; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockOutputStreamWithFailures.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockOutputStreamWithFailures.java index a4cb32edd1a2..ff07b599a9cc 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockOutputStreamWithFailures.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockOutputStreamWithFailures.java @@ -58,7 +58,6 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -67,7 +66,6 @@ * Tests failure detection and handling in BlockOutputStream Class. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) @Flaky("HDDS-11849") class TestBlockOutputStreamWithFailures { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestCloseContainerHandlingByClient.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestCloseContainerHandlingByClient.java index df661d4f3478..513c497477f6 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestCloseContainerHandlingByClient.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestCloseContainerHandlingByClient.java @@ -52,13 +52,11 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; /** * Tests Close Container Exception handling by Ozone Client. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public abstract class TestCloseContainerHandlingByClient implements NonHATests.TestCase { private MiniOzoneCluster cluster; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachine.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachine.java index 91f4d4ba7ce1..2ff00d2df6f4 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachine.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachine.java @@ -62,12 +62,10 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Tests the containerStateMachine failure handling. */ -@Timeout(300) public class TestContainerStateMachine { private MiniOzoneCluster cluster; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachineFailureOnRead.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachineFailureOnRead.java index cc6c1974d0df..54a4ba4d3cb0 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachineFailureOnRead.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachineFailureOnRead.java @@ -62,7 +62,6 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test to verify pipeline is closed on readStateMachine failure. @@ -134,7 +133,7 @@ public void teardown() throws Exception { } } - @Test @Timeout(unit = TimeUnit.MILLISECONDS, value = 300000) + @Test @SuppressWarnings("squid:S3655") public void testReadStateMachineFailureClosesPipeline() throws Exception { // Stop one follower datanode diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachineFlushDelay.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachineFlushDelay.java index 811577e87286..4ca170dcd1e0 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachineFlushDelay.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachineFlushDelay.java @@ -57,12 +57,10 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Tests the containerStateMachine failure handling by set flush delay. */ -@Timeout(300) public class TestContainerStateMachineFlushDelay { private MiniOzoneCluster cluster; private OzoneConfiguration conf = new OzoneConfiguration(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachineStream.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachineStream.java index 63c2eaab0fda..58af0db2b11a 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachineStream.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachineStream.java @@ -39,7 +39,6 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -47,7 +46,6 @@ * Tests the containerStateMachine stream handling. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public abstract class TestContainerStateMachineStream implements NonHATests.TestCase { private OzoneClient client; private ObjectStore objectStore; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestDiscardPreallocatedBlocks.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestDiscardPreallocatedBlocks.java index ce78960918cc..807963faf6b8 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestDiscardPreallocatedBlocks.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestDiscardPreallocatedBlocks.java @@ -49,13 +49,11 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; /** * Tests that unused block pre-allocated for write is discarded when container is closed. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public abstract class TestDiscardPreallocatedBlocks implements NonHATests.TestCase { private MiniOzoneCluster cluster; private OzoneClient client; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestFailureHandlingByClient.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestFailureHandlingByClient.java index 9fcb126be475..c4d22f0e7ee5 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestFailureHandlingByClient.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestFailureHandlingByClient.java @@ -72,14 +72,12 @@ import org.apache.ratis.proto.RaftProtos; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; /** * Tests Exception handling by Ozone Client. */ -@Timeout(300) public class TestFailureHandlingByClient { private MiniOzoneCluster cluster; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestFailureHandlingByClientFlushDelay.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestFailureHandlingByClientFlushDelay.java index b5677f5cfc73..fdbdb04dfd95 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestFailureHandlingByClientFlushDelay.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestFailureHandlingByClientFlushDelay.java @@ -64,12 +64,10 @@ import org.apache.hadoop.ozone.om.helpers.OmKeyInfo; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Tests Exception handling by Ozone Client by set flush delay. */ -@Timeout(300) public class TestFailureHandlingByClientFlushDelay { private MiniOzoneCluster cluster; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestHybridPipelineOnDatanode.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestHybridPipelineOnDatanode.java index db7fcc5e3d43..4a87fb495193 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestHybridPipelineOnDatanode.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestHybridPipelineOnDatanode.java @@ -50,12 +50,10 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Tests Hybrid Pipeline Creation and IO on same set of Datanodes. */ -@Timeout(300) public class TestHybridPipelineOnDatanode { private static MiniOzoneCluster cluster; private static OzoneConfiguration conf; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestMultiBlockWritesWithDnFailures.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestMultiBlockWritesWithDnFailures.java index 86d568b7d94f..76220aa4f399 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestMultiBlockWritesWithDnFailures.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestMultiBlockWritesWithDnFailures.java @@ -56,12 +56,10 @@ import org.apache.ozone.test.tag.Flaky; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Tests MultiBlock Writes with Dn failures by Ozone Client. */ -@Timeout(300) public class TestMultiBlockWritesWithDnFailures { private MiniOzoneCluster cluster; private OzoneConfiguration conf; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientMultipartUploadWithFSO.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientMultipartUploadWithFSO.java index 1055087d8264..548c0acf3689 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientMultipartUploadWithFSO.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientMultipartUploadWithFSO.java @@ -92,7 +92,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; @@ -100,7 +99,6 @@ * This test verifies all the S3 multipart client apis - prefix layout. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public abstract class TestOzoneClientMultipartUploadWithFSO implements NonHATests.TestCase { private ObjectStore store; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientRetriesOnExceptionFlushDelay.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientRetriesOnExceptionFlushDelay.java index 16e20aeaf552..db82170022da 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientRetriesOnExceptionFlushDelay.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientRetriesOnExceptionFlushDelay.java @@ -54,13 +54,11 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Tests failure detection and handling in BlockOutputStream Class by set * flush delay. */ -@Timeout(300) public class TestOzoneClientRetriesOnExceptionFlushDelay { private MiniOzoneCluster cluster; private OzoneConfiguration conf = new OzoneConfiguration(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientRetriesOnExceptions.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientRetriesOnExceptions.java index 9148282cd9af..72129713e8a0 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientRetriesOnExceptions.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientRetriesOnExceptions.java @@ -61,12 +61,10 @@ import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Tests failure detection and handling in BlockOutputStream Class. */ -@Timeout(300) public class TestOzoneClientRetriesOnExceptions { private static final int MAX_RETRIES = 3; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClient.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClient.java index 0f53afb4e4f9..5559ed2b2289 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClient.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClient.java @@ -23,12 +23,10 @@ import org.apache.hadoop.ozone.OzoneConfigKeys; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Timeout; /** * Test Ozone Client with OM Ratis enabled. */ -@Timeout(300) class TestOzoneRpcClient extends OzoneRpcClientTests { @BeforeAll diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestReadRetries.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestReadRetries.java index 543acb089b3a..af28265e8230 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestReadRetries.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestReadRetries.java @@ -49,9 +49,7 @@ import org.apache.hadoop.ozone.om.helpers.OmKeyLocationInfo; import org.apache.hadoop.ozone.om.helpers.OzoneFileStatus; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; -@Timeout(300) class TestReadRetries { /** diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/TestContainerReplication.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/TestContainerReplication.java index 125166daa378..85f9198459c0 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/TestContainerReplication.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/TestContainerReplication.java @@ -84,7 +84,6 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -95,7 +94,6 @@ /** * Tests ozone containers replication. */ -@Timeout(300) class TestContainerReplication { private static final String VOLUME = "vol1"; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestCloseContainerHandler.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestCloseContainerHandler.java index 8df28cc4f05b..ec23121510ee 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestCloseContainerHandler.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestCloseContainerHandler.java @@ -49,12 +49,10 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test to behaviour of the datanode when receive close container command. */ -@Timeout(300) public class TestCloseContainerHandler { private MiniOzoneCluster cluster; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestDeleteContainerHandler.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestDeleteContainerHandler.java index 83d67dd7d700..cc105d4ba0c0 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestDeleteContainerHandler.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestDeleteContainerHandler.java @@ -77,12 +77,10 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Tests DeleteContainerCommand Handler. */ -@Timeout(300) public class TestDeleteContainerHandler { private static OzoneClient client; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestFinalizeBlock.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestFinalizeBlock.java index e39641a8fcf1..3e1711119eaa 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestFinalizeBlock.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestFinalizeBlock.java @@ -70,14 +70,12 @@ import org.apache.hadoop.ozone.om.helpers.OmKeyLocationInfoGroup; import org.apache.ozone.test.GenericTestUtils; import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; /** * Tests FinalizeBlock. */ -@Timeout(300) public class TestFinalizeBlock { private OzoneClient client; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestRefreshVolumeUsageHandler.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestRefreshVolumeUsageHandler.java index 9a01f86e0d74..748577766f83 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestRefreshVolumeUsageHandler.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestRefreshVolumeUsageHandler.java @@ -41,13 +41,11 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test the behaviour of the datanode and scm when communicating * with refresh volume usage command. */ -@Timeout(300) public class TestRefreshVolumeUsageHandler { private MiniOzoneCluster cluster; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/metrics/TestContainerMetrics.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/metrics/TestContainerMetrics.java index fdc2f3feb06c..6f3339175b88 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/metrics/TestContainerMetrics.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/metrics/TestContainerMetrics.java @@ -74,13 +74,11 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; /** * Test for metrics published by storage containers. */ -@Timeout(300) public class TestContainerMetrics { @TempDir private static Path testDir; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/metrics/TestDatanodeQueueMetrics.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/metrics/TestDatanodeQueueMetrics.java index cfcc5cbb728b..f5ad29271ff5 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/metrics/TestDatanodeQueueMetrics.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/metrics/TestDatanodeQueueMetrics.java @@ -29,13 +29,11 @@ import org.apache.ozone.test.NonHATests; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; /** * Test for queue metrics of datanodes. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public abstract class TestDatanodeQueueMetrics implements NonHATests.TestCase { @Test diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/ozoneimpl/TestOzoneContainer.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/ozoneimpl/TestOzoneContainer.java index a3b160656df8..06de119a1d23 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/ozoneimpl/TestOzoneContainer.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/ozoneimpl/TestOzoneContainer.java @@ -51,13 +51,11 @@ import org.apache.ozone.test.GenericTestUtils; import org.apache.ozone.test.tag.Flaky; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; /** * Tests ozone containers. */ -@Timeout(300) public class TestOzoneContainer { @TempDir private Path tempDir; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/ozoneimpl/TestOzoneContainerWithTLS.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/ozoneimpl/TestOzoneContainerWithTLS.java index 0b3294b91384..934cd21088f2 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/ozoneimpl/TestOzoneContainerWithTLS.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/ozoneimpl/TestOzoneContainerWithTLS.java @@ -87,7 +87,6 @@ import org.apache.ozone.test.GenericTestUtils.LogCapturer; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -96,7 +95,6 @@ /** * Tests ozone containers via secure grpc/netty. */ -@Timeout(300) public class TestOzoneContainerWithTLS { private static final int CERT_LIFETIME = 10; // seconds diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/ozoneimpl/TestSecureOzoneContainer.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/ozoneimpl/TestSecureOzoneContainer.java index 4b996355309f..c2edd87a2b57 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/ozoneimpl/TestSecureOzoneContainer.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/ozoneimpl/TestSecureOzoneContainer.java @@ -63,7 +63,6 @@ import org.apache.ratis.util.ExitUtils; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -74,7 +73,6 @@ /** * Tests ozone containers via secure grpc/netty. */ -@Timeout(300) class TestSecureOzoneContainer { private static final Logger LOG = LoggerFactory.getLogger( TestSecureOzoneContainer.class); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/replication/TestContainerReplication.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/replication/TestContainerReplication.java index 58eb7ee86b53..68fecdb52d3e 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/replication/TestContainerReplication.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/replication/TestContainerReplication.java @@ -50,14 +50,12 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; /** * Tests ozone containers replication. */ -@Timeout(300) class TestContainerReplication { private static final AtomicLong CONTAINER_ID = new AtomicLong(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/dn/ratis/TestDnRatisLogParser.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/dn/ratis/TestDnRatisLogParser.java index 4080bd473aea..4de55ce64851 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/dn/ratis/TestDnRatisLogParser.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/dn/ratis/TestDnRatisLogParser.java @@ -34,12 +34,10 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test Datanode Ratis log parser. */ -@Timeout(300) public class TestDnRatisLogParser { private MiniOzoneCluster cluster = null; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/dn/scanner/TestContainerScannerIntegrationAbstract.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/dn/scanner/TestContainerScannerIntegrationAbstract.java index f17541dac880..d2777e50e3a0 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/dn/scanner/TestContainerScannerIntegrationAbstract.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/dn/scanner/TestContainerScannerIntegrationAbstract.java @@ -72,12 +72,10 @@ import org.apache.ozone.test.GenericTestUtils.LogCapturer; import org.apache.ozone.test.LambdaTestUtils; import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.Timeout; /** * This class tests the data scanner functionality. */ -@Timeout(300) public abstract class TestContainerScannerIntegrationAbstract { private static MiniOzoneCluster cluster; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/dn/volume/TestDatanodeHddsVolumeFailureDetection.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/dn/volume/TestDatanodeHddsVolumeFailureDetection.java index 2df44848d002..7c093abe8cc3 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/dn/volume/TestDatanodeHddsVolumeFailureDetection.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/dn/volume/TestDatanodeHddsVolumeFailureDetection.java @@ -63,14 +63,12 @@ import org.apache.hadoop.ozone.container.keyvalue.KeyValueContainerData; import org.apache.hadoop.ozone.container.ozoneimpl.OzoneContainer; import org.apache.hadoop.ozone.dn.DatanodeTestUtils; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; /** * This class tests datanode can detect failed volumes. */ -@Timeout(300) class TestDatanodeHddsVolumeFailureDetection { private static final int KEY_SIZE = 128; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/dn/volume/TestDatanodeHddsVolumeFailureToleration.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/dn/volume/TestDatanodeHddsVolumeFailureToleration.java index be958dae9dae..87897d0020f7 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/dn/volume/TestDatanodeHddsVolumeFailureToleration.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/dn/volume/TestDatanodeHddsVolumeFailureToleration.java @@ -52,12 +52,10 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * This class tests datanode can tolerate configured num of failed volumes. */ -@Timeout(300) public class TestDatanodeHddsVolumeFailureToleration { private MiniOzoneCluster cluster; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestDataValidateWithDummyContainers.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestDataValidateWithDummyContainers.java index 85fb55a01a74..05a762313c00 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestDataValidateWithDummyContainers.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestDataValidateWithDummyContainers.java @@ -17,14 +17,12 @@ package org.apache.hadoop.ozone.freon; -import java.util.concurrent.TimeUnit; import org.apache.hadoop.hdds.HddsConfigKeys; import org.apache.hadoop.hdds.conf.OzoneConfiguration; import org.apache.hadoop.ozone.OzoneConfigKeys; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -33,7 +31,6 @@ * Data validation is disabled in RandomKeyGenerator. */ -@Timeout(value = 300, unit = TimeUnit.SECONDS) public class TestDataValidateWithDummyContainers extends TestDataValidate { private static final Logger LOG = diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestDataValidateWithSafeByteOperations.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestDataValidateWithSafeByteOperations.java index aa1f3fb298b3..7902e5374a56 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestDataValidateWithSafeByteOperations.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestDataValidateWithSafeByteOperations.java @@ -17,18 +17,15 @@ package org.apache.hadoop.ozone.freon; -import java.util.concurrent.TimeUnit; import org.apache.hadoop.hdds.conf.OzoneConfiguration; import org.apache.hadoop.ozone.OzoneConfigKeys; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Timeout; /** * Tests Freon, with MiniOzoneCluster and validate data. */ -@Timeout(value = 300, unit = TimeUnit.SECONDS) public class TestDataValidateWithSafeByteOperations extends TestDataValidate { /** diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestDataValidateWithUnsafeByteOperations.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestDataValidateWithUnsafeByteOperations.java index fb939ab78575..022878a8dc56 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestDataValidateWithUnsafeByteOperations.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestDataValidateWithUnsafeByteOperations.java @@ -17,17 +17,14 @@ package org.apache.hadoop.ozone.freon; -import java.util.concurrent.TimeUnit; import org.apache.hadoop.hdds.conf.OzoneConfiguration; import org.apache.hadoop.ozone.OzoneConfigKeys; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Timeout; /** * Tests Freon, with MiniOzoneCluster and validate data. */ -@Timeout(value = 300, unit = TimeUnit.SECONDS) public class TestDataValidateWithUnsafeByteOperations extends TestDataValidate { /** diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestFreonWithDatanodeFastRestart.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestFreonWithDatanodeFastRestart.java index 99ae3d11d287..31f9f81f94fd 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestFreonWithDatanodeFastRestart.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestFreonWithDatanodeFastRestart.java @@ -33,13 +33,11 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import picocli.CommandLine; /** * Tests Freon with Datanode restarts without waiting for pipeline to close. */ -@Timeout(value = 300, unit = TimeUnit.SECONDS) public class TestFreonWithDatanodeFastRestart { private static MiniOzoneCluster cluster; private static OzoneConfiguration conf; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestRandomKeyGenerator.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestRandomKeyGenerator.java index c7f5cd235500..e7a5bf2f7906 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestRandomKeyGenerator.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestRandomKeyGenerator.java @@ -23,7 +23,6 @@ import org.apache.ozone.test.NonHATests; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import picocli.CommandLine; /** @@ -32,7 +31,6 @@ public abstract class TestRandomKeyGenerator implements NonHATests.TestCase { @Test - @Timeout(5) void singleFailedAttempt() { BaseFreonGenerator subject = new BaseFreonGenerator(); subject.setThreadNo(2); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java index 439bbb114001..2466614d4370 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java @@ -29,7 +29,6 @@ import java.util.List; import java.util.Map; import java.util.UUID; -import java.util.concurrent.TimeUnit; import org.apache.hadoop.hdds.client.ReplicationFactor; import org.apache.hadoop.hdds.client.ReplicationType; import org.apache.hadoop.hdds.conf.OzoneConfiguration; @@ -50,13 +49,11 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; /** * Test cases for ContainerMapper. */ -@Timeout(value = 300, unit = TimeUnit.SECONDS) public class TestContainerMapper { @TempDir private static Path dbPath; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestAddRemoveOzoneManager.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestAddRemoveOzoneManager.java index a202fe9cc40e..474878edddef 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestAddRemoveOzoneManager.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestAddRemoveOzoneManager.java @@ -64,13 +64,11 @@ import org.apache.ratis.server.leader.FollowerInfo; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.slf4j.event.Level; /** * Test for OM bootstrap process. */ -@Timeout(500) public class TestAddRemoveOzoneManager { private MiniOzoneHAClusterImpl cluster = null; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestBucketLayoutWithOlderClient.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestBucketLayoutWithOlderClient.java index e3f41555ab68..08961fc47739 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestBucketLayoutWithOlderClient.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestBucketLayoutWithOlderClient.java @@ -37,13 +37,11 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; /** * Tests to verify bucket ops with older version client. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(1200) public abstract class TestBucketLayoutWithOlderClient implements NonHATests.TestCase { private MiniOzoneCluster cluster; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestBucketOwner.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestBucketOwner.java index 23f21a7e80d3..918e738c43cb 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestBucketOwner.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestBucketOwner.java @@ -43,13 +43,11 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; /** * Test for Ozone Bucket Owner. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(120) public abstract class TestBucketOwner implements NonHATests.TestCase { private static final String UNIQUE = UUID.randomUUID().toString(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestKeyManagerImpl.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestKeyManagerImpl.java index 0679fcf24f35..4af8022bd1db 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestKeyManagerImpl.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestKeyManagerImpl.java @@ -137,7 +137,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -147,7 +146,6 @@ /** * Test class for @{@link KeyManagerImpl}. */ -@Timeout(300) public class TestKeyManagerImpl { @TempDir private static File dir; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestKeyPurging.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestKeyPurging.java index 96da1ce901bd..17d4d40a0967 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestKeyPurging.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestKeyPurging.java @@ -43,12 +43,10 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test OM's {@link KeyDeletingService}. */ -@Timeout(300) public class TestKeyPurging { private MiniOzoneCluster cluster; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListKeys.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListKeys.java index c8ffbd2602bf..8772216b8228 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListKeys.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListKeys.java @@ -46,7 +46,6 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -56,7 +55,6 @@ * in a legacy/OBS bucket layout type. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(1200) public abstract class TestListKeys implements NonHATests.TestCase { private OzoneBucket legacyOzoneBucket; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListKeysWithFSO.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListKeysWithFSO.java index fd76512181b9..4e4944db871d 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListKeysWithFSO.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListKeysWithFSO.java @@ -46,14 +46,12 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; /** * Test covers listKeys(keyPrefix, startKey) combinations * in a FSO bucket layout type. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(1200) public abstract class TestListKeysWithFSO implements NonHATests.TestCase { private OzoneBucket legacyOzoneBucket; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListStatus.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListStatus.java index e6b6f7a8de40..2e4f2362f83a 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListStatus.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestListStatus.java @@ -40,7 +40,6 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -51,7 +50,6 @@ * A simple test that asserts that list status output is sorted. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(1200) public abstract class TestListStatus implements NonHATests.TestCase { private static final Logger LOG = LoggerFactory.getLogger(TestListStatus.class); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMBucketLayoutUpgrade.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMBucketLayoutUpgrade.java index 02aa3966676c..2c0e65ac762c 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMBucketLayoutUpgrade.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMBucketLayoutUpgrade.java @@ -51,7 +51,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; import org.junit.jupiter.api.TestMethodOrder; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; import org.junit.jupiter.params.provider.MethodSource; @@ -72,7 +71,6 @@ */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) @TestMethodOrder(MethodOrderer.OrderAnnotation.class) -@Timeout(300) class TestOMBucketLayoutUpgrade { private static final int PRE_UPGRADE = 100; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMDbCheckpointServlet.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMDbCheckpointServlet.java index 084dbded41de..e0b2a8129e0f 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMDbCheckpointServlet.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMDbCheckpointServlet.java @@ -117,13 +117,11 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; /** * Class used for testing the OM DB Checkpoint provider servlet. */ -@Timeout(240) public class TestOMDbCheckpointServlet { public static final String JAVA_IO_TMPDIR = "java.io.tmpdir"; private OzoneConfiguration conf; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java index c1b2d002e11c..aa23fe428b73 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java @@ -92,7 +92,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.rocksdb.RocksDB; import org.rocksdb.RocksDBException; @@ -102,7 +101,6 @@ /** * Tests the Ratis snapshots feature in OM. */ -@Timeout(5000) public class TestOMRatisSnapshots { private MiniOzoneHAClusterImpl cluster = null; @@ -386,7 +384,6 @@ private void checkSnapshot(OzoneManager leaderOM, OzoneManager followerOM, } @Test - @Timeout(300) public void testInstallIncrementalSnapshot(@TempDir Path tempDir) throws Exception { // Get the leader OM @@ -598,7 +595,6 @@ private IncrementData getNextIncrementalTarball( } @Test - @Timeout(300) public void testInstallIncrementalSnapshotWithFailure() throws Exception { // Get the leader OM String leaderOMNodeId = OmFailoverProxyUtil diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMStartupWithBucketLayout.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMStartupWithBucketLayout.java index f51778826687..aec305cc282f 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMStartupWithBucketLayout.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMStartupWithBucketLayout.java @@ -28,12 +28,10 @@ import org.apache.hadoop.ozone.client.OzoneClient; import org.apache.hadoop.ozone.om.helpers.BucketLayout; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Verifies OM startup with different layout. */ -@Timeout(300) public class TestOMStartupWithBucketLayout { private static MiniOzoneCluster cluster; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestObjectStore.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestObjectStore.java index 7ddca1c2a68e..aef51042927f 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestObjectStore.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestObjectStore.java @@ -36,13 +36,11 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; /** * Tests to verify Object store without prefix enabled. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(1200) public abstract class TestObjectStore implements NonHATests.TestCase { private OzoneConfiguration conf; private OzoneClient client; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestObjectStoreWithFSO.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestObjectStoreWithFSO.java index 244941488cb7..e6d3985a34d3 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestObjectStoreWithFSO.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestObjectStoreWithFSO.java @@ -79,13 +79,11 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; /** * Tests to verify Object store with prefix enabled cases. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(1200) public abstract class TestObjectStoreWithFSO implements NonHATests.TestCase { private static final Path ROOT = new Path(OZONE_URI_DELIMITER); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestObjectStoreWithLegacyFS.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestObjectStoreWithLegacyFS.java index 91b65dba5d8e..5b64e4b25c0e 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestObjectStoreWithLegacyFS.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestObjectStoreWithLegacyFS.java @@ -58,7 +58,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -66,7 +65,6 @@ * Test verifies object store with OZONE_OM_ENABLE_FILESYSTEM_PATHS enabled. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(200) public abstract class TestObjectStoreWithLegacyFS implements NonHATests.TestCase { private OzoneClient client; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmAcls.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmAcls.java index 043b9f90d108..6ddbf4506ec3 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmAcls.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmAcls.java @@ -51,12 +51,10 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test for Ozone Manager ACLs. */ -@Timeout(300) public class TestOmAcls { private static OzoneAccessAuthorizerTest authorizer; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmBlockVersioning.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmBlockVersioning.java index 470b66b6e35a..243f7674ee72 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmBlockVersioning.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmBlockVersioning.java @@ -41,13 +41,11 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; /** * This class tests the versioning of blocks from OM side. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public abstract class TestOmBlockVersioning implements NonHATests.TestCase { private OzoneClient client; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmContainerLocationCache.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmContainerLocationCache.java index 0ea807d74442..a53f5a926f1f 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmContainerLocationCache.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmContainerLocationCache.java @@ -115,7 +115,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -132,7 +131,6 @@ * This integration verifies clients and OM using mocked Datanode and SCM * protocols. */ -@Timeout(300) public class TestOmContainerLocationCache { @TempDir private static File dir; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java index 2e281f506c2c..0b9915d11973 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java @@ -26,12 +26,10 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test Ozone Manager Init. */ -@Timeout(300) public class TestOmInit { private static MiniOzoneCluster cluster = null; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmMetrics.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmMetrics.java index cb594e963e3c..683def250979 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmMetrics.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmMetrics.java @@ -86,7 +86,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; @@ -94,7 +93,6 @@ * Test for OM metrics. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public class TestOmMetrics { private MiniOzoneCluster cluster; private MiniOzoneCluster.Builder clusterBuilder; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerConfiguration.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerConfiguration.java index 930cb6eff034..a05e944514d2 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerConfiguration.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerConfiguration.java @@ -47,13 +47,11 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; /** * Tests OM related configurations. */ -@Timeout(300) public class TestOzoneManagerConfiguration { private OzoneConfiguration conf; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHA.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHA.java index 4f291b7de715..dd75a0870651 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHA.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHA.java @@ -68,12 +68,10 @@ import org.apache.hadoop.ozone.security.acl.OzoneObj; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Timeout; /** * Base class for Ozone Manager HA tests. */ -@Timeout(300) public abstract class TestOzoneManagerHA { private static MiniOzoneHAClusterImpl cluster = null; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerListVolumes.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerListVolumes.java index 5e5b64ebcd27..0b03fd0cacde 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerListVolumes.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerListVolumes.java @@ -52,7 +52,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -60,7 +59,6 @@ * Test OzoneManager list volume operation under combinations of configs. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(120) public abstract class TestOzoneManagerListVolumes implements NonHATests.TestCase { private static final String UNIQUE = UUID.randomUUID().toString(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerListVolumesSecure.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerListVolumesSecure.java index a6980af6b5b0..4ddd10b70589 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerListVolumesSecure.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerListVolumesSecure.java @@ -60,7 +60,6 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -69,7 +68,6 @@ * Test OzoneManager list volume operation under combinations of configs * in secure mode. */ -@Timeout(1200) public class TestOzoneManagerListVolumesSecure { private static final Logger LOG = LoggerFactory.getLogger(TestOzoneManagerListVolumesSecure.class); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerRestInterface.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerRestInterface.java index fb145e0921ca..973a5b1482cf 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerRestInterface.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerRestInterface.java @@ -43,13 +43,11 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; /** * This class is to test the REST interface exposed by OzoneManager. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public abstract class TestOzoneManagerRestInterface implements NonHATests.TestCase { private MiniOzoneCluster cluster; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerRestart.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerRestart.java index 8b709d5e4173..75a07309f337 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerRestart.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerRestart.java @@ -49,13 +49,11 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test some client operations after cluster starts. And perform restart and * then performs client operations and check the behavior is expected or not. */ -@Timeout(240) public class TestOzoneManagerRestart { private static MiniOzoneCluster cluster = null; private static OzoneConfiguration conf; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerRocksDBLogging.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerRocksDBLogging.java index 3bb182dbf037..8c0b3ff4e4b0 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerRocksDBLogging.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerRocksDBLogging.java @@ -29,12 +29,10 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test RocksDB logging for Ozone Manager. */ -@Timeout(100) public class TestOzoneManagerRocksDBLogging { private MiniOzoneCluster cluster = null; private OzoneConfiguration conf; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestRecursiveAclWithFSO.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestRecursiveAclWithFSO.java index 32ed52a17aee..c609de6eea35 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestRecursiveAclWithFSO.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestRecursiveAclWithFSO.java @@ -48,12 +48,10 @@ import org.apache.ozone.test.AclTests; import org.apache.ozone.test.NonHATests; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test recursive acl checks for delete and rename for FSO Buckets. */ -@Timeout(120) public abstract class TestRecursiveAclWithFSO implements NonHATests.TestCase { private static final String UNIQUE = UUID.randomUUID().toString(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestScmSafeMode.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestScmSafeMode.java index 7e8401a04909..90c67133ac5c 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestScmSafeMode.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestScmSafeMode.java @@ -73,14 +73,12 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Test Ozone Manager operation in distributed handler scenario. */ -@Timeout(300) @Unhealthy("HDDS-3260") public class TestScmSafeMode { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestSecureOzoneManager.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestSecureOzoneManager.java index c44f8edcdcfe..e495976d44c7 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestSecureOzoneManager.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestSecureOzoneManager.java @@ -49,13 +49,11 @@ import org.apache.hadoop.security.ssl.KeyStoreTestUtil; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; /** * Test secure Ozone Manager operation in distributed handler scenario. */ -@Timeout(25) class TestSecureOzoneManager { private static final String COMPONENT = "om"; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/service/TestRangerBGSyncService.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/service/TestRangerBGSyncService.java index aaa10b30f5f6..701ca2c47613 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/service/TestRangerBGSyncService.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/service/TestRangerBGSyncService.java @@ -81,7 +81,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -92,7 +91,6 @@ * Marking it as Ignore because it needs Ranger access point. */ @Unhealthy("Requires a Ranger endpoint") -@Timeout(180) public class TestRangerBGSyncService { private static final Logger LOG = LoggerFactory.getLogger(TestRangerBGSyncService.class); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotDisabled.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotDisabled.java index ae2a96e0181b..b942f3200c75 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotDisabled.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotDisabled.java @@ -37,7 +37,6 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Integration test to verify Ozone snapshot RPCs throw exception when called. @@ -49,7 +48,6 @@ public class TestOmSnapshotDisabled { private static ObjectStore store; @BeforeAll - @Timeout(60) public static void init() throws Exception { OzoneConfiguration conf = new OzoneConfiguration(); conf.set(OMConfigKeys.OZONE_DEFAULT_BUCKET_LAYOUT, diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotDisabledRestart.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotDisabledRestart.java index 823eb315fa14..30ff484e9ff3 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotDisabledRestart.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotDisabledRestart.java @@ -34,7 +34,6 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Integration test to verify that if snapshot feature is disabled, OM start up @@ -48,7 +47,6 @@ public class TestOmSnapshotDisabledRestart { private static ObjectStore store; @BeforeAll - @Timeout(60) public static void init() throws Exception { OzoneConfiguration conf = new OzoneConfiguration(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystem.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystem.java index b1747556dc7d..b24c890f1598 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystem.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystem.java @@ -92,14 +92,12 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Abstract class for OmSnapshot file system tests. */ -@Timeout(120) @TestInstance(TestInstance.Lifecycle.PER_CLASS) public abstract class TestOmSnapshotFileSystem { protected static final String VOLUME_NAME = diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFso.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFso.java index 5f010285bc9d..4e02643ccc11 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFso.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFso.java @@ -17,12 +17,10 @@ package org.apache.hadoop.ozone.om.snapshot; -import org.junit.jupiter.api.Timeout; /** * OmSnapshot file system tests for FSO. */ -@Timeout(120) public class TestOmSnapshotFileSystemFso extends TestOmSnapshotFileSystem { TestOmSnapshotFileSystemFso() throws Exception { super(BUCKET_NAME_FSO, false); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFsoWithLinkedBuckets.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFsoWithLinkedBuckets.java index 0575a6c96fb5..96cc7d24f47b 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFsoWithLinkedBuckets.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFsoWithLinkedBuckets.java @@ -17,12 +17,10 @@ package org.apache.hadoop.ozone.om.snapshot; -import org.junit.jupiter.api.Timeout; /** * OmSnapshot file system tests for FSO. */ -@Timeout(120) public class TestOmSnapshotFileSystemFsoWithLinkedBuckets extends TestOmSnapshotFileSystem { TestOmSnapshotFileSystemFsoWithLinkedBuckets() throws Exception { super(BUCKET_NAME_FSO, true); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacy.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacy.java index be20cdf3fb12..d6a2750704c3 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacy.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacy.java @@ -17,12 +17,10 @@ package org.apache.hadoop.ozone.om.snapshot; -import org.junit.jupiter.api.Timeout; /** * OmSnapshot file system tests for Legacy. */ -@Timeout(120) public class TestOmSnapshotFileSystemLegacy extends TestOmSnapshotFileSystem { TestOmSnapshotFileSystemLegacy() throws Exception { super(BUCKET_NAME_LEGACY, false); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacyWithLinkedBuckets.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacyWithLinkedBuckets.java index 647c4392c740..eb6d71e73a9b 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacyWithLinkedBuckets.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacyWithLinkedBuckets.java @@ -17,12 +17,10 @@ package org.apache.hadoop.ozone.om.snapshot; -import org.junit.jupiter.api.Timeout; /** * OmSnapshot file system tests for Legacy. */ -@Timeout(120) public class TestOmSnapshotFileSystemLegacyWithLinkedBuckets extends TestOmSnapshotFileSystem { TestOmSnapshotFileSystemLegacyWithLinkedBuckets() throws Exception { super(BUCKET_NAME_LEGACY, true); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithNativeLib.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithNativeLib.java index d8d241190579..5fb86f5b162d 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithNativeLib.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithNativeLib.java @@ -20,14 +20,12 @@ import static org.apache.hadoop.hdds.utils.NativeConstants.ROCKS_TOOLS_NATIVE_PROPERTY; import static org.apache.hadoop.ozone.om.helpers.BucketLayout.FILE_SYSTEM_OPTIMIZED; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.condition.EnabledIfSystemProperty; /** * Test OmSnapshot for FSO bucket type when native lib is enabled. */ @EnabledIfSystemProperty(named = ROCKS_TOOLS_NATIVE_PROPERTY, matches = "true") -@Timeout(300) class TestOmSnapshotFsoWithNativeLib extends TestOmSnapshot { TestOmSnapshotFsoWithNativeLib() throws Exception { super(FILE_SYSTEM_OPTIMIZED, false, false, false, false); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithNativeLibWithLinkedBuckets.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithNativeLibWithLinkedBuckets.java index 0b1cf3abbfd3..bda8d79c5ca8 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithNativeLibWithLinkedBuckets.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithNativeLibWithLinkedBuckets.java @@ -20,14 +20,12 @@ import static org.apache.hadoop.hdds.utils.NativeConstants.ROCKS_TOOLS_NATIVE_PROPERTY; import static org.apache.hadoop.ozone.om.helpers.BucketLayout.FILE_SYSTEM_OPTIMIZED; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.condition.EnabledIfSystemProperty; /** * Test OmSnapshot for FSO bucket type when native lib is enabled. */ @EnabledIfSystemProperty(named = ROCKS_TOOLS_NATIVE_PROPERTY, matches = "true") -@Timeout(300) class TestOmSnapshotFsoWithNativeLibWithLinkedBuckets extends TestOmSnapshot { TestOmSnapshotFsoWithNativeLibWithLinkedBuckets() throws Exception { super(FILE_SYSTEM_OPTIMIZED, false, false, false, true); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLib.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLib.java index 0eb5b103fb6b..6244efc2c816 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLib.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLib.java @@ -19,12 +19,10 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.FILE_SYSTEM_OPTIMIZED; -import org.junit.jupiter.api.Timeout; /** * Test OmSnapshot for FSO bucket type when native lib is disabled. */ -@Timeout(300) public class TestOmSnapshotFsoWithoutNativeLib extends TestOmSnapshot { public TestOmSnapshotFsoWithoutNativeLib() throws Exception { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets.java index c7a1a609380d..ec53c91e11ef 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets.java @@ -19,12 +19,10 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.FILE_SYSTEM_OPTIMIZED; -import org.junit.jupiter.api.Timeout; /** * Test OmSnapshot for FSO bucket type when native lib is disabled. */ -@Timeout(300) public class TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets extends TestOmSnapshot { public TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets() throws Exception { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStore.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStore.java index 8781d1c48419..81e4a7d7e670 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStore.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStore.java @@ -19,12 +19,10 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.OBJECT_STORE; -import org.junit.jupiter.api.Timeout; /** * Test OmSnapshot for Object Store bucket type. */ -@Timeout(300) public class TestOmSnapshotObjectStore extends TestOmSnapshot { public TestOmSnapshotObjectStore() throws Exception { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStoreWithLinkedBuckets.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStoreWithLinkedBuckets.java index 22a9c8af1f14..b6c734f57a1f 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStoreWithLinkedBuckets.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStoreWithLinkedBuckets.java @@ -19,12 +19,10 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.OBJECT_STORE; -import org.junit.jupiter.api.Timeout; /** * Test OmSnapshot for Object Store bucket type. */ -@Timeout(300) public class TestOmSnapshotObjectStoreWithLinkedBuckets extends TestOmSnapshot { public TestOmSnapshotObjectStoreWithLinkedBuckets() throws Exception { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithBucketLinkingLegacy.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithBucketLinkingLegacy.java index ae994e5dfc8c..342210e125ee 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithBucketLinkingLegacy.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithBucketLinkingLegacy.java @@ -19,12 +19,10 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.LEGACY; -import org.junit.jupiter.api.Timeout; /** * Test OmSnapshot for Legacy bucket type. */ -@Timeout(300) public class TestOmSnapshotWithBucketLinkingLegacy extends TestOmSnapshot { public TestOmSnapshotWithBucketLinkingLegacy() throws Exception { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithoutBucketLinkingLegacy.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithoutBucketLinkingLegacy.java index ad1e5ade825d..1dc4489b0633 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithoutBucketLinkingLegacy.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithoutBucketLinkingLegacy.java @@ -19,12 +19,10 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.LEGACY; -import org.junit.jupiter.api.Timeout; /** * Test OmSnapshot for Legacy bucket type. */ -@Timeout(300) public class TestOmSnapshotWithoutBucketLinkingLegacy extends TestOmSnapshot { public TestOmSnapshotWithoutBucketLinkingLegacy() throws Exception { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerHASnapshot.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerHASnapshot.java index 3d4bc628e2e1..874044c75ddb 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerHASnapshot.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerHASnapshot.java @@ -61,12 +61,10 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Tests snapshot in OM HA setup. */ -@Timeout(300) public class TestOzoneManagerHASnapshot { private static MiniOzoneHAClusterImpl cluster; private static OzoneClient client; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerSnapshotAcl.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerSnapshotAcl.java index 662c328a84d3..30a9ed81b41c 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerSnapshotAcl.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerSnapshotAcl.java @@ -61,7 +61,6 @@ import org.apache.ozone.test.tag.Flaky; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.EnumSource; @@ -70,7 +69,6 @@ /** * Test for Snapshot feature with ACL. */ -@Timeout(value = 300) public class TestOzoneManagerSnapshotAcl { private static final String ADMIN_USER = "om"; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerSnapshotProvider.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerSnapshotProvider.java index 9fbd18eb8b77..594ca7a9536e 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerSnapshotProvider.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerSnapshotProvider.java @@ -38,12 +38,10 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test OM's snapshot provider service. */ -@Timeout(300) public class TestOzoneManagerSnapshotProvider { private MiniOzoneHAClusterImpl cluster = null; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneSnapshotRestore.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneSnapshotRestore.java index 3123aac438b8..6c67554d7b8d 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneSnapshotRestore.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneSnapshotRestore.java @@ -57,7 +57,6 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -66,7 +65,6 @@ * Tests Snapshot Restore function. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(value = 300) public class TestOzoneSnapshotRestore { private static final String OM_SERVICE_ID = "om-service-test-1"; private MiniOzoneHAClusterImpl cluster; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestSnapshotBackgroundServices.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestSnapshotBackgroundServices.java index 33f963b59a32..0983ff06a3f1 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestSnapshotBackgroundServices.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestSnapshotBackgroundServices.java @@ -84,12 +84,10 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; -import org.junit.jupiter.api.Timeout; /** * Tests snapshot background services. */ -@Timeout(5000) public class TestSnapshotBackgroundServices { private MiniOzoneHAClusterImpl cluster; private ObjectStore objectStore; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestSnapshotDeletingServiceIntegrationTest.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestSnapshotDeletingServiceIntegrationTest.java index 140f4ae427f2..dddfd9717749 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestSnapshotDeletingServiceIntegrationTest.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestSnapshotDeletingServiceIntegrationTest.java @@ -86,7 +86,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; import org.junit.jupiter.api.TestMethodOrder; -import org.junit.jupiter.api.Timeout; import org.mockito.Mockito; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -95,7 +94,6 @@ * Test Snapshot Deleting Service. */ -@Timeout(300) @TestInstance(TestInstance.Lifecycle.PER_CLASS) @TestMethodOrder(OrderAnnotation.class) public class TestSnapshotDeletingServiceIntegrationTest { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestSnapshotDirectoryCleaningService.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestSnapshotDirectoryCleaningService.java index a8f8aeb1ce8e..3f6e007ef4ad 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestSnapshotDirectoryCleaningService.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestSnapshotDirectoryCleaningService.java @@ -56,14 +56,12 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Test Snapshot Directory Service. */ -@Timeout(300) public class TestSnapshotDirectoryCleaningService { private static final Logger LOG = diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/parser/TestOzoneHARatisLogParser.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/parser/TestOzoneHARatisLogParser.java index 16ff09aef0a9..35891353b1e1 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/parser/TestOzoneHARatisLogParser.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/parser/TestOzoneHARatisLogParser.java @@ -46,13 +46,11 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test Ozone OM and SCM HA Ratis log parser. */ @Flaky("HDDS-7008") -@Timeout(300) class TestOzoneHARatisLogParser { private MiniOzoneHAClusterImpl cluster = null; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconAndAdminContainerCLI.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconAndAdminContainerCLI.java index 3f7ea803775e..1913b1738487 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconAndAdminContainerCLI.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconAndAdminContainerCLI.java @@ -89,7 +89,6 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -101,7 +100,6 @@ * Integration tests for ensuring Recon's consistency * with the "ozone admin container" CLI. */ -@Timeout(300) class TestReconAndAdminContainerCLI { private static final Logger LOG = LoggerFactory.getLogger(TestReconAndAdminContainerCLI.class); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconAsPassiveScm.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconAsPassiveScm.java index d4128554ee22..93c6e17dbaa8 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconAsPassiveScm.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconAsPassiveScm.java @@ -51,13 +51,11 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.slf4j.event.Level; /** * Recon's passive SCM integration tests. */ -@Timeout(180) public class TestReconAsPassiveScm { private MiniOzoneCluster cluster; private OzoneConfiguration conf; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconScmSnapshot.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconScmSnapshot.java index ac52963b8258..658cbee5fcbe 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconScmSnapshot.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconScmSnapshot.java @@ -40,12 +40,10 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test Recon SCM Snapshot Download implementation. */ -@Timeout(100) public class TestReconScmSnapshot { private OzoneConfiguration conf; private MiniOzoneCluster ozoneCluster = null; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconTasks.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconTasks.java index a03175dd592e..f5ee2b4b053d 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconTasks.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconTasks.java @@ -52,13 +52,11 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.slf4j.event.Level; /** * Integration Tests for Recon's tasks. */ -@Timeout(300) public class TestReconTasks { private MiniOzoneCluster cluster = null; private OzoneConfiguration conf; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconWithOzoneManager.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconWithOzoneManager.java index 99e4400ea55e..adbbf7971c32 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconWithOzoneManager.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconWithOzoneManager.java @@ -69,12 +69,10 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test Ozone Recon. */ -@Timeout(300) public class TestReconWithOzoneManager { private static MiniOzoneCluster cluster = null; private static OzoneConfiguration conf; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconWithOzoneManagerFSO.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconWithOzoneManagerFSO.java index 41c8766c9f7d..e2e8485466a9 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconWithOzoneManagerFSO.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconWithOzoneManagerFSO.java @@ -45,12 +45,10 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test Ozone Recon. */ -@Timeout(300) public class TestReconWithOzoneManagerFSO { private static OzoneClient client; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconWithOzoneManagerHA.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconWithOzoneManagerHA.java index 7b9e07a8a6c5..7a6673b01e76 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconWithOzoneManagerHA.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/recon/TestReconWithOzoneManagerHA.java @@ -48,12 +48,10 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * This class sets up a MiniOzoneOMHACluster to test with Recon. */ -@Timeout(300) public class TestReconWithOzoneManagerHA { private MiniOzoneHAClusterImpl cluster; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/reconfig/ReconfigurationTestBase.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/reconfig/ReconfigurationTestBase.java index 112136964e83..c3a09484c882 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/reconfig/ReconfigurationTestBase.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/reconfig/ReconfigurationTestBase.java @@ -29,13 +29,11 @@ import org.apache.ozone.test.NonHATests; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; /** * Tests for Reconfiguration. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) abstract class ReconfigurationTestBase implements NonHATests.TestCase { private String currentUser; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestNSSummaryAdmin.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestNSSummaryAdmin.java index 7a205730191c..a4292eeab499 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestNSSummaryAdmin.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestNSSummaryAdmin.java @@ -36,12 +36,10 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test for Namespace CLI. */ -@Timeout(60) public class TestNSSummaryAdmin extends StandardOutputTestBase { private static ObjectStore store; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneDatanodeShell.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneDatanodeShell.java index ab0c54307f87..0b0ab2297ed7 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneDatanodeShell.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneDatanodeShell.java @@ -26,7 +26,6 @@ import org.apache.hadoop.ozone.HddsDatanodeService; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import picocli.CommandLine; @@ -39,7 +38,6 @@ /** * This test class specified for testing Ozone datanode shell command. */ -@Timeout(300) public class TestOzoneDatanodeShell { private static final Logger LOG = diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneShellHA.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneShellHA.java index b93111b8173f..5d6c5c87f2d9 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneShellHA.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneShellHA.java @@ -109,7 +109,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; import org.junit.jupiter.api.TestMethodOrder; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -128,7 +127,6 @@ * Inspired by TestS3Shell */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) @TestMethodOrder(OrderAnnotation.class) public class TestOzoneShellHA { @@ -1159,7 +1157,6 @@ public void testLinkBucketOrphan() throws Exception { } @Test - @Timeout(10) public void testListBucket() throws Exception { final String hostPrefix = OZONE_OFS_URI_SCHEME + "://" + omServiceId; OzoneConfiguration clientConf = diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java index 594f5cd47e25..38d237829265 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java @@ -59,7 +59,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -72,7 +71,6 @@ * TODO: HDDS-6338. Add a Kerberized version of this * TODO: HDDS-6336. Add a mock Ranger server to test Ranger HTTP endpoint calls */ -@Timeout(300) public class TestOzoneTenantShell { private static final Logger LOG = diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestReconfigShell.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestReconfigShell.java index d6001a2fd819..b43536f5bd72 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestReconfigShell.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestReconfigShell.java @@ -39,13 +39,11 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; /** * Integration test for {@code ozone admin reconfig} command. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) public abstract class TestReconfigShell implements NonHATests.TestCase { private OzoneAdmin ozoneAdmin; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestReplicationConfigPreference.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestReplicationConfigPreference.java index 13ed676f48d2..bc8936bfe36e 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestReplicationConfigPreference.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestReplicationConfigPreference.java @@ -52,7 +52,6 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -64,7 +63,6 @@ * Test the order of Replication config resolution. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(100) public abstract class TestReplicationConfigPreference implements NonHATests.TestCase { private static final Logger LOG = LoggerFactory.getLogger(TestReplicationConfigPreference.class); diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java index e76657b07cbc..255b9c5b4b91 100644 --- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java +++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java @@ -22,14 +22,12 @@ import org.apache.hadoop.hdds.conf.OzoneConfiguration; import org.apache.hadoop.ozone.protocolPB.OzoneManagerProtocolServerSideTranslatorPB; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Tests for GrpcOzoneManagerServer. */ -@Timeout(30) public class TestGrpcOzoneManagerServer { private static final Logger LOG = LoggerFactory.getLogger(TestGrpcOzoneManagerServer.class); diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerDoubleBufferWithDummyResponse.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerDoubleBufferWithDummyResponse.java index 3fa1e3a1a0af..656e002535c1 100644 --- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerDoubleBufferWithDummyResponse.java +++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerDoubleBufferWithDummyResponse.java @@ -45,14 +45,12 @@ import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; /** * This class tests OzoneManagerDoubleBuffer implementation with * dummy response class. */ -@Timeout(300) public class TestOzoneManagerDoubleBufferWithDummyResponse { private OMMetadataManager omMetadataManager; diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerRatisRequest.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerRatisRequest.java index 7226cf6e91fc..50ffa6c35388 100644 --- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerRatisRequest.java +++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerRatisRequest.java @@ -45,13 +45,11 @@ import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos; import org.apache.hadoop.ozone.protocolPB.OzoneManagerProtocolServerSideTranslatorPB; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; /** * Test OM Ratis request handling. */ -@Timeout(300) public class TestOzoneManagerRatisRequest { @TempDir private Path folder; diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestCompactionService.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestCompactionService.java index 32b41c9ff120..bd10bd59e552 100644 --- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestCompactionService.java +++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestCompactionService.java @@ -47,7 +47,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -94,7 +93,6 @@ void setup(@TempDir Path tempDir) { * * @throws IOException - on Failure. */ - @Timeout(300) @Test public void testCompactSuccessfully() throws Exception { @@ -117,7 +115,6 @@ public void testCompactSuccessfully() throws Exception { SERVICE_INTERVAL, WAIT_TIME); } - @Timeout(300) @Test public void testCompactSkipInvalidTable() throws Exception { @@ -151,7 +148,6 @@ public void testCompactSkipInvalidTable() throws Exception { SERVICE_INTERVAL, WAIT_TIME); } - @Timeout(300) @Test public void testCompactFailure() { diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestKeyDeletingService.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestKeyDeletingService.java index 2f2cee7f2f56..20a91080c50c 100644 --- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestKeyDeletingService.java +++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestKeyDeletingService.java @@ -90,7 +90,6 @@ import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.mockito.ArgumentMatchers; import org.mockito.Mockito; @@ -107,7 +106,6 @@ * and call into SCM. 4. Confirms that calls have been successful. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) class TestKeyDeletingService extends OzoneTestBase { private static final Logger LOG = LoggerFactory.getLogger(TestKeyDeletingService.class); diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestMultipartUploadCleanupService.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestMultipartUploadCleanupService.java index aaf3c267d902..780dc85da826 100644 --- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestMultipartUploadCleanupService.java +++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestMultipartUploadCleanupService.java @@ -58,7 +58,6 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.TestInstance; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; @@ -67,7 +66,6 @@ * Test Multipart Upload Cleanup Service. */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) -@Timeout(300) class TestMultipartUploadCleanupService { private OzoneManagerProtocol writeClient; private OzoneManager om; diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestOpenKeyCleanupService.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestOpenKeyCleanupService.java index 5d5677699c88..4de4197fe09f 100644 --- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestOpenKeyCleanupService.java +++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestOpenKeyCleanupService.java @@ -76,7 +76,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; import org.junit.jupiter.api.TestMethodOrder; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; @@ -150,7 +149,6 @@ void cleanup() { "0, 88, false", "66, 77, false" }) - @Timeout(300) public void testCleanupExpiredOpenKeys( int numDEFKeys, int numFSOKeys, boolean hsync) throws Exception { LOG.info("numDEFKeys={}, numFSOKeys={}, hsync? {}", @@ -207,7 +205,6 @@ public void testCleanupExpiredOpenKeys( * @throws IOException - on Failure. */ @Test - @Timeout(300) // Run this test first to avoid any lingering keys generated by other tests. @Order(1) public void testIgnoreExpiredRecoverhsyncKeys() throws Exception { diff --git a/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java b/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java index 93f321282118..33f3be12b873 100644 --- a/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java +++ b/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java @@ -33,14 +33,12 @@ import org.apache.hadoop.security.UserGroupInformation; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Tests for GrpcOmTransport. */ -@Timeout(3000) public class TestGrpcOmTransport { private static final Logger LOG = From e5bb4ff89ea9d914c91ee06d1702d60c047b12fc Mon Sep 17 00:00:00 2001 From: Chia-Chuan Yu Date: Mon, 28 Apr 2025 18:26:05 +0800 Subject: [PATCH 03/26] Fixed styles --- .../hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFso.java | 1 - .../snapshot/TestOmSnapshotFileSystemFsoWithLinkedBuckets.java | 1 - .../hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacy.java | 1 - .../TestOmSnapshotFileSystemLegacyWithLinkedBuckets.java | 1 - .../ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLib.java | 1 - .../TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets.java | 1 - .../hadoop/ozone/om/snapshot/TestOmSnapshotObjectStore.java | 1 - .../om/snapshot/TestOmSnapshotObjectStoreWithLinkedBuckets.java | 1 - .../ozone/om/snapshot/TestOmSnapshotWithBucketLinkingLegacy.java | 1 - .../om/snapshot/TestOmSnapshotWithoutBucketLinkingLegacy.java | 1 - 10 files changed, 10 deletions(-) diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFso.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFso.java index 4e02643ccc11..2f166bea0220 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFso.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFso.java @@ -17,7 +17,6 @@ package org.apache.hadoop.ozone.om.snapshot; - /** * OmSnapshot file system tests for FSO. */ diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFsoWithLinkedBuckets.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFsoWithLinkedBuckets.java index 96cc7d24f47b..05b665458543 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFsoWithLinkedBuckets.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFsoWithLinkedBuckets.java @@ -17,7 +17,6 @@ package org.apache.hadoop.ozone.om.snapshot; - /** * OmSnapshot file system tests for FSO. */ diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacy.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacy.java index d6a2750704c3..0266049394fa 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacy.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacy.java @@ -17,7 +17,6 @@ package org.apache.hadoop.ozone.om.snapshot; - /** * OmSnapshot file system tests for Legacy. */ diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacyWithLinkedBuckets.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacyWithLinkedBuckets.java index eb6d71e73a9b..e8935ecb9c28 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacyWithLinkedBuckets.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacyWithLinkedBuckets.java @@ -17,7 +17,6 @@ package org.apache.hadoop.ozone.om.snapshot; - /** * OmSnapshot file system tests for Legacy. */ diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLib.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLib.java index 6244efc2c816..149527f6f7bb 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLib.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLib.java @@ -19,7 +19,6 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.FILE_SYSTEM_OPTIMIZED; - /** * Test OmSnapshot for FSO bucket type when native lib is disabled. */ diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets.java index ec53c91e11ef..4d58158fb2ac 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets.java @@ -19,7 +19,6 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.FILE_SYSTEM_OPTIMIZED; - /** * Test OmSnapshot for FSO bucket type when native lib is disabled. */ diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStore.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStore.java index 81e4a7d7e670..723e752eb30e 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStore.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStore.java @@ -19,7 +19,6 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.OBJECT_STORE; - /** * Test OmSnapshot for Object Store bucket type. */ diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStoreWithLinkedBuckets.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStoreWithLinkedBuckets.java index b6c734f57a1f..ca264dae8909 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStoreWithLinkedBuckets.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStoreWithLinkedBuckets.java @@ -19,7 +19,6 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.OBJECT_STORE; - /** * Test OmSnapshot for Object Store bucket type. */ diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithBucketLinkingLegacy.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithBucketLinkingLegacy.java index 342210e125ee..62bc2d678871 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithBucketLinkingLegacy.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithBucketLinkingLegacy.java @@ -19,7 +19,6 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.LEGACY; - /** * Test OmSnapshot for Legacy bucket type. */ diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithoutBucketLinkingLegacy.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithoutBucketLinkingLegacy.java index 1dc4489b0633..ee301b4d76ac 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithoutBucketLinkingLegacy.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithoutBucketLinkingLegacy.java @@ -19,7 +19,6 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.LEGACY; - /** * Test OmSnapshot for Legacy bucket type. */ From 61bb1ed085e00287caf5489eed2444af91d61782 Mon Sep 17 00:00:00 2001 From: Chia-Chuan Yu Date: Mon, 28 Apr 2025 18:40:26 +0800 Subject: [PATCH 04/26] Restore to pass PMD --- .../container/common/volume/TestStorageVolumeChecker.java | 2 ++ .../ozone/container/common/volume/TestVolumeSetDiskChecks.java | 2 ++ .../container/keyvalue/TestKeyValueContainerMarkUnhealthy.java | 2 ++ .../java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java | 2 ++ .../java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java | 3 +++ .../java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java | 2 ++ .../src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java | 2 ++ .../org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java | 2 ++ .../org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java | 2 ++ .../apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java | 2 ++ 10 files changed, 21 insertions(+) diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java index bbcf50a6e1c8..424de5d78651 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java @@ -59,6 +59,7 @@ import org.apache.hadoop.util.FakeTimer; import org.apache.ozone.test.GenericTestUtils; import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -69,6 +70,7 @@ /** * Tests for {@link StorageVolumeChecker}. */ +@Timeout(300) public class TestStorageVolumeChecker { private static final Logger LOG = LoggerFactory.getLogger( TestStorageVolumeChecker.class); diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java index a88cc818770c..137537b711d4 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java @@ -64,6 +64,7 @@ import org.apache.hadoop.util.Timer; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -72,6 +73,7 @@ * Verify that {@link MutableVolumeSet} correctly checks for failed disks * during initialization. */ +@Timeout(300) public class TestVolumeSetDiskChecks { @TempDir private Path tempDir; diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerMarkUnhealthy.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerMarkUnhealthy.java index 85c9f574b525..06f56a192d34 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerMarkUnhealthy.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerMarkUnhealthy.java @@ -41,6 +41,7 @@ import org.apache.hadoop.ozone.container.common.volume.RoundRobinVolumeChoosingPolicy; import org.apache.hadoop.ozone.container.common.volume.VolumeSet; import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,6 +50,7 @@ * Tests unhealthy container functionality in the {@link KeyValueContainer} * class. */ +@Timeout(600) public class TestKeyValueContainerMarkUnhealthy { private static final Logger LOG = LoggerFactory.getLogger( TestKeyValueContainerMarkUnhealthy.class); diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java index fe3b6d9d4a30..d1335ae41c58 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java @@ -40,12 +40,14 @@ import org.apache.hadoop.net.NetUtils; import org.apache.hadoop.test.PathUtils; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Unit tests for {@link HddsServerUtil}. */ +@Timeout(300) public class TestHddsServerUtils { private static final Logger LOG = LoggerFactory.getLogger( TestHddsServerUtils.class); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java index 2466614d4370..439bbb114001 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java @@ -29,6 +29,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; +import java.util.concurrent.TimeUnit; import org.apache.hadoop.hdds.client.ReplicationFactor; import org.apache.hadoop.hdds.client.ReplicationType; import org.apache.hadoop.hdds.conf.OzoneConfiguration; @@ -49,11 +50,13 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; /** * Test cases for ContainerMapper. */ +@Timeout(value = 300, unit = TimeUnit.SECONDS) public class TestContainerMapper { @TempDir private static Path dbPath; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java index aa23fe428b73..b1bd804eb077 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java @@ -92,6 +92,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.rocksdb.RocksDB; import org.rocksdb.RocksDBException; @@ -101,6 +102,7 @@ /** * Tests the Ratis snapshots feature in OM. */ +@Timeout(5000) public class TestOMRatisSnapshots { private MiniOzoneHAClusterImpl cluster = null; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java index 0b9915d11973..2e281f506c2c 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java @@ -26,10 +26,12 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; /** * Test Ozone Manager Init. */ +@Timeout(300) public class TestOmInit { private static MiniOzoneCluster cluster = null; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java index 38d237829265..594f5cd47e25 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java @@ -59,6 +59,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -71,6 +72,7 @@ * TODO: HDDS-6338. Add a Kerberized version of this * TODO: HDDS-6336. Add a mock Ranger server to test Ranger HTTP endpoint calls */ +@Timeout(300) public class TestOzoneTenantShell { private static final Logger LOG = diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java index 255b9c5b4b91..e76657b07cbc 100644 --- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java +++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java @@ -22,12 +22,14 @@ import org.apache.hadoop.hdds.conf.OzoneConfiguration; import org.apache.hadoop.ozone.protocolPB.OzoneManagerProtocolServerSideTranslatorPB; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Tests for GrpcOzoneManagerServer. */ +@Timeout(30) public class TestGrpcOzoneManagerServer { private static final Logger LOG = LoggerFactory.getLogger(TestGrpcOzoneManagerServer.class); diff --git a/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java b/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java index 33f3be12b873..93f321282118 100644 --- a/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java +++ b/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java @@ -33,12 +33,14 @@ import org.apache.hadoop.security.UserGroupInformation; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Tests for GrpcOmTransport. */ +@Timeout(3000) public class TestGrpcOmTransport { private static final Logger LOG = From 3650abe14a17078df791ad01c3bc1a95a88e360c Mon Sep 17 00:00:00 2001 From: Chia-Chuan Yu Date: Mon, 28 Apr 2025 20:01:21 +0800 Subject: [PATCH 05/26] Revert changes --- .../ozone/container/common/volume/TestVolumeSetDiskChecks.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java index 137537b711d4..85e5fe1580cc 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java @@ -73,7 +73,7 @@ * Verify that {@link MutableVolumeSet} correctly checks for failed disks * during initialization. */ -@Timeout(300) +@Timeout(30) public class TestVolumeSetDiskChecks { @TempDir private Path tempDir; From b6b4c192a2e01d41199c6b9300d9cd5a484f3d65 Mon Sep 17 00:00:00 2001 From: Chia-Chuan Yu Date: Mon, 28 Apr 2025 21:18:00 +0800 Subject: [PATCH 06/26] Moved statements into pom file --- .../test/resources/junit-platform.properties | 18 ------------------ .../test/resources/junit-platform.properties | 18 ------------------ .../test/resources/junit-platform.properties | 18 ------------------ .../test/resources/junit-platform.properties | 18 ------------------ .../test/resources/junit-platform.properties | 18 ------------------ .../test/resources/junit-platform.properties | 18 ------------------ .../test/resources/junit-platform.properties | 18 ------------------ .../test/resources/junit-platform.properties | 18 ------------------ .../test/resources/junit-platform.properties | 18 ------------------ .../test/resources/junit-platform.properties | 18 ------------------ .../test/resources/junit-platform.properties | 18 ------------------ .../test/resources/junit-platform.properties | 18 ------------------ .../test/resources/junit-platform.properties | 18 ------------------ .../test/resources/junit-platform.properties | 18 ------------------ .../test/resources/junit-platform.properties | 18 ------------------ .../test/resources/junit-platform.properties | 18 ------------------ .../test/resources/junit-platform.properties | 18 ------------------ .../test/resources/junit-platform.properties | 18 ------------------ .../test/resources/junit-platform.properties | 18 ------------------ pom.xml | 3 ++- 20 files changed, 2 insertions(+), 343 deletions(-) delete mode 100644 hadoop-hdds/client/src/test/resources/junit-platform.properties delete mode 100644 hadoop-hdds/common/src/test/resources/junit-platform.properties delete mode 100644 hadoop-hdds/config/src/test/resources/junit-platform.properties delete mode 100644 hadoop-hdds/container-service/src/test/resources/junit-platform.properties delete mode 100644 hadoop-hdds/framework/src/test/resources/junit-platform.properties delete mode 100644 hadoop-hdds/rocks-native/src/test/resources/junit-platform.properties delete mode 100644 hadoop-hdds/rocksdb-checkpoint-differ/src/test/resources/junit-platform.properties delete mode 100644 hadoop-hdds/server-scm/src/test/resources/junit-platform.properties delete mode 100644 hadoop-hdds/test-utils/src/test/resources/junit-platform.properties delete mode 100644 hadoop-ozone/common/src/test/resources/junit-platform.properties delete mode 100644 hadoop-ozone/fault-injection-test/mini-chaos-tests/src/test/resources/junit-platform.properties delete mode 100644 hadoop-ozone/httpfsgateway/src/test/resources/junit-platform.properties delete mode 100644 hadoop-ozone/insight/src/test/resources/junit-platform.properties delete mode 100644 hadoop-ozone/integration-test-s3/src/test/resources/junit-platform.properties delete mode 100644 hadoop-ozone/integration-test/src/test/resources/junit-platform.properties delete mode 100644 hadoop-ozone/ozone-manager/src/test/resources/junit-platform.properties delete mode 100644 hadoop-ozone/ozonefs-common/src/test/resources/junit-platform.properties delete mode 100644 hadoop-ozone/s3gateway/src/test/resources/junit-platform.properties delete mode 100644 hadoop-ozone/tools/src/test/resources/junit-platform.properties diff --git a/hadoop-hdds/client/src/test/resources/junit-platform.properties b/hadoop-hdds/client/src/test/resources/junit-platform.properties deleted file mode 100644 index ae871152f910..000000000000 --- a/hadoop-hdds/client/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,18 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-hdds/common/src/test/resources/junit-platform.properties b/hadoop-hdds/common/src/test/resources/junit-platform.properties deleted file mode 100644 index ae871152f910..000000000000 --- a/hadoop-hdds/common/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,18 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-hdds/config/src/test/resources/junit-platform.properties b/hadoop-hdds/config/src/test/resources/junit-platform.properties deleted file mode 100644 index ae871152f910..000000000000 --- a/hadoop-hdds/config/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,18 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-hdds/container-service/src/test/resources/junit-platform.properties b/hadoop-hdds/container-service/src/test/resources/junit-platform.properties deleted file mode 100644 index ae871152f910..000000000000 --- a/hadoop-hdds/container-service/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,18 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-hdds/framework/src/test/resources/junit-platform.properties b/hadoop-hdds/framework/src/test/resources/junit-platform.properties deleted file mode 100644 index ae871152f910..000000000000 --- a/hadoop-hdds/framework/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,18 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-hdds/rocks-native/src/test/resources/junit-platform.properties b/hadoop-hdds/rocks-native/src/test/resources/junit-platform.properties deleted file mode 100644 index ae871152f910..000000000000 --- a/hadoop-hdds/rocks-native/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,18 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-hdds/rocksdb-checkpoint-differ/src/test/resources/junit-platform.properties b/hadoop-hdds/rocksdb-checkpoint-differ/src/test/resources/junit-platform.properties deleted file mode 100644 index ae871152f910..000000000000 --- a/hadoop-hdds/rocksdb-checkpoint-differ/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,18 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-hdds/server-scm/src/test/resources/junit-platform.properties b/hadoop-hdds/server-scm/src/test/resources/junit-platform.properties deleted file mode 100644 index ae871152f910..000000000000 --- a/hadoop-hdds/server-scm/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,18 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-hdds/test-utils/src/test/resources/junit-platform.properties b/hadoop-hdds/test-utils/src/test/resources/junit-platform.properties deleted file mode 100644 index ae871152f910..000000000000 --- a/hadoop-hdds/test-utils/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,18 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-ozone/common/src/test/resources/junit-platform.properties b/hadoop-ozone/common/src/test/resources/junit-platform.properties deleted file mode 100644 index ae871152f910..000000000000 --- a/hadoop-ozone/common/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,18 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-ozone/fault-injection-test/mini-chaos-tests/src/test/resources/junit-platform.properties b/hadoop-ozone/fault-injection-test/mini-chaos-tests/src/test/resources/junit-platform.properties deleted file mode 100644 index ae871152f910..000000000000 --- a/hadoop-ozone/fault-injection-test/mini-chaos-tests/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,18 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-ozone/httpfsgateway/src/test/resources/junit-platform.properties b/hadoop-ozone/httpfsgateway/src/test/resources/junit-platform.properties deleted file mode 100644 index ae871152f910..000000000000 --- a/hadoop-ozone/httpfsgateway/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,18 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-ozone/insight/src/test/resources/junit-platform.properties b/hadoop-ozone/insight/src/test/resources/junit-platform.properties deleted file mode 100644 index ae871152f910..000000000000 --- a/hadoop-ozone/insight/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,18 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-ozone/integration-test-s3/src/test/resources/junit-platform.properties b/hadoop-ozone/integration-test-s3/src/test/resources/junit-platform.properties deleted file mode 100644 index ae871152f910..000000000000 --- a/hadoop-ozone/integration-test-s3/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,18 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-ozone/integration-test/src/test/resources/junit-platform.properties b/hadoop-ozone/integration-test/src/test/resources/junit-platform.properties deleted file mode 100644 index ae871152f910..000000000000 --- a/hadoop-ozone/integration-test/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,18 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-ozone/ozone-manager/src/test/resources/junit-platform.properties b/hadoop-ozone/ozone-manager/src/test/resources/junit-platform.properties deleted file mode 100644 index ae871152f910..000000000000 --- a/hadoop-ozone/ozone-manager/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,18 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-ozone/ozonefs-common/src/test/resources/junit-platform.properties b/hadoop-ozone/ozonefs-common/src/test/resources/junit-platform.properties deleted file mode 100644 index ae871152f910..000000000000 --- a/hadoop-ozone/ozonefs-common/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,18 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-ozone/s3gateway/src/test/resources/junit-platform.properties b/hadoop-ozone/s3gateway/src/test/resources/junit-platform.properties deleted file mode 100644 index ae871152f910..000000000000 --- a/hadoop-ozone/s3gateway/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,18 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -junit.jupiter.execution.timeout.default=5m diff --git a/hadoop-ozone/tools/src/test/resources/junit-platform.properties b/hadoop-ozone/tools/src/test/resources/junit-platform.properties deleted file mode 100644 index ae871152f910..000000000000 --- a/hadoop-ozone/tools/src/test/resources/junit-platform.properties +++ /dev/null @@ -1,18 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -junit.jupiter.execution.timeout.default=5m diff --git a/pom.xml b/pom.xml index b6a3293e1638..b10d74d2152d 100644 --- a/pom.xml +++ b/pom.xml @@ -1915,7 +1915,8 @@ junit.platform.output.capture.stdout = true - junit.platform.output.capture.stderr = true + junit.platform.output.capture.stderr = true + junit.jupiter.execution.timeout.default = 5m **/Test*.java From e1f824fb7268e0a6ed8c2172aaa0e39ea1f78828 Mon Sep 17 00:00:00 2001 From: Chia-Chuan Yu Date: Tue, 29 Apr 2025 21:00:37 +0800 Subject: [PATCH 07/26] Removed the leftovers --- .../ozone/container/common/volume/TestStorageVolumeChecker.java | 2 -- .../ozone/container/common/volume/TestVolumeSetDiskChecks.java | 2 -- .../container/keyvalue/TestKeyValueContainerMarkUnhealthy.java | 2 -- .../java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java | 2 -- .../java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java | 2 -- .../java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java | 2 -- .../src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java | 2 -- .../org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java | 2 -- .../org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java | 2 -- .../org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java | 2 -- 10 files changed, 20 deletions(-) diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java index 424de5d78651..bbcf50a6e1c8 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java @@ -59,7 +59,6 @@ import org.apache.hadoop.util.FakeTimer; import org.apache.ozone.test.GenericTestUtils; import org.junit.jupiter.api.TestInfo; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -70,7 +69,6 @@ /** * Tests for {@link StorageVolumeChecker}. */ -@Timeout(300) public class TestStorageVolumeChecker { private static final Logger LOG = LoggerFactory.getLogger( TestStorageVolumeChecker.class); diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java index 85e5fe1580cc..a88cc818770c 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java @@ -64,7 +64,6 @@ import org.apache.hadoop.util.Timer; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -73,7 +72,6 @@ * Verify that {@link MutableVolumeSet} correctly checks for failed disks * during initialization. */ -@Timeout(30) public class TestVolumeSetDiskChecks { @TempDir private Path tempDir; diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerMarkUnhealthy.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerMarkUnhealthy.java index 06f56a192d34..85c9f574b525 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerMarkUnhealthy.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerMarkUnhealthy.java @@ -41,7 +41,6 @@ import org.apache.hadoop.ozone.container.common.volume.RoundRobinVolumeChoosingPolicy; import org.apache.hadoop.ozone.container.common.volume.VolumeSet; import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -50,7 +49,6 @@ * Tests unhealthy container functionality in the {@link KeyValueContainer} * class. */ -@Timeout(600) public class TestKeyValueContainerMarkUnhealthy { private static final Logger LOG = LoggerFactory.getLogger( TestKeyValueContainerMarkUnhealthy.class); diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java index d1335ae41c58..fe3b6d9d4a30 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java @@ -40,14 +40,12 @@ import org.apache.hadoop.net.NetUtils; import org.apache.hadoop.test.PathUtils; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Unit tests for {@link HddsServerUtil}. */ -@Timeout(300) public class TestHddsServerUtils { private static final Logger LOG = LoggerFactory.getLogger( TestHddsServerUtils.class); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java index 439bbb114001..a8d3e6b62be0 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java @@ -50,13 +50,11 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; /** * Test cases for ContainerMapper. */ -@Timeout(value = 300, unit = TimeUnit.SECONDS) public class TestContainerMapper { @TempDir private static Path dbPath; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java index b1bd804eb077..aa23fe428b73 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java @@ -92,7 +92,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.rocksdb.RocksDB; import org.rocksdb.RocksDBException; @@ -102,7 +101,6 @@ /** * Tests the Ratis snapshots feature in OM. */ -@Timeout(5000) public class TestOMRatisSnapshots { private MiniOzoneHAClusterImpl cluster = null; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java index 2e281f506c2c..0b9915d11973 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java @@ -26,12 +26,10 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test Ozone Manager Init. */ -@Timeout(300) public class TestOmInit { private static MiniOzoneCluster cluster = null; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java index 594f5cd47e25..38d237829265 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java @@ -59,7 +59,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -72,7 +71,6 @@ * TODO: HDDS-6338. Add a Kerberized version of this * TODO: HDDS-6336. Add a mock Ranger server to test Ranger HTTP endpoint calls */ -@Timeout(300) public class TestOzoneTenantShell { private static final Logger LOG = diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java index e76657b07cbc..255b9c5b4b91 100644 --- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java +++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java @@ -22,14 +22,12 @@ import org.apache.hadoop.hdds.conf.OzoneConfiguration; import org.apache.hadoop.ozone.protocolPB.OzoneManagerProtocolServerSideTranslatorPB; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Tests for GrpcOzoneManagerServer. */ -@Timeout(30) public class TestGrpcOzoneManagerServer { private static final Logger LOG = LoggerFactory.getLogger(TestGrpcOzoneManagerServer.class); diff --git a/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java b/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java index 93f321282118..33f3be12b873 100644 --- a/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java +++ b/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java @@ -33,14 +33,12 @@ import org.apache.hadoop.security.UserGroupInformation; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Tests for GrpcOmTransport. */ -@Timeout(3000) public class TestGrpcOmTransport { private static final Logger LOG = From 2dc53ab2036dc9992a6191bb3bb94dc3244eb9e6 Mon Sep 17 00:00:00 2001 From: Peter Lee Date: Sun, 27 Apr 2025 13:30:26 +0800 Subject: [PATCH 08/26] HDDS-12902. Shutdown executor in CloseContainerCommandHandler and ECReconstructionCoordinator (#8341) --- .../commandhandler/CloseContainerCommandHandler.java | 5 +++++ .../ec/reconstruction/ECReconstructionCoordinator.java | 1 + 2 files changed, 6 insertions(+) diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/CloseContainerCommandHandler.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/CloseContainerCommandHandler.java index 1a1594cf8a99..364cbd9d1934 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/CloseContainerCommandHandler.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/CloseContainerCommandHandler.java @@ -227,4 +227,9 @@ public int getThreadPoolMaxPoolSize() { public int getThreadPoolActivePoolSize() { return executor.getActiveCount(); } + + @Override + public void stop() { + executor.shutdownNow(); + } } diff --git a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ec/reconstruction/ECReconstructionCoordinator.java b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ec/reconstruction/ECReconstructionCoordinator.java index d8856f081d7a..af5c9c58929a 100644 --- a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ec/reconstruction/ECReconstructionCoordinator.java +++ b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ec/reconstruction/ECReconstructionCoordinator.java @@ -464,6 +464,7 @@ public void close() throws IOException { if (ecReconstructWriteExecutor.isInitialized()) { ecReconstructWriteExecutor.get().shutdownNow(); } + ecReconstructReadExecutor.shutdownNow(); } private Pipeline rebuildInputPipeline(ECReplicationConfig repConfig, From f65c7fa6c8989e990964a3fc5ef8708174188668 Mon Sep 17 00:00:00 2001 From: Chia-Chuan Yu Date: Sun, 27 Apr 2025 16:51:53 +0800 Subject: [PATCH 09/26] HDDS-12912. Remove deprecated `PipelineManager#closePipeline(Pipeline, boolean)` (#8340) --- .../hadoop/hdds/scm/pipeline/PipelineManager.java | 4 ---- .../hdds/scm/pipeline/PipelineManagerImpl.java | 14 -------------- .../scm/pipeline/WritableECContainerProvider.java | 4 ++-- .../hdds/scm/server/SCMClientProtocolServer.java | 2 +- .../scm/server/upgrade/SCMUpgradeFinalizer.java | 2 +- .../hadoop/hdds/scm/block/TestBlockManager.java | 2 +- .../hdds/scm/pipeline/MockPipelineManager.java | 9 ++------- .../hdds/scm/pipeline/TestPipelineManagerImpl.java | 4 ++-- .../apache/hadoop/hdds/scm/TestWatchForCommit.java | 2 +- .../container/TestScmApplyTransactionFailure.java | 2 +- .../hdds/scm/pipeline/TestLeaderChoosePolicy.java | 2 +- .../hdds/scm/pipeline/TestPipelineClose.java | 2 +- .../TestRatisPipelineCreateAndDestroy.java | 6 +++--- .../hdds/scm/storage/TestContainerCommandsEC.java | 4 ++-- .../org/apache/hadoop/ozone/OzoneTestUtils.java | 2 +- .../ozone/client/rpc/TestECKeyOutputStream.java | 2 +- .../apache/hadoop/ozone/container/TestHelper.java | 2 +- .../TestCloseContainerByPipeline.java | 4 ++-- .../ozone/freon/TestFreonWithPipelineDestroy.java | 2 +- 19 files changed, 24 insertions(+), 47 deletions(-) diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineManager.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineManager.java index 29566e78f68d..de588c712e07 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineManager.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineManager.java @@ -112,10 +112,6 @@ NavigableSet getContainersInPipeline(PipelineID pipelineID) void openPipeline(PipelineID pipelineId) throws IOException; - @Deprecated - void closePipeline(Pipeline pipeline, boolean onTimeout) - throws IOException; - void closePipeline(PipelineID pipelineID) throws IOException; void deletePipeline(PipelineID pipelineID) throws IOException; diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineManagerImpl.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineManagerImpl.java index 6bb59a2236e8..56a29536b409 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineManagerImpl.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineManagerImpl.java @@ -488,20 +488,6 @@ private void closeContainersForPipeline(final PipelineID pipelineId) } } - /** - * put pipeline in CLOSED state. - * @param pipeline - ID of the pipeline. - * @param onTimeout - whether to remove pipeline after some time. - * @throws IOException throws exception in case of failure - * @deprecated Do not use this method, onTimeout is not honored. - */ - @Override - @Deprecated - public void closePipeline(Pipeline pipeline, boolean onTimeout) - throws IOException { - closePipeline(pipeline.getId()); - } - /** * Move the Pipeline to CLOSED state. * @param pipelineID ID of the Pipeline to be closed diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/WritableECContainerProvider.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/WritableECContainerProvider.java index 1452779035f1..89a36f9b92d4 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/WritableECContainerProvider.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/WritableECContainerProvider.java @@ -137,7 +137,7 @@ public ContainerInfo getContainer(final long size, if (containerInfo == null || !containerHasSpace(containerInfo, size)) { existingPipelines.remove(pipelineIndex); - pipelineManager.closePipeline(pipeline, true); + pipelineManager.closePipeline(pipeline.getId()); openPipelineCount--; } else { if (pipelineIsExcluded(pipeline, containerInfo, excludeList)) { @@ -151,7 +151,7 @@ public ContainerInfo getContainer(final long size, LOG.warn("Pipeline or container not found when selecting a writable " + "container", e); existingPipelines.remove(pipelineIndex); - pipelineManager.closePipeline(pipeline, true); + pipelineManager.closePipeline(pipeline.getId()); openPipelineCount--; } } diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMClientProtocolServer.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMClientProtocolServer.java index b945786ac00d..b9b5a1920b37 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMClientProtocolServer.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/SCMClientProtocolServer.java @@ -882,7 +882,7 @@ public void closePipeline(HddsProtos.PipelineID pipelineID) PipelineManager pipelineManager = scm.getPipelineManager(); Pipeline pipeline = pipelineManager.getPipeline(PipelineID.getFromProtobuf(pipelineID)); - pipelineManager.closePipeline(pipeline, true); + pipelineManager.closePipeline(pipeline.getId()); AUDIT.logWriteSuccess(buildAuditMessageForSuccess( SCMAction.CLOSE_PIPELINE, auditMap)); } catch (Exception ex) { diff --git a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/upgrade/SCMUpgradeFinalizer.java b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/upgrade/SCMUpgradeFinalizer.java index 1e187b20814d..891f2d38b903 100644 --- a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/upgrade/SCMUpgradeFinalizer.java +++ b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/upgrade/SCMUpgradeFinalizer.java @@ -150,7 +150,7 @@ private void closePipelinesBeforeFinalization(PipelineManager pipelineManager) for (Pipeline pipeline : pipelineManager.getPipelines()) { if (pipeline.getPipelineState() != CLOSED) { - pipelineManager.closePipeline(pipeline, true); + pipelineManager.closePipeline(pipeline.getId()); } } diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/block/TestBlockManager.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/block/TestBlockManager.java index 9f6091d1aba6..282b92554d1e 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/block/TestBlockManager.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/block/TestBlockManager.java @@ -571,7 +571,7 @@ public void testMultipleBlockAllocationWithClosedContainer() public void testBlockAllocationWithNoAvailablePipelines() throws IOException { for (Pipeline pipeline : pipelineManager.getPipelines()) { - pipelineManager.closePipeline(pipeline, false); + pipelineManager.closePipeline(pipeline.getId()); } assertEquals(0, pipelineManager.getPipelines(replicationConfig).size()); assertNotNull(blockManager diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/MockPipelineManager.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/MockPipelineManager.java index f5d3eb540ddf..cc4292b82b41 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/MockPipelineManager.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/MockPipelineManager.java @@ -236,17 +236,12 @@ public void openPipeline(final PipelineID pipelineId) } @Override - public void closePipeline(final Pipeline pipeline, final boolean onTimeout) + public void closePipeline(final PipelineID pipelineId) throws IOException { - stateManager.updatePipelineState(pipeline.getId().getProtobuf(), + stateManager.updatePipelineState(pipelineId.getProtobuf(), HddsProtos.PipelineState.PIPELINE_CLOSED); } - @Override - public void closePipeline(PipelineID pipelineID) throws IOException { - - } - @Override public void deletePipeline(PipelineID pipelineID) throws IOException { diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineManagerImpl.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineManagerImpl.java index 3a0b98ead40a..f232890c96b8 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineManagerImpl.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineManagerImpl.java @@ -350,7 +350,7 @@ public void testClosePipelineShouldFailOnFollower() throws Exception { Pipeline pipeline = assertAllocate(pipelineManager); changeToFollower(pipelineManager); assertFailsNotLeader( - () -> pipelineManager.closePipeline(pipeline, false)); + () -> pipelineManager.closePipeline(pipeline.getId())); } } @@ -521,7 +521,7 @@ public void testScrubPipelines() throws Exception { .createPipeline(RatisReplicationConfig .getInstance(ReplicationFactor.THREE)); pipelineManager.openPipeline(closedPipeline.getId()); - pipelineManager.closePipeline(closedPipeline, true); + pipelineManager.closePipeline(closedPipeline.getId()); // pipeline should be seen in pipelineManager as CLOSED. assertTrue(pipelineManager diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestWatchForCommit.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestWatchForCommit.java index f52083fa21f3..432818b8f295 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestWatchForCommit.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestWatchForCommit.java @@ -276,7 +276,7 @@ public void testWatchForCommitForRetryfailure(RaftProtos.ReplicationLevel watchT cluster.shutdownHddsDatanode(pipeline.getNodes().get(1)); // emulate closing pipeline when SCM detects DEAD datanodes cluster.getStorageContainerManager() - .getPipelineManager().closePipeline(pipeline, false); + .getPipelineManager().closePipeline(pipeline.getId()); // again write data with more than max buffer limit. This wi // just watch for a log index which in not updated in the commitInfo Map // as well as there is no logIndex generate in Ratis. diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/container/TestScmApplyTransactionFailure.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/container/TestScmApplyTransactionFailure.java index 399e1b237282..cef98beaf0e9 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/container/TestScmApplyTransactionFailure.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/container/TestScmApplyTransactionFailure.java @@ -67,7 +67,7 @@ public void testAddContainerToClosedPipeline() throws Exception { Pipeline pipeline = pipelines.get(0); // if testing for not-found pipeline, remove pipeline when closing. - pipelineManager.closePipeline(pipeline, true); + pipelineManager.closePipeline(pipeline.getId()); // adding container to a closed pipeline should yield an error. ContainerInfoProto containerInfo = createContainer(pipeline); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestLeaderChoosePolicy.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestLeaderChoosePolicy.java index 188793c0eb24..d9acd8cbad1e 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestLeaderChoosePolicy.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestLeaderChoosePolicy.java @@ -183,7 +183,7 @@ public void testMinLeaderCountChoosePolicy() throws Exception { int destroyNum = RandomUtils.secure().randomInt(0, pipelines.size()); for (int k = 0; k <= destroyNum; k++) { - pipelineManager.closePipeline(pipelines.get(k), false); + pipelineManager.closePipeline(pipelines.get(k).getId()); } waitForPipelines(pipelineNum); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineClose.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineClose.java index dd70fa970f80..c8bd8937b5d9 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineClose.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineClose.java @@ -165,7 +165,7 @@ public void testPipelineCloseWithOpenContainer() assertEquals(1, setOpen.size()); pipelineManager - .closePipeline(ratisContainer.getPipeline(), false); + .closePipeline(ratisContainer.getPipeline().getId()); GenericTestUtils.waitFor(() -> { try { return containerManager diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestRatisPipelineCreateAndDestroy.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestRatisPipelineCreateAndDestroy.java index e54b04884c4c..3c3eee25393a 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestRatisPipelineCreateAndDestroy.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestRatisPipelineCreateAndDestroy.java @@ -89,7 +89,7 @@ public void testAutomaticPipelineCreationOnPipelineDestroy() .getPipelines(RatisReplicationConfig.getInstance( ReplicationFactor.THREE), Pipeline.PipelineState.OPEN); for (Pipeline pipeline : pipelines) { - pipelineManager.closePipeline(pipeline, false); + pipelineManager.closePipeline(pipeline.getId()); } // make sure two pipelines are created waitForPipelines(2); @@ -111,7 +111,7 @@ public void testAutomaticPipelineCreationDisablingFactorONE() .getPipelines(RatisReplicationConfig.getInstance( ReplicationFactor.THREE), Pipeline.PipelineState.OPEN); for (Pipeline pipeline : pipelines) { - pipelineManager.closePipeline(pipeline, false); + pipelineManager.closePipeline(pipeline.getId()); } // make sure two pipelines are created @@ -154,7 +154,7 @@ public void testPipelineCreationOnNodeRestart() throws Exception { // destroy the existing pipelines for (Pipeline pipeline : pipelines) { - pipelineManager.closePipeline(pipeline, false); + pipelineManager.closePipeline(pipeline.getId()); } if (cluster.getStorageContainerManager() diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/storage/TestContainerCommandsEC.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/storage/TestContainerCommandsEC.java index 7606c38c5631..4b5847f43b84 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/storage/TestContainerCommandsEC.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/storage/TestContainerCommandsEC.java @@ -239,7 +239,7 @@ private void closeAllPipelines(ReplicationConfig replicationConfig) { Pipeline.PipelineState.OPEN) .forEach(p -> { try { - scm.getPipelineManager().closePipeline(p, false); + scm.getPipelineManager().closePipeline(p.getId()); } catch (IOException e) { throw new RuntimeException(e); } @@ -271,7 +271,7 @@ public void testOrphanBlock() throws Exception { ANY_USER, ContainerID.valueOf(orphanContainerID)); // Close the container by closing the pipeline - scm.getPipelineManager().closePipeline(orphanPipeline, false); + scm.getPipelineManager().closePipeline(orphanPipeline.getId()); // Find the datanode hosting Replica index = 2 HddsDatanodeService dn2Service = null; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/OzoneTestUtils.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/OzoneTestUtils.java index dc4f57731f9e..600e9c28a031 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/OzoneTestUtils.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/OzoneTestUtils.java @@ -155,7 +155,7 @@ public static void closeContainer(StorageContainerManager scm, throws IOException, TimeoutException, InterruptedException { Pipeline pipeline = scm.getPipelineManager() .getPipeline(container.getPipelineID()); - scm.getPipelineManager().closePipeline(pipeline, true); + scm.getPipelineManager().closePipeline(pipeline.getId()); GenericTestUtils.waitFor(() -> container.getState() == HddsProtos.LifeCycleState.CLOSED, 200, 30000); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestECKeyOutputStream.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestECKeyOutputStream.java index 4a03bbad8a17..edd52c087365 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestECKeyOutputStream.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestECKeyOutputStream.java @@ -441,7 +441,7 @@ public void testECContainerKeysCountAndNumContainerReplicas() PipelineManager pm = cluster.getStorageContainerManager().getPipelineManager(); for (Pipeline p : pm.getPipelines(repConfig)) { - pm.closePipeline(p, true); + pm.closePipeline(p.getId()); } String keyName = UUID.randomUUID().toString(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/TestHelper.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/TestHelper.java index 75cbca00e5ca..4890d0801785 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/TestHelper.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/TestHelper.java @@ -289,7 +289,7 @@ public static void waitForPipelineClose(List pipelineList, for (Pipeline pipeline1 : pipelineList) { // issue pipeline destroy command cluster.getStorageContainerManager() - .getPipelineManager().closePipeline(pipeline1, false); + .getPipelineManager().closePipeline(pipeline1.getId()); } // wait for the pipeline to get destroyed in the datanodes diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestCloseContainerByPipeline.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestCloseContainerByPipeline.java index 4a0a1a61f5c8..b82e53a75076 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestCloseContainerByPipeline.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestCloseContainerByPipeline.java @@ -213,7 +213,7 @@ public void testCloseContainerViaStandAlone() assertTrue(isContainerClosed(cluster, containerID, datanodeDetails)); cluster.getStorageContainerManager().getPipelineManager() - .closePipeline(pipeline, false); + .closePipeline(pipeline.getId()); Thread.sleep(5000); // Pipeline close should not affect a container in CLOSED state assertTrue(isContainerClosed(cluster, containerID, datanodeDetails)); @@ -317,7 +317,7 @@ public void testQuasiCloseTransitionViaRatis() // close the pipeline cluster.getStorageContainerManager() - .getPipelineManager().closePipeline(pipeline, false); + .getPipelineManager().closePipeline(pipeline.getId()); // All the containers in OPEN or CLOSING state should transition to // QUASI-CLOSED after pipeline close diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestFreonWithPipelineDestroy.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestFreonWithPipelineDestroy.java index 709b871042ea..89732f457249 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestFreonWithPipelineDestroy.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestFreonWithPipelineDestroy.java @@ -128,6 +128,6 @@ private void destroyPipeline() throws Exception { PipelineManager pipelineManager = cluster.getStorageContainerManager().getPipelineManager(); Pipeline pipeline = pipelineManager.getPipeline(id); - pipelineManager.closePipeline(pipeline, false); + pipelineManager.closePipeline(pipeline.getId()); } } From 81e415586f85ec8e889f86fab3506beff45846ee Mon Sep 17 00:00:00 2001 From: Ivan Zlenko <241953+ivanzlenko@users.noreply.github.com> Date: Sun, 27 Apr 2025 21:32:58 +0500 Subject: [PATCH 10/26] HDDS-12878. Move field declarations to start of class in tests (#8308) --- .../rawcoder/RawErasureCoderBenchmark.java | 8 +- .../hadoop/hdds/utils/db/TestRDBStore.java | 21 +- .../TestRocksDBCheckpointDiffer.java | 319 +++++++++--------- .../states/TestContainerAttribute.java | 3 +- .../pipeline/TestPipelinePlacementPolicy.java | 36 +- .../apache/ozone/test/LambdaTestUtils.java | 8 +- .../hadoop/ozone/shell/TestOzoneAddress.java | 4 +- .../om/protocolPB/TestS3GrpcOmTransport.java | 22 +- .../ozone/TestMiniChaosOzoneCluster.java | 4 +- .../ozone/loadgenerators/LoadGenerator.java | 5 +- .../server/metrics/TestHttpFSMetrics.java | 30 +- .../AbstractContractGetFileStatusTest.java | 9 +- .../fs/ozone/AbstractOzoneFileSystemTest.java | 10 +- .../AbstractRootedOzoneFileSystemTest.java | 57 ++-- .../hdds/upgrade/TestHddsUpgradeUtils.java | 7 +- .../client/rpc/read/TestInputStreamBase.java | 4 +- .../hadoop/ozone/om/TestOMRatisSnapshots.java | 7 +- .../contract/AbstractContractDistCpTest.java | 20 +- .../ozone/om/lock/TestOzoneLockProvider.java | 6 +- .../GeneralValidatorsForTesting.java | 4 +- .../om/upgrade/TestOMUpgradeFinalizer.java | 4 +- .../hadoop/ozone/client/ObjectStoreStub.java | 8 +- 22 files changed, 298 insertions(+), 298 deletions(-) diff --git a/hadoop-hdds/erasurecode/src/test/java/org/apache/ozone/erasurecode/rawcoder/RawErasureCoderBenchmark.java b/hadoop-hdds/erasurecode/src/test/java/org/apache/ozone/erasurecode/rawcoder/RawErasureCoderBenchmark.java index 89c15316ef11..947f19e4883a 100644 --- a/hadoop-hdds/erasurecode/src/test/java/org/apache/ozone/erasurecode/rawcoder/RawErasureCoderBenchmark.java +++ b/hadoop-hdds/erasurecode/src/test/java/org/apache/ozone/erasurecode/rawcoder/RawErasureCoderBenchmark.java @@ -46,10 +46,6 @@ */ public final class RawErasureCoderBenchmark { - private RawErasureCoderBenchmark() { - // prevent instantiation - } - // target size of input data buffer private static final int TARGET_BUFFER_SIZE_MB = 126; @@ -61,6 +57,10 @@ private RawErasureCoderBenchmark() { Arrays.asList(new DummyRawErasureCoderFactory(), new RSRawErasureCoderFactory())); + private RawErasureCoderBenchmark() { + // prevent instantiation + } + enum CODER { DUMMY_CODER("Dummy coder"), RS_CODER("Reed-Solomon Java coder"); diff --git a/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/utils/db/TestRDBStore.java b/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/utils/db/TestRDBStore.java index a4ee8412ba2c..c95fced12f89 100644 --- a/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/utils/db/TestRDBStore.java +++ b/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/utils/db/TestRDBStore.java @@ -56,6 +56,17 @@ * RDBStore Tests. */ public class TestRDBStore { + + public static final int MAX_DB_UPDATES_SIZE_THRESHOLD = 80; + private final List families = + Arrays.asList(StringUtils.bytes2String(RocksDB.DEFAULT_COLUMN_FAMILY), + "First", "Second", "Third", + "Fourth", "Fifth", + "Sixth"); + private RDBStore rdbStore = null; + private ManagedDBOptions options; + private Set configSet; + static ManagedDBOptions newManagedDBOptions() { final ManagedDBOptions options = new ManagedDBOptions(); options.setCreateIfMissing(true); @@ -81,16 +92,6 @@ public static RDBStore newRDBStore(File dbFile, ManagedDBOptions options, maxDbUpdatesSizeThreshold, true, null, true); } - public static final int MAX_DB_UPDATES_SIZE_THRESHOLD = 80; - private final List families = - Arrays.asList(StringUtils.bytes2String(RocksDB.DEFAULT_COLUMN_FAMILY), - "First", "Second", "Third", - "Fourth", "Fifth", - "Sixth"); - private RDBStore rdbStore = null; - private ManagedDBOptions options; - private Set configSet; - @BeforeEach public void setUp(@TempDir File tempDir) throws Exception { CodecBuffer.enableLeakDetection(); diff --git a/hadoop-hdds/rocksdb-checkpoint-differ/src/test/java/org/apache/ozone/rocksdiff/TestRocksDBCheckpointDiffer.java b/hadoop-hdds/rocksdb-checkpoint-differ/src/test/java/org/apache/ozone/rocksdiff/TestRocksDBCheckpointDiffer.java index 2bafef981818..50be6bfb705f 100644 --- a/hadoop-hdds/rocksdb-checkpoint-differ/src/test/java/org/apache/ozone/rocksdiff/TestRocksDBCheckpointDiffer.java +++ b/hadoop-hdds/rocksdb-checkpoint-differ/src/test/java/org/apache/ozone/rocksdiff/TestRocksDBCheckpointDiffer.java @@ -118,8 +118,165 @@ */ public class TestRocksDBCheckpointDiffer { - private static final Logger LOG = - LoggerFactory.getLogger(TestRocksDBCheckpointDiffer.class); + private static final Logger LOG = LoggerFactory.getLogger(TestRocksDBCheckpointDiffer.class); + + private static final List> SST_FILES_BY_LEVEL = Arrays.asList( + Arrays.asList("000015", "000013", "000011", "000009"), + Arrays.asList("000018", "000016", "000017", "000026", "000024", "000022", + "000020"), + Arrays.asList("000027", "000030", "000028", "000029", "000031", "000039", + "000037", "000035", "000033"), + Arrays.asList("000040", "000044", "000042", "000043", "000045", "000041", + "000046", "000054", "000052", "000050", "000048"), + Arrays.asList("000059", "000055", "000056", "000060", "000057", "000058") + ); + + private static final List> COMPACTION_NODES_BY_LEVEL = + SST_FILES_BY_LEVEL.stream() + .map(sstFiles -> + sstFiles.stream() + .map( + sstFile -> new CompactionNode(sstFile, + 1000L, + Long.parseLong(sstFile.substring(0, 6)), + null, null, null + )) + .collect(Collectors.toList())) + .collect(Collectors.toList()); + + private final List compactionLogEntryList = Arrays.asList( + new CompactionLogEntry(101, System.currentTimeMillis(), + Arrays.asList( + new CompactionFileInfo("000068", "/volume/bucket2", + "/volume/bucket2", "bucketTable"), + new CompactionFileInfo("000057", "/volume/bucket1", + "/volume/bucket1", "bucketTable")), + Collections.singletonList( + new CompactionFileInfo("000086", "/volume/bucket1", + "/volume/bucket2", "bucketTable")), + null), + new CompactionLogEntry(178, System.currentTimeMillis(), + Arrays.asList(new CompactionFileInfo("000078", + "/volume/bucket1/key-0000001411", + "/volume/bucket2/key-0000099649", + "keyTable"), + new CompactionFileInfo("000075", + "/volume/bucket1/key-0000016536", + "/volume/bucket2/key-0000098897", + "keyTable"), + new CompactionFileInfo("000073", + "/volume/bucket1/key-0000000730", + "/volume/bucket2/key-0000097010", + "keyTable"), + new CompactionFileInfo("000071", + "/volume/bucket1/key-0000001820", + "/volume/bucket2/key-0000097895", + "keyTable"), + new CompactionFileInfo("000063", + "/volume/bucket1/key-0000001016", + "/volume/bucket1/key-0000099930", + "keyTable")), + Collections.singletonList(new CompactionFileInfo("000081", + "/volume/bucket1/key-0000000730", + "/volume/bucket2/key-0000099649", + "keyTable")), + null + ), + new CompactionLogEntry(233, System.currentTimeMillis(), + Arrays.asList( + new CompactionFileInfo("000086", "/volume/bucket1", + "/volume/bucket2", "bucketTable"), + new CompactionFileInfo("000088", "/volume/bucket3", + "/volume/bucket3", "bucketTable")), + Collections.singletonList( + new CompactionFileInfo("000110", "/volume/bucket1", + "/volume/bucket3", "bucketTable") + ), + null), + new CompactionLogEntry(256, System.currentTimeMillis(), + Arrays.asList(new CompactionFileInfo("000081", + "/volume/bucket1/key-0000000730", + "/volume/bucket2/key-0000099649", + "keyTable"), + new CompactionFileInfo("000103", + "/volume/bucket1/key-0000017460", + "/volume/bucket3/key-0000097450", + "keyTable"), + new CompactionFileInfo("000099", + "/volume/bucket1/key-0000002310", + "/volume/bucket3/key-0000098286", + "keyTable"), + new CompactionFileInfo("000097", + "/volume/bucket1/key-0000005965", + "/volume/bucket3/key-0000099136", + "keyTable"), + new CompactionFileInfo("000095", + "/volume/bucket1/key-0000012424", + "/volume/bucket3/key-0000083904", + "keyTable")), + Collections.singletonList(new CompactionFileInfo("000106", + "/volume/bucket1/key-0000000730", + "/volume/bucket3/key-0000099136", + "keyTable")), + null), + new CompactionLogEntry(397, now(), + Arrays.asList(new CompactionFileInfo("000106", + "/volume/bucket1/key-0000000730", + "/volume/bucket3/key-0000099136", + "keyTable"), + new CompactionFileInfo("000128", + "/volume/bucket2/key-0000005031", + "/volume/bucket3/key-0000084385", + "keyTable"), + new CompactionFileInfo("000125", + "/volume/bucket2/key-0000003491", + "/volume/bucket3/key-0000088414", + "keyTable"), + new CompactionFileInfo("000123", + "/volume/bucket2/key-0000007390", + "/volume/bucket3/key-0000094627", + "keyTable"), + new CompactionFileInfo("000121", + "/volume/bucket2/key-0000003232", + "/volume/bucket3/key-0000094246", + "keyTable")), + Collections.singletonList(new CompactionFileInfo("000131", + "/volume/bucket1/key-0000000730", + "/volume/bucket3/key-0000099136", + "keyTable")), + null + ) + ); + + private static Map columnFamilyToPrefixMap1 = + new HashMap() { + { + put("keyTable", "/volume/bucket1/"); + // Simply using bucketName instead of ID for the test. + put("directoryTable", "/volume/bucket1/"); + put("fileTable", "/volume/bucket1/"); + } + }; + + private static Map columnFamilyToPrefixMap2 = + new HashMap() { + { + put("keyTable", "/volume/bucket2/"); + // Simply using bucketName instead of ID for the test. + put("directoryTable", "/volume/bucket2/"); + put("fileTable", "/volume/bucket2/"); + } + }; + + private static Map columnFamilyToPrefixMap3 = + new HashMap() { + { + put("keyTable", "/volume/bucket3/"); + // Simply using bucketName instead of ID for the test. + put("directoryTable", "/volume/bucket3/"); + put("fileTable", "/volume/bucket3/"); + } + }; private static final int NUM_ROW = 250000; private static final int SNAPSHOT_EVERY_SO_MANY_KEYS = 49999; @@ -1005,30 +1162,6 @@ private void printMutableGraphFromAGivenNode( } } - private static final List> SST_FILES_BY_LEVEL = Arrays.asList( - Arrays.asList("000015", "000013", "000011", "000009"), - Arrays.asList("000018", "000016", "000017", "000026", "000024", "000022", - "000020"), - Arrays.asList("000027", "000030", "000028", "000029", "000031", "000039", - "000037", "000035", "000033"), - Arrays.asList("000040", "000044", "000042", "000043", "000045", "000041", - "000046", "000054", "000052", "000050", "000048"), - Arrays.asList("000059", "000055", "000056", "000060", "000057", "000058") - ); - - private static final List> COMPACTION_NODES_BY_LEVEL = - SST_FILES_BY_LEVEL.stream() - .map(sstFiles -> - sstFiles.stream() - .map( - sstFile -> new CompactionNode(sstFile, - 1000L, - Long.parseLong(sstFile.substring(0, 6)), - null, null, null - )) - .collect(Collectors.toList())) - .collect(Collectors.toList()); - /** * Creates a backward compaction DAG from a list of level nodes. * It assumes that at each level files get compacted to the half of number @@ -1703,140 +1836,6 @@ private void createFileWithContext(String fileName, String context) } } - private final List compactionLogEntryList = Arrays.asList( - new CompactionLogEntry(101, System.currentTimeMillis(), - Arrays.asList( - new CompactionFileInfo("000068", "/volume/bucket2", - "/volume/bucket2", "bucketTable"), - new CompactionFileInfo("000057", "/volume/bucket1", - "/volume/bucket1", "bucketTable")), - Collections.singletonList( - new CompactionFileInfo("000086", "/volume/bucket1", - "/volume/bucket2", "bucketTable")), - null), - new CompactionLogEntry(178, System.currentTimeMillis(), - Arrays.asList(new CompactionFileInfo("000078", - "/volume/bucket1/key-0000001411", - "/volume/bucket2/key-0000099649", - "keyTable"), - new CompactionFileInfo("000075", - "/volume/bucket1/key-0000016536", - "/volume/bucket2/key-0000098897", - "keyTable"), - new CompactionFileInfo("000073", - "/volume/bucket1/key-0000000730", - "/volume/bucket2/key-0000097010", - "keyTable"), - new CompactionFileInfo("000071", - "/volume/bucket1/key-0000001820", - "/volume/bucket2/key-0000097895", - "keyTable"), - new CompactionFileInfo("000063", - "/volume/bucket1/key-0000001016", - "/volume/bucket1/key-0000099930", - "keyTable")), - Collections.singletonList(new CompactionFileInfo("000081", - "/volume/bucket1/key-0000000730", - "/volume/bucket2/key-0000099649", - "keyTable")), - null - ), - new CompactionLogEntry(233, System.currentTimeMillis(), - Arrays.asList( - new CompactionFileInfo("000086", "/volume/bucket1", - "/volume/bucket2", "bucketTable"), - new CompactionFileInfo("000088", "/volume/bucket3", - "/volume/bucket3", "bucketTable")), - Collections.singletonList( - new CompactionFileInfo("000110", "/volume/bucket1", - "/volume/bucket3", "bucketTable") - ), - null), - new CompactionLogEntry(256, System.currentTimeMillis(), - Arrays.asList(new CompactionFileInfo("000081", - "/volume/bucket1/key-0000000730", - "/volume/bucket2/key-0000099649", - "keyTable"), - new CompactionFileInfo("000103", - "/volume/bucket1/key-0000017460", - "/volume/bucket3/key-0000097450", - "keyTable"), - new CompactionFileInfo("000099", - "/volume/bucket1/key-0000002310", - "/volume/bucket3/key-0000098286", - "keyTable"), - new CompactionFileInfo("000097", - "/volume/bucket1/key-0000005965", - "/volume/bucket3/key-0000099136", - "keyTable"), - new CompactionFileInfo("000095", - "/volume/bucket1/key-0000012424", - "/volume/bucket3/key-0000083904", - "keyTable")), - Collections.singletonList(new CompactionFileInfo("000106", - "/volume/bucket1/key-0000000730", - "/volume/bucket3/key-0000099136", - "keyTable")), - null), - new CompactionLogEntry(397, now(), - Arrays.asList(new CompactionFileInfo("000106", - "/volume/bucket1/key-0000000730", - "/volume/bucket3/key-0000099136", - "keyTable"), - new CompactionFileInfo("000128", - "/volume/bucket2/key-0000005031", - "/volume/bucket3/key-0000084385", - "keyTable"), - new CompactionFileInfo("000125", - "/volume/bucket2/key-0000003491", - "/volume/bucket3/key-0000088414", - "keyTable"), - new CompactionFileInfo("000123", - "/volume/bucket2/key-0000007390", - "/volume/bucket3/key-0000094627", - "keyTable"), - new CompactionFileInfo("000121", - "/volume/bucket2/key-0000003232", - "/volume/bucket3/key-0000094246", - "keyTable")), - Collections.singletonList(new CompactionFileInfo("000131", - "/volume/bucket1/key-0000000730", - "/volume/bucket3/key-0000099136", - "keyTable")), - null - ) - ); - - private static Map columnFamilyToPrefixMap1 = - new HashMap() { - { - put("keyTable", "/volume/bucket1/"); - // Simply using bucketName instead of ID for the test. - put("directoryTable", "/volume/bucket1/"); - put("fileTable", "/volume/bucket1/"); - } - }; - - private static Map columnFamilyToPrefixMap2 = - new HashMap() { - { - put("keyTable", "/volume/bucket2/"); - // Simply using bucketName instead of ID for the test. - put("directoryTable", "/volume/bucket2/"); - put("fileTable", "/volume/bucket2/"); - } - }; - - private static Map columnFamilyToPrefixMap3 = - new HashMap() { - { - put("keyTable", "/volume/bucket3/"); - // Simply using bucketName instead of ID for the test. - put("directoryTable", "/volume/bucket3/"); - put("fileTable", "/volume/bucket3/"); - } - }; - /** * Test cases for testGetSSTDiffListWithoutDB. */ diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/states/TestContainerAttribute.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/states/TestContainerAttribute.java index 8f321c857468..24da5351bdf2 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/states/TestContainerAttribute.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/states/TestContainerAttribute.java @@ -33,7 +33,6 @@ * Test ContainerAttribute management. */ public class TestContainerAttribute { - enum Key { K1, K2, K3 } private final Key key1 = Key.K1; private final Key key2 = Key.K2; @@ -122,4 +121,6 @@ public void tesUpdate() throws SCMException { assertThrows(SCMException.class, () -> containerAttribute.update(key3, key1, id)); } + + enum Key { K1, K2, K3 } } diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelinePlacementPolicy.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelinePlacementPolicy.java index 15dc614a321a..80df75b9325b 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelinePlacementPolicy.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelinePlacementPolicy.java @@ -81,6 +81,24 @@ * Test for PipelinePlacementPolicy. */ public class TestPipelinePlacementPolicy { + 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), + new NodeImpl("h4", "/r2", NetConstants.NODE_COST_DEFAULT), + new NodeImpl("h5", "/r3", NetConstants.NODE_COST_DEFAULT), + new NodeImpl("h6", "/r3", NetConstants.NODE_COST_DEFAULT), + new NodeImpl("h7", "/r4", NetConstants.NODE_COST_DEFAULT), + new NodeImpl("h8", "/r4", NetConstants.NODE_COST_DEFAULT), + }; + + // 3 racks with single node. + 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) + }; + private MockNodeManager nodeManager; private PipelineStateManager stateManager; private OzoneConfiguration conf; @@ -359,24 +377,6 @@ public void testRackAwarenessNotEnabledWithFallBack() throws SCMException { assertEquals(results.get(0).getNetworkLocation(), results.get(2).getNetworkLocation()); } - 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), - new NodeImpl("h4", "/r2", NetConstants.NODE_COST_DEFAULT), - new NodeImpl("h5", "/r3", NetConstants.NODE_COST_DEFAULT), - new NodeImpl("h6", "/r3", NetConstants.NODE_COST_DEFAULT), - new NodeImpl("h7", "/r4", NetConstants.NODE_COST_DEFAULT), - new NodeImpl("h8", "/r4", NetConstants.NODE_COST_DEFAULT), - }; - - // 3 racks with single node. - 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) - }; - private NetworkTopology createNetworkTopologyOnDifRacks() { NetworkTopology topology = new NetworkTopologyImpl(new OzoneConfiguration()); diff --git a/hadoop-hdds/test-utils/src/test/java/org/apache/ozone/test/LambdaTestUtils.java b/hadoop-hdds/test-utils/src/test/java/org/apache/ozone/test/LambdaTestUtils.java index b3529ff10b51..81ca218fabce 100644 --- a/hadoop-hdds/test-utils/src/test/java/org/apache/ozone/test/LambdaTestUtils.java +++ b/hadoop-hdds/test-utils/src/test/java/org/apache/ozone/test/LambdaTestUtils.java @@ -36,14 +36,14 @@ * with jitter: test author gets to choose). */ public final class LambdaTestUtils { - private static final Logger LOG = - LoggerFactory.getLogger(LambdaTestUtils.class); - private LambdaTestUtils() { - } + private static final Logger LOG = LoggerFactory.getLogger(LambdaTestUtils.class); public static final String NULL_RESULT = "(null)"; + private LambdaTestUtils() { + } + /** * Interface to implement for converting a timeout into some form * of exception to raise. diff --git a/hadoop-ozone/cli-shell/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneAddress.java b/hadoop-ozone/cli-shell/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneAddress.java index 30e4192ce6a0..90d35841ace2 100644 --- a/hadoop-ozone/cli-shell/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneAddress.java +++ b/hadoop-ozone/cli-shell/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneAddress.java @@ -34,6 +34,8 @@ */ public class TestOzoneAddress { + private OzoneAddress address; + public static Collection data() { return Arrays.asList(new Object[][] { {"o3://localhost:9878/"}, @@ -44,8 +46,6 @@ public static Collection data() { }); } - private OzoneAddress address; - @ParameterizedTest @MethodSource("data") public void checkRootUrlType(String prefix) throws OzoneClientException { diff --git a/hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/om/protocolPB/TestS3GrpcOmTransport.java b/hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/om/protocolPB/TestS3GrpcOmTransport.java index 69d69f7fcb52..d5b8723e0eff 100644 --- a/hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/om/protocolPB/TestS3GrpcOmTransport.java +++ b/hadoop-ozone/common/src/test/java/org/apache/hadoop/ozone/om/protocolPB/TestS3GrpcOmTransport.java @@ -75,17 +75,6 @@ public class TestS3GrpcOmTransport { private String serverName; - private ServiceException createNotLeaderException() { - RaftPeerId raftPeerId = RaftPeerId.getRaftPeerId("testNodeId"); - - // TODO: Set suggest leaderID. Right now, client is not using suggest - // leaderID. Need to fix this. - OMNotLeaderException notLeaderException = - new OMNotLeaderException(raftPeerId); - LOG.debug(notLeaderException.getMessage()); - return new ServiceException(notLeaderException); - } - private final OzoneManagerServiceGrpc.OzoneManagerServiceImplBase serviceImpl = mock(OzoneManagerServiceGrpc.OzoneManagerServiceImplBase.class, @@ -120,6 +109,17 @@ public void submitRequest(org.apache.hadoop.ozone.protocol.proto private GrpcOmTransport client; + private ServiceException createNotLeaderException() { + RaftPeerId raftPeerId = RaftPeerId.getRaftPeerId("testNodeId"); + + // TODO: Set suggest leaderID. Right now, client is not using suggest + // leaderID. Need to fix this. + OMNotLeaderException notLeaderException = + new OMNotLeaderException(raftPeerId); + LOG.debug(notLeaderException.getMessage()); + return new ServiceException(notLeaderException); + } + @BeforeEach public void setUp() throws Exception { // Generate a unique in-process server name. diff --git a/hadoop-ozone/fault-injection-test/mini-chaos-tests/src/test/java/org/apache/hadoop/ozone/TestMiniChaosOzoneCluster.java b/hadoop-ozone/fault-injection-test/mini-chaos-tests/src/test/java/org/apache/hadoop/ozone/TestMiniChaosOzoneCluster.java index 1acc9386e6b1..a4c4ea0d324a 100644 --- a/hadoop-ozone/fault-injection-test/mini-chaos-tests/src/test/java/org/apache/hadoop/ozone/TestMiniChaosOzoneCluster.java +++ b/hadoop-ozone/fault-injection-test/mini-chaos-tests/src/test/java/org/apache/hadoop/ozone/TestMiniChaosOzoneCluster.java @@ -55,8 +55,6 @@ public class TestMiniChaosOzoneCluster extends GenericCli { private final List> loadClasses = new ArrayList<>(); - enum AllowedBucketLayouts { FILE_SYSTEM_OPTIMIZED, OBJECT_STORE } - @Option(names = {"-d", "--num-datanodes", "--numDatanodes"}, description = "num of datanodes. Full name --numDatanodes will be" + " removed in later versions.") @@ -219,4 +217,6 @@ void test() throws Exception { numMinutes = 2; startChaosCluster(); } + + enum AllowedBucketLayouts { FILE_SYSTEM_OPTIMIZED, OBJECT_STORE } } diff --git a/hadoop-ozone/fault-injection-test/mini-chaos-tests/src/test/java/org/apache/hadoop/ozone/loadgenerators/LoadGenerator.java b/hadoop-ozone/fault-injection-test/mini-chaos-tests/src/test/java/org/apache/hadoop/ozone/loadgenerators/LoadGenerator.java index 52cd4440c8c8..7e8c91380642 100644 --- a/hadoop-ozone/fault-injection-test/mini-chaos-tests/src/test/java/org/apache/hadoop/ozone/loadgenerators/LoadGenerator.java +++ b/hadoop-ozone/fault-injection-test/mini-chaos-tests/src/test/java/org/apache/hadoop/ozone/loadgenerators/LoadGenerator.java @@ -24,6 +24,9 @@ * Interface for load generator. */ public abstract class LoadGenerator { + + private static final String KEY_NAME_DELIMITER = "_"; + public static List> getClassList() { List> classList = new ArrayList<>(); @@ -49,8 +52,6 @@ public static List> getClassList() { * } */ - private static final String KEY_NAME_DELIMITER = "_"; - public abstract void initialize() throws Exception; public abstract void generateLoad() throws Exception; diff --git a/hadoop-ozone/httpfsgateway/src/test/java/org/apache/ozone/fs/http/server/metrics/TestHttpFSMetrics.java b/hadoop-ozone/httpfsgateway/src/test/java/org/apache/ozone/fs/http/server/metrics/TestHttpFSMetrics.java index c34df89505a3..fe9096314251 100644 --- a/hadoop-ozone/httpfsgateway/src/test/java/org/apache/ozone/fs/http/server/metrics/TestHttpFSMetrics.java +++ b/hadoop-ozone/httpfsgateway/src/test/java/org/apache/ozone/fs/http/server/metrics/TestHttpFSMetrics.java @@ -52,21 +52,6 @@ public class TestHttpFSMetrics { private static FileSystem mockFs = mock(FileSystem.class); private static FSDataOutputStream fsDataOutputStream = mock(FSDataOutputStream.class); - /** - * Mock FileSystemAccessService. - */ - public static class MockFileSystemAccessService extends FileSystemAccessService { - @Override - protected FileSystem createFileSystem(Configuration namenodeConf) throws IOException { - return mockFs; - } - - @Override - protected void closeFileSystem(FileSystem fs) throws IOException { - // do nothing - } - } - private HttpFSServerWebApp webApp; private HttpFSServerMetrics metrics; private Configuration conf; @@ -143,4 +128,19 @@ public void testFsAppend() throws Exception { assertEquals(initialAppendOps + 1, metrics.getOpsAppend()); assertEquals(initialBytesWritten + 4, metrics.getBytesWritten()); } + + /** + * Mock FileSystemAccessService. + */ + public static class MockFileSystemAccessService extends FileSystemAccessService { + @Override + protected FileSystem createFileSystem(Configuration namenodeConf) throws IOException { + return mockFs; + } + + @Override + protected void closeFileSystem(FileSystem fs) throws IOException { + // do nothing + } + } } diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/contract/AbstractContractGetFileStatusTest.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/contract/AbstractContractGetFileStatusTest.java index 3c62094393f6..6987b46167ba 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/contract/AbstractContractGetFileStatusTest.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/contract/AbstractContractGetFileStatusTest.java @@ -47,8 +47,10 @@ /** * Test getFileStatus and related listing operations. */ -public abstract class AbstractContractGetFileStatusTest extends - AbstractFSContractTestBase { +public abstract class AbstractContractGetFileStatusTest extends AbstractFSContractTestBase { + + private static final PathFilter ALL_PATHS = new AllPathsFilter(); + private static final PathFilter NO_PATHS = new NoPathsFilter(); private Path testPath; private Path target; @@ -691,9 +693,6 @@ private List verifyListLocatedStatusNextCalls( return result; } - private static final PathFilter ALL_PATHS = new AllPathsFilter(); - private static final PathFilter NO_PATHS = new NoPathsFilter(); - /** * Accept everything. */ diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/AbstractOzoneFileSystemTest.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/AbstractOzoneFileSystemTest.java index f3218e4c163e..a4d7e9675d69 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/AbstractOzoneFileSystemTest.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/AbstractOzoneFileSystemTest.java @@ -149,11 +149,6 @@ abstract class AbstractOzoneFileSystemTest { p -> !p.toUri().getPath().startsWith(TRASH_ROOT.toString()); private String fsRoot; - AbstractOzoneFileSystemTest(boolean setDefaultFs, BucketLayout layout) { - enabledFileSystemPaths = setDefaultFs; - bucketLayout = layout; - } - private static final Logger LOG = LoggerFactory.getLogger(AbstractOzoneFileSystemTest.class); @@ -176,6 +171,11 @@ abstract class AbstractOzoneFileSystemTest { .createUserForTesting(USER1, new String[] {"usergroup"}); private OzoneFileSystem userO3fs; + AbstractOzoneFileSystemTest(boolean setDefaultFs, BucketLayout layout) { + enabledFileSystemPaths = setDefaultFs; + bucketLayout = layout; + } + @BeforeAll void init() throws Exception { OzoneConfiguration conf = new OzoneConfiguration(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/AbstractRootedOzoneFileSystemTest.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/AbstractRootedOzoneFileSystemTest.java index d86e2f3b1121..df4913789f1d 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/AbstractRootedOzoneFileSystemTest.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/AbstractRootedOzoneFileSystemTest.java @@ -39,6 +39,7 @@ import static org.apache.hadoop.ozone.security.acl.IAccessAuthorizer.ACLType.LIST; import static org.apache.hadoop.ozone.security.acl.IAccessAuthorizer.ACLType.READ; import static org.apache.hadoop.ozone.security.acl.IAccessAuthorizer.ACLType.WRITE; +import static org.apache.hadoop.security.UserGroupInformation.createUserForTesting; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -146,12 +147,38 @@ @TestInstance(TestInstance.Lifecycle.PER_CLASS) abstract class AbstractRootedOzoneFileSystemTest { - private static final Logger LOG = - LoggerFactory.getLogger(AbstractRootedOzoneFileSystemTest.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractRootedOzoneFileSystemTest.class); private static final float TRASH_INTERVAL = 0.05f; // 3 seconds + + private static final String USER1 = "regularuser1"; + private static final UserGroupInformation UGI_USER1 = createUserForTesting(USER1, new String[] {"usergroup"}); + private OzoneClient client; + private final boolean enabledFileSystemPaths; + private final boolean isBucketFSOptimized; + private final boolean enableAcl; + + private OzoneConfiguration conf; + private MiniOzoneCluster cluster; + private FileSystem fs; + private RootedOzoneFileSystem ofs; + private ObjectStore objectStore; + private BasicRootedOzoneClientAdapterImpl adapter; + private Trash trash; + + private String volumeName; + private Path volumePath; + private String bucketName; + // Store path commonly used by tests that test functionality within a bucket + private Path bucketPath; + private String rootPath; + private final BucketLayout bucketLayout; + + // Non-privileged OFS instance + private RootedOzoneFileSystem userOfs; + AbstractRootedOzoneFileSystemTest(BucketLayout bucketLayout, boolean setDefaultFs, boolean isAclEnabled) { // Initialize the cluster before EACH set of parameters @@ -195,32 +222,6 @@ public Path getBucketPath() { return bucketPath; } - private final boolean enabledFileSystemPaths; - private final boolean isBucketFSOptimized; - private final boolean enableAcl; - - private OzoneConfiguration conf; - private MiniOzoneCluster cluster; - private FileSystem fs; - private RootedOzoneFileSystem ofs; - private ObjectStore objectStore; - private BasicRootedOzoneClientAdapterImpl adapter; - private Trash trash; - - private String volumeName; - private Path volumePath; - private String bucketName; - // Store path commonly used by tests that test functionality within a bucket - private Path bucketPath; - private String rootPath; - private final BucketLayout bucketLayout; - - private static final String USER1 = "regularuser1"; - private static final UserGroupInformation UGI_USER1 = UserGroupInformation - .createUserForTesting(USER1, new String[] {"usergroup"}); - // Non-privileged OFS instance - private RootedOzoneFileSystem userOfs; - @BeforeAll void initClusterAndEnv() throws IOException, InterruptedException, TimeoutException { conf = new OzoneConfiguration(); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/upgrade/TestHddsUpgradeUtils.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/upgrade/TestHddsUpgradeUtils.java index 4531b3c738b2..aa7c78b2e5ac 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/upgrade/TestHddsUpgradeUtils.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/upgrade/TestHddsUpgradeUtils.java @@ -58,15 +58,14 @@ */ public final class TestHddsUpgradeUtils { - private TestHddsUpgradeUtils() { } - - private static final Logger LOG = - LoggerFactory.getLogger(TestHddsUpgradeUtils.class); + private static final Logger LOG = LoggerFactory.getLogger(TestHddsUpgradeUtils.class); private static final ReplicationConfig RATIS_THREE = ReplicationConfig.fromProtoTypeAndFactor(HddsProtos.ReplicationType.RATIS, HddsProtos.ReplicationFactor.THREE); + private TestHddsUpgradeUtils() { } + public static void waitForFinalizationFromClient( StorageContainerLocationProtocol scmClient, String clientID) throws Exception { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestInputStreamBase.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestInputStreamBase.java index 8bdcd39ab440..79ef3f50b25e 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestInputStreamBase.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestInputStreamBase.java @@ -49,6 +49,8 @@ abstract class TestInputStreamBase { static final int BLOCK_SIZE = 2 * MAX_FLUSH_SIZE; // 8MB static final int BYTES_PER_CHECKSUM = 256 * 1024; // 256KB + private MiniOzoneCluster cluster; + protected static MiniOzoneCluster newCluster() throws Exception { OzoneConfiguration conf = new OzoneConfiguration(); @@ -90,8 +92,6 @@ protected void updateConfig(ContainerLayoutVersion layout) { closeContainers(); } - private MiniOzoneCluster cluster; - protected MiniOzoneCluster getCluster() { return cluster; } diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java index aa23fe428b73..93dad64a4a67 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java @@ -102,6 +102,9 @@ * Tests the Ratis snapshots feature in OM. */ public class TestOMRatisSnapshots { + // tried up to 1000 snapshots and this test works, but some of the + // timeouts have to be increased. + private static final int SNAPSHOTS_TO_CREATE = 100; private MiniOzoneHAClusterImpl cluster = null; private ObjectStore objectStore; @@ -189,10 +192,6 @@ public void shutdown() { } } - // tried up to 1000 snapshots and this test works, but some of the - // timeouts have to be increased. - private static final int SNAPSHOTS_TO_CREATE = 100; - @Test public void testInstallSnapshot(@TempDir Path tempDir) throws Exception { // Get the leader OM diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/tools/contract/AbstractContractDistCpTest.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/tools/contract/AbstractContractDistCpTest.java index c7e9fa3bbca5..0a1aeedc9e49 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/tools/contract/AbstractContractDistCpTest.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/tools/contract/AbstractContractDistCpTest.java @@ -102,16 +102,6 @@ public abstract class AbstractContractDistCpTest */ protected static final int DEFAULT_WIDTH = 2; - /** - * The timeout value is extended over the default so that large updates - * are allowed to take time, especially to remote stores. - * @return the current test timeout - */ - @Override - protected int getTestTimeoutMillis() { - return 15 * 60 * 1000; - } - private Configuration conf; private FileSystem localFS, remoteFS; private Path localDir, remoteDir; @@ -152,6 +142,16 @@ protected int getTestTimeoutMillis() { private Path inputDirUnderOutputDir; + /** + * The timeout value is extended over the default so that large updates + * are allowed to take time, especially to remote stores. + * @return the current test timeout + */ + @Override + protected int getTestTimeoutMillis() { + return 15 * 60 * 1000; + } + @Override protected Configuration createConfiguration() { Configuration newConf = new Configuration(); diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/lock/TestOzoneLockProvider.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/lock/TestOzoneLockProvider.java index a1b46df3d7d8..84c75e87bc58 100644 --- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/lock/TestOzoneLockProvider.java +++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/lock/TestOzoneLockProvider.java @@ -42,6 +42,9 @@ public class TestOzoneLockProvider { private OzoneManager ozoneManager; private OzoneLockStrategy ozoneLockStrategy; + private boolean keyPathLockEnabled; + private boolean enableFileSystemPaths; + public static Collection data() { return Arrays.asList( new Object[]{true, true}, @@ -50,9 +53,6 @@ public static Collection data() { new Object[]{false, false}); } - private boolean keyPathLockEnabled; - private boolean enableFileSystemPaths; - @BeforeEach public void setup() throws Exception { ozoneManager = mock(OzoneManager.class); diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/validation/testvalidatorset1/GeneralValidatorsForTesting.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/validation/testvalidatorset1/GeneralValidatorsForTesting.java index 730896928746..07269c9e9735 100644 --- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/validation/testvalidatorset1/GeneralValidatorsForTesting.java +++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/validation/testvalidatorset1/GeneralValidatorsForTesting.java @@ -52,6 +52,8 @@ public final class GeneralValidatorsForTesting { */ private static boolean validatorTestsRunning = false; + private static List listeners = new ArrayList<>(); + public static void startValidatorTest() { validatorTestsRunning = true; } @@ -74,8 +76,6 @@ public interface ValidationListener { void validationCalled(String calledMethodName); } - private static List listeners = new ArrayList<>(); - public static void addListener(ValidationListener listener) { listeners.add(listener); } diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/upgrade/TestOMUpgradeFinalizer.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/upgrade/TestOMUpgradeFinalizer.java index 687bd9ca4a8e..60b192d39231 100644 --- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/upgrade/TestOMUpgradeFinalizer.java +++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/upgrade/TestOMUpgradeFinalizer.java @@ -65,6 +65,8 @@ public class TestOMUpgradeFinalizer { @Mock private OMLayoutVersionManager versionManager; + private int storedLayoutVersion = 0; + @Test public void testEmitsFinalizedStatusIfAlreadyFinalized() throws Exception { @@ -252,8 +254,6 @@ private Iterable mockFeatures( return ret; } - private int storedLayoutVersion = 0; - private OzoneManager mockOzoneManager(int initialLayoutVersion) { OzoneManager mock = mock(OzoneManager.class); OMStorage st = mock(OMStorage.class); diff --git a/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/client/ObjectStoreStub.java b/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/client/ObjectStoreStub.java index d96236f70807..42671e2c294a 100644 --- a/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/client/ObjectStoreStub.java +++ b/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/client/ObjectStoreStub.java @@ -39,6 +39,10 @@ */ public class ObjectStoreStub extends ObjectStore { + private static OzoneConfiguration conf = new OzoneConfiguration(); + private Map volumes = new HashMap<>(); + private Map bucketEmptyStatus = new HashMap<>(); + public ObjectStoreStub() { super(); } @@ -47,10 +51,6 @@ public ObjectStoreStub(ConfigurationSource conf, ClientProtocol proxy) { super(conf, proxy); } - private Map volumes = new HashMap<>(); - private Map bucketEmptyStatus = new HashMap<>(); - private static OzoneConfiguration conf = new OzoneConfiguration(); - @Override public void createVolume(String volumeName) throws IOException { createVolume(volumeName, From 94dfb6b7c2d0b9d51caddbacb21a9ff440c87694 Mon Sep 17 00:00:00 2001 From: Ivan Zlenko <241953+ivanzlenko@users.noreply.github.com> Date: Sun, 27 Apr 2025 22:36:28 +0500 Subject: [PATCH 11/26] HDDS-12906. Move field declarations to start of class in ozone-manager module (#8343) --- .../hadoop/ozone/om/OMMultiTenantManager.java | 19 ++- .../hadoop/ozone/om/OMPerformanceMetrics.java | 24 +-- .../hadoop/ozone/om/OMPolicyProvider.java | 18 +- .../ozone/om/OzoneListStatusHelper.java | 18 +- .../apache/hadoop/ozone/om/OzoneManager.java | 32 ++-- .../hadoop/ozone/om/SstFilteringService.java | 5 +- .../hadoop/ozone/om/ha/OMHAMetrics.java | 15 +- .../ozone/om/helpers/OMAuditLogger.java | 8 +- .../om/ratis/OzoneManagerDoubleBuffer.java | 88 +++++----- .../ratis/OzoneManagerRatisServerConfig.java | 16 +- .../om/request/key/OMKeySetTimesRequest.java | 10 +- .../request/key/acl/OMKeyAddAclRequest.java | 8 +- .../key/acl/OMKeyAddAclRequestWithFSO.java | 8 +- .../key/acl/OMKeyRemoveAclRequest.java | 8 +- .../key/acl/OMKeyRemoveAclRequestWithFSO.java | 8 +- .../request/key/acl/OMKeySetAclRequest.java | 8 +- .../key/acl/OMKeySetAclRequestWithFSO.java | 8 +- .../volume/acl/OMVolumeAclRequest.java | 16 +- .../volume/acl/OMVolumeAddAclRequest.java | 8 +- .../volume/acl/OMVolumeRemoveAclRequest.java | 8 +- .../volume/acl/OMVolumeSetAclRequest.java | 8 +- .../ozone/om/s3/S3SecretCacheProvider.java | 11 +- .../om/service/OMRangerBGSyncService.java | 157 +++++++++--------- .../ozone/security/AWSV4AuthValidator.java | 6 +- 24 files changed, 256 insertions(+), 259 deletions(-) diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMMultiTenantManager.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMMultiTenantManager.java index b2dbba1d323e..07b3458d782c 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMMultiTenantManager.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMMultiTenantManager.java @@ -62,6 +62,16 @@ @InterfaceAudience.Private @InterfaceStability.Unstable public interface OMMultiTenantManager { + + String OZONE_TENANT_RANGER_POLICY_DESCRIPTION = + "Created by Ozone. WARNING: " + + "Changes will be lost when this tenant is deleted."; + + String OZONE_TENANT_RANGER_ROLE_DESCRIPTION = + "Managed by Ozone. WARNING: " + + "Changes will be overridden. " + + "Use Ozone tenant CLI to manage users in this tenant role instead."; + /* TODO: Outdated * Init multi-tenant manager. Performs initialization e.g. * - Initialize Multi-Tenant-Gatekeeper-Plugin @@ -341,15 +351,6 @@ static boolean checkAndEnableMultiTenancy( return true; } - String OZONE_TENANT_RANGER_POLICY_DESCRIPTION = - "Created by Ozone. WARNING: " - + "Changes will be lost when this tenant is deleted."; - - String OZONE_TENANT_RANGER_ROLE_DESCRIPTION = - "Managed by Ozone. WARNING: " - + "Changes will be overridden. " - + "Use Ozone tenant CLI to manage users in this tenant role instead."; - /** * Returns default VolumeAccess policy given tenant and role names. */ diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMPerformanceMetrics.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMPerformanceMetrics.java index 19a77fea7a44..d7b361330e2f 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMPerformanceMetrics.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMPerformanceMetrics.java @@ -31,18 +31,6 @@ public class OMPerformanceMetrics { private static final String SOURCE_NAME = OMPerformanceMetrics.class.getSimpleName(); - public static OMPerformanceMetrics register() { - MetricsSystem ms = DefaultMetricsSystem.instance(); - return ms.register(SOURCE_NAME, - "OzoneManager Request Performance", - new OMPerformanceMetrics()); - } - - public static void unregister() { - MetricsSystem ms = DefaultMetricsSystem.instance(); - ms.unregisterSource(SOURCE_NAME); - } - @Metric(about = "Overall lookupKey in nanoseconds") private MutableRate lookupLatencyNs; @@ -160,6 +148,18 @@ public static void unregister() { @Metric(about = "Latency of each iteration of OpenKeyCleanupService in ms") private MutableGaugeLong openKeyCleanupServiceLatencyMs; + public static OMPerformanceMetrics register() { + MetricsSystem ms = DefaultMetricsSystem.instance(); + return ms.register(SOURCE_NAME, + "OzoneManager Request Performance", + new OMPerformanceMetrics()); + } + + public static void unregister() { + MetricsSystem ms = DefaultMetricsSystem.instance(); + ms.unregisterSource(SOURCE_NAME); + } + public void addLookupLatency(long latencyInNs) { lookupLatencyNs.add(latencyInNs); } diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMPolicyProvider.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMPolicyProvider.java index d8b7a12946aa..cdea1ce6e680 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMPolicyProvider.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OMPolicyProvider.java @@ -46,15 +46,6 @@ public final class OMPolicyProvider extends PolicyProvider { private static final Supplier SUPPLIER = MemoizedSupplier.valueOf(OMPolicyProvider::new); - private OMPolicyProvider() { - } - - @Private - @Unstable - public static OMPolicyProvider getInstance() { - return SUPPLIER.get(); - } - private static final List OM_SERVICES = Arrays.asList( new Service(OZONE_OM_SECURITY_CLIENT_PROTOCOL_ACL, @@ -67,6 +58,15 @@ public static OMPolicyProvider getInstance() { ReconfigureProtocol.class) ); + private OMPolicyProvider() { + } + + @Private + @Unstable + public static OMPolicyProvider getInstance() { + return SUPPLIER.get(); + } + @Override public Service[] getServices() { return OM_SERVICES.toArray(new Service[0]); diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneListStatusHelper.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneListStatusHelper.java index 4953d3b35610..c551c5a8540f 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneListStatusHelper.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneListStatusHelper.java @@ -50,15 +50,6 @@ * Helper class for fetching List Status for a path. */ public class OzoneListStatusHelper { - /** - * Interface to get the File Status for a path. - */ - @FunctionalInterface - public interface GetFileStatusHelper { - OzoneFileStatus apply(OmKeyArgs args, String clientAddress, - boolean skipFileNotFoundError) throws IOException; - } - private static final Logger LOG = LoggerFactory.getLogger(OzoneListStatusHelper.class); @@ -79,6 +70,15 @@ OzoneFileStatus apply(OmKeyArgs args, String clientAddress, this.omDefaultReplication = omDefaultReplication; } + /** + * Interface to get the File Status for a path. + */ + @FunctionalInterface + public interface GetFileStatusHelper { + OzoneFileStatus apply(OmKeyArgs args, String clientAddress, + boolean skipFileNotFoundError) throws IOException; + } + public Collection listStatusFSO(OmKeyArgs args, String startKey, long numEntries, String clientAddress, boolean allowPartialPrefixes) throws IOException { diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java index df3cef96a54b..d265e6dfd8eb 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java @@ -481,22 +481,6 @@ public final class OzoneManager extends ServiceRuntimeInfoImpl private String omHostName; - /** - * OM Startup mode. - */ - public enum StartupOption { - REGUALR, - BOOTSTRAP, - FORCE_BOOTSTRAP - } - - private enum State { - INITIALIZED, - BOOTSTRAPPING, - RUNNING, - STOPPED - } - // Used in MiniOzoneCluster testing private State omState; private Thread emptier; @@ -5157,4 +5141,20 @@ public void compactOMDB(String columnFamily) throws IOException { public OMExecutionFlow getOmExecutionFlow() { return omExecutionFlow; } + + /** + * OM Startup mode. + */ + public enum StartupOption { + REGUALR, + BOOTSTRAP, + FORCE_BOOTSTRAP + } + + private enum State { + INITIALIZED, + BOOTSTRAPPING, + RUNNING, + STOPPED + } } diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SstFilteringService.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SstFilteringService.java index 99d749a9fb56..f761f31db6a2 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SstFilteringService.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SstFilteringService.java @@ -83,6 +83,8 @@ public class SstFilteringService extends BackgroundService private AtomicBoolean running; + private final BootstrapStateHandler.Lock lock = new BootstrapStateHandler.Lock(); + public static boolean isSstFiltered(OzoneConfiguration ozoneConfiguration, SnapshotInfo snapshotInfo) { Path sstFilteredFile = Paths.get(OmSnapshotManager.getSnapshotPath(ozoneConfiguration, snapshotInfo), SST_FILTERED_FILE); @@ -101,9 +103,6 @@ public SstFilteringService(long interval, TimeUnit unit, long serviceTimeout, running = new AtomicBoolean(false); } - private final BootstrapStateHandler.Lock lock = - new BootstrapStateHandler.Lock(); - @Override public void start() { running.set(true); diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ha/OMHAMetrics.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ha/OMHAMetrics.java index cf7e3e0f2588..b13a8e0b607a 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ha/OMHAMetrics.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ha/OMHAMetrics.java @@ -34,6 +34,13 @@ @Metrics(about = "OzoneManager HA Metrics", context = OzoneConsts.OZONE) public final class OMHAMetrics implements MetricsSource { + public static final String SOURCE_NAME = OMHAMetrics.class.getSimpleName(); + private final OMHAMetricsInfo omhaMetricsInfo = new OMHAMetricsInfo(); + private MetricsRegistry metricsRegistry; + + private String currNodeId; + private String leaderId; + /** * Private nested class to hold the values * of MetricsInfo for OMHAMetrics. @@ -72,14 +79,6 @@ public void setNodeId(String nodeId) { } } - public static final String SOURCE_NAME = - OMHAMetrics.class.getSimpleName(); - private final OMHAMetricsInfo omhaMetricsInfo = new OMHAMetricsInfo(); - private MetricsRegistry metricsRegistry; - - private String currNodeId; - private String leaderId; - private OMHAMetrics(String currNodeId, String leaderId) { this.currNodeId = currNodeId; this.leaderId = leaderId; diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/helpers/OMAuditLogger.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/helpers/OMAuditLogger.java index 80c20f7af6dc..e6185f3d65a0 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/helpers/OMAuditLogger.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/helpers/OMAuditLogger.java @@ -37,16 +37,18 @@ * This class is used for OM Audit logs. */ public final class OMAuditLogger { - private OMAuditLogger() { - } - private static final Map CMD_AUDIT_ACTION_MAP = new HashMap<>(); private static final Logger LOG = LoggerFactory.getLogger(OMAuditLogger.class); + private static final Map CMD_AUDIT_ACTION_MAP = new HashMap<>(); + static { init(); } + private OMAuditLogger() { + } + private static void init() { CMD_AUDIT_ACTION_MAP.put(Type.CreateVolume, OMAction.CREATE_VOLUME); CMD_AUDIT_ACTION_MAP.put(Type.DeleteVolume, OMAction.DELETE_VOLUME); diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerDoubleBuffer.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerDoubleBuffer.java index c7f17e16bb33..bf7dd2df7b0f 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerDoubleBuffer.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerDoubleBuffer.java @@ -73,6 +73,35 @@ public final class OzoneManagerDoubleBuffer { private static final Logger LOG = LoggerFactory.getLogger(OzoneManagerDoubleBuffer.class); + private Queue currentBuffer; + private Queue readyBuffer; + /** + * Limit the number of un-flushed transactions for {@link OzoneManagerStateMachine}. + */ + private final Semaphore unFlushedTransactions; + + /** To flush the buffers. */ + private final Daemon daemon; + /** Is the {@link #daemon} running? */ + private final AtomicBoolean isRunning = new AtomicBoolean(false); + /** Notify flush operations are completed by the {@link #daemon}. */ + private final FlushNotifier flushNotifier; + + private final OMMetadataManager omMetadataManager; + + private final Consumer updateLastAppliedIndex; + + private final S3SecretManager s3SecretManager; + + private final boolean isTracingEnabled; + + private final OzoneManagerDoubleBufferMetrics metrics = OzoneManagerDoubleBufferMetrics.create(); + + /** Accumulative count (for testing and debug only). */ + private final AtomicLong flushedTransactionCount = new AtomicLong(); + /** The number of flush iterations (for testing and debug only). */ + private final AtomicLong flushIterations = new AtomicLong(); + /** Entry for {@link #currentBuffer} and {@link #readyBuffer}. */ private static class Entry { private final TermIndex termIndex; @@ -160,35 +189,6 @@ static Semaphore newSemaphore(int permits) { return permits > 0 ? new Semaphore(permits) : null; } - private Queue currentBuffer; - private Queue readyBuffer; - /** - * Limit the number of un-flushed transactions for {@link OzoneManagerStateMachine}. - */ - private final Semaphore unFlushedTransactions; - - /** To flush the buffers. */ - private final Daemon daemon; - /** Is the {@link #daemon} running? */ - private final AtomicBoolean isRunning = new AtomicBoolean(false); - /** Notify flush operations are completed by the {@link #daemon}. */ - private final FlushNotifier flushNotifier; - - private final OMMetadataManager omMetadataManager; - - private final Consumer updateLastAppliedIndex; - - private final S3SecretManager s3SecretManager; - - private final boolean isTracingEnabled; - - private final OzoneManagerDoubleBufferMetrics metrics = OzoneManagerDoubleBufferMetrics.create(); - - /** Accumulative count (for testing and debug only). */ - private final AtomicLong flushedTransactionCount = new AtomicLong(); - /** The number of flush iterations (for testing and debug only). */ - private final AtomicLong flushIterations = new AtomicLong(); - private OzoneManagerDoubleBuffer(Builder b) { this.currentBuffer = new ConcurrentLinkedQueue<>(); this.readyBuffer = new ConcurrentLinkedQueue<>(); @@ -613,21 +613,6 @@ public void awaitFlush() throws InterruptedException { } static class FlushNotifier { - static class Entry { - private final CompletableFuture future = new CompletableFuture<>(); - private int count; - - private CompletableFuture await() { - count++; - return future; - } - - private int complete() { - Preconditions.assertTrue(future.complete(count)); - return future.join(); - } - } - /** The size of the map is at most two since it uses {@link #flushCount} + 2 in {@link #await()} .*/ private final Map flushFutures = new TreeMap<>(); private int awaitCount; @@ -652,5 +637,20 @@ synchronized int notifyFlush() { LOG.debug("notifyFlush {}, awaitCount: {} -> {}", flush, await, awaitCount); return await; } + + static class Entry { + private final CompletableFuture future = new CompletableFuture<>(); + private int count; + + private CompletableFuture await() { + count++; + return future; + } + + private int complete() { + Preconditions.assertTrue(future.complete(count)); + return future.join(); + } + } } } diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerRatisServerConfig.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerRatisServerConfig.java index d862366b6f82..a3703dfe63bc 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerRatisServerConfig.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerRatisServerConfig.java @@ -44,14 +44,6 @@ public class OzoneManagerRatisServerConfig { ) private long logAppenderWaitTimeMin; - public long getLogAppenderWaitTimeMin() { - return logAppenderWaitTimeMin; - } - - public void setLogAppenderWaitTimeMin(long logAppenderWaitTimeMin) { - this.logAppenderWaitTimeMin = logAppenderWaitTimeMin; - } - @Config(key = "retrycache.expirytime", defaultValue = "300s", type = ConfigType.TIME, @@ -60,6 +52,14 @@ public void setLogAppenderWaitTimeMin(long logAppenderWaitTimeMin) { ) private long retryCacheTimeout = Duration.ofSeconds(300).toMillis(); + public long getLogAppenderWaitTimeMin() { + return logAppenderWaitTimeMin; + } + + public void setLogAppenderWaitTimeMin(long logAppenderWaitTimeMin) { + this.logAppenderWaitTimeMin = logAppenderWaitTimeMin; + } + public long getRetryCacheTimeout() { return retryCacheTimeout; } diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeySetTimesRequest.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeySetTimesRequest.java index 31f0eabada84..4322e543fae3 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeySetTimesRequest.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeySetTimesRequest.java @@ -55,6 +55,11 @@ public class OMKeySetTimesRequest extends OMKeyRequest { private static final Logger LOG = LoggerFactory.getLogger(OMKeySetTimesRequest.class); + private final String volumeName; + private final String bucketName; + private final String keyName; + private final long modificationTime; + @Override public OMRequest preExecute(OzoneManager ozoneManager) throws IOException { OMRequest request = super.preExecute(ozoneManager); @@ -81,11 +86,6 @@ public OMRequest preExecute(OzoneManager ozoneManager) throws IOException { .build(); } - private final String volumeName; - private final String bucketName; - private final String keyName; - private final long modificationTime; - public OMKeySetTimesRequest(OMRequest omRequest, BucketLayout bucketLayout) { super(omRequest, bucketLayout); OzoneManagerProtocolProtos.SetTimesRequest setTimesRequest = diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeyAddAclRequest.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeyAddAclRequest.java index 2b4985f0b785..fa09e6bb3ec1 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeyAddAclRequest.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeyAddAclRequest.java @@ -57,6 +57,10 @@ public class OMKeyAddAclRequest extends OMKeyAclRequest { private static final Logger LOG = LoggerFactory.getLogger(OMKeyAddAclRequest.class); + private String path; + private List ozoneAcls; + private OzoneObj obj; + @Override public OMRequest preExecute(OzoneManager ozoneManager) throws IOException { long modificationTime = Time.now(); @@ -70,10 +74,6 @@ public OMRequest preExecute(OzoneManager ozoneManager) throws IOException { .build(); } - private String path; - private List ozoneAcls; - private OzoneObj obj; - public OMKeyAddAclRequest(OMRequest omRequest, OzoneManager ozoneManager) { super(omRequest); OzoneManagerProtocolProtos.AddAclRequest addAclRequest = diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeyAddAclRequestWithFSO.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeyAddAclRequestWithFSO.java index 28a66eb55294..bc33b0a9de1f 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeyAddAclRequestWithFSO.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeyAddAclRequestWithFSO.java @@ -48,6 +48,10 @@ public class OMKeyAddAclRequestWithFSO extends OMKeyAclRequestWithFSO { private static final Logger LOG = LoggerFactory.getLogger(OMKeyAddAclRequestWithFSO.class); + private String path; + private List ozoneAcls; + private OzoneObj obj; + @Override public OzoneManagerProtocolProtos.OMRequest preExecute( OzoneManager ozoneManager) throws IOException { @@ -60,10 +64,6 @@ public OzoneManagerProtocolProtos.OMRequest preExecute( .setUserInfo(getUserInfo()).build(); } - private String path; - private List ozoneAcls; - private OzoneObj obj; - public OMKeyAddAclRequestWithFSO( OzoneManagerProtocolProtos.OMRequest omReq, BucketLayout bucketLayout) { super(omReq, bucketLayout); diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeyRemoveAclRequest.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeyRemoveAclRequest.java index be3c5facbbcf..b34086410464 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeyRemoveAclRequest.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeyRemoveAclRequest.java @@ -57,6 +57,10 @@ public class OMKeyRemoveAclRequest extends OMKeyAclRequest { private static final Logger LOG = LoggerFactory.getLogger(OMKeyRemoveAclRequest.class); + private String path; + private List ozoneAcls; + private OzoneObj obj; + @Override public OMRequest preExecute(OzoneManager ozoneManager) throws IOException { long modificationTime = Time.now(); @@ -70,10 +74,6 @@ public OMRequest preExecute(OzoneManager ozoneManager) throws IOException { .build(); } - private String path; - private List ozoneAcls; - private OzoneObj obj; - public OMKeyRemoveAclRequest(OMRequest omRequest, OzoneManager ozoneManager) { super(omRequest); OzoneManagerProtocolProtos.RemoveAclRequest removeAclRequest = diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeyRemoveAclRequestWithFSO.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeyRemoveAclRequestWithFSO.java index 3744764e99ac..f216cf7d86f0 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeyRemoveAclRequestWithFSO.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeyRemoveAclRequestWithFSO.java @@ -48,6 +48,10 @@ public class OMKeyRemoveAclRequestWithFSO extends OMKeyAclRequestWithFSO { private static final Logger LOG = LoggerFactory.getLogger(OMKeyRemoveAclRequestWithFSO.class); + private String path; + private List ozoneAcls; + private OzoneObj obj; + @Override public OzoneManagerProtocolProtos.OMRequest preExecute( OzoneManager ozoneManager) throws IOException { @@ -62,10 +66,6 @@ public OzoneManagerProtocolProtos.OMRequest preExecute( .build(); } - private String path; - private List ozoneAcls; - private OzoneObj obj; - public OMKeyRemoveAclRequestWithFSO( OzoneManagerProtocolProtos.OMRequest omRequest, BucketLayout bucketLayout) { diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeySetAclRequest.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeySetAclRequest.java index c9a304fd4de9..d713dd1dc714 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeySetAclRequest.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeySetAclRequest.java @@ -58,6 +58,10 @@ public class OMKeySetAclRequest extends OMKeyAclRequest { private static final Logger LOG = LoggerFactory.getLogger(OMKeySetAclRequest.class); + private String path; + private List ozoneAcls; + private OzoneObj obj; + @Override public OMRequest preExecute(OzoneManager ozoneManager) throws IOException { long modificationTime = Time.now(); @@ -71,10 +75,6 @@ public OMRequest preExecute(OzoneManager ozoneManager) throws IOException { .build(); } - private String path; - private List ozoneAcls; - private OzoneObj obj; - public OMKeySetAclRequest(OMRequest omRequest, OzoneManager ozoneManager) { super(omRequest); OzoneManagerProtocolProtos.SetAclRequest setAclRequest = diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeySetAclRequestWithFSO.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeySetAclRequestWithFSO.java index 68ba967ca292..6cdefe8e4fe2 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeySetAclRequestWithFSO.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/acl/OMKeySetAclRequestWithFSO.java @@ -49,6 +49,10 @@ public class OMKeySetAclRequestWithFSO extends OMKeyAclRequestWithFSO { private static final Logger LOG = LoggerFactory.getLogger(OMKeySetAclRequestWithFSO.class); + private String path; + private List ozoneAcls; + private OzoneObj obj; + @Override public OzoneManagerProtocolProtos.OMRequest preExecute( OzoneManager ozoneManager) throws IOException { @@ -61,10 +65,6 @@ public OzoneManagerProtocolProtos.OMRequest preExecute( .setUserInfo(getUserInfo()).build(); } - private String path; - private List ozoneAcls; - private OzoneObj obj; - public OMKeySetAclRequestWithFSO( OzoneManagerProtocolProtos.OMRequest omReq, BucketLayout bucketLayout) { super(omReq, bucketLayout); diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/volume/acl/OMVolumeAclRequest.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/volume/acl/OMVolumeAclRequest.java index 91a6060b22f4..32a362e32d3f 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/volume/acl/OMVolumeAclRequest.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/volume/acl/OMVolumeAclRequest.java @@ -47,14 +47,6 @@ */ public abstract class OMVolumeAclRequest extends OMVolumeRequest { - /** - * Volume ACL operation. - */ - public interface VolumeAclOp extends - CheckedBiConsumer, OmVolumeArgs, IOException> { - // just a shortcut to avoid having to repeat long list of generic parameters - } - private final VolumeAclOp omVolumeAclOp; OMVolumeAclRequest(OzoneManagerProtocolProtos.OMRequest omRequest, @@ -200,4 +192,12 @@ abstract OMClientResponse onFailure(OMResponse.Builder omResponse, */ abstract void onComplete(Result result, Exception ex, long trxnLogIndex, AuditLogger auditLogger, Map auditMap); + + /** + * Volume ACL operation. + */ + public interface VolumeAclOp extends + CheckedBiConsumer, OmVolumeArgs, IOException> { + // just a shortcut to avoid having to repeat long list of generic parameters + } } diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/volume/acl/OMVolumeAddAclRequest.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/volume/acl/OMVolumeAddAclRequest.java index 88b07ff053bb..c3baca532097 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/volume/acl/OMVolumeAddAclRequest.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/volume/acl/OMVolumeAddAclRequest.java @@ -50,6 +50,10 @@ public class OMVolumeAddAclRequest extends OMVolumeAclRequest { private static final VolumeAclOp VOLUME_ADD_ACL_OP = (acls, volArgs) -> volArgs.addAcl(acls.get(0)); + private final List ozoneAcls; + private final String volumeName; + private final OzoneObj obj; + @Override public OMRequest preExecute(OzoneManager ozoneManager) throws IOException { long modificationTime = Time.now(); @@ -63,10 +67,6 @@ public OMRequest preExecute(OzoneManager ozoneManager) throws IOException { .build(); } - private final List ozoneAcls; - private final String volumeName; - private final OzoneObj obj; - public OMVolumeAddAclRequest(OMRequest omRequest) { super(omRequest, VOLUME_ADD_ACL_OP); OzoneManagerProtocolProtos.AddAclRequest addAclRequest = diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/volume/acl/OMVolumeRemoveAclRequest.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/volume/acl/OMVolumeRemoveAclRequest.java index 05f470d56c50..6482770954b6 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/volume/acl/OMVolumeRemoveAclRequest.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/volume/acl/OMVolumeRemoveAclRequest.java @@ -50,6 +50,10 @@ public class OMVolumeRemoveAclRequest extends OMVolumeAclRequest { private static final VolumeAclOp VOLUME_REMOVE_ACL_OP = (acls, volArgs) -> volArgs.removeAcl(acls.get(0)); + private final List ozoneAcls; + private final String volumeName; + private final OzoneObj obj; + @Override public OMRequest preExecute(OzoneManager ozoneManager) throws IOException { long modificationTime = Time.now(); @@ -63,10 +67,6 @@ public OMRequest preExecute(OzoneManager ozoneManager) throws IOException { .build(); } - private final List ozoneAcls; - private final String volumeName; - private final OzoneObj obj; - public OMVolumeRemoveAclRequest(OMRequest omRequest) { super(omRequest, VOLUME_REMOVE_ACL_OP); OzoneManagerProtocolProtos.RemoveAclRequest removeAclRequest = diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/volume/acl/OMVolumeSetAclRequest.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/volume/acl/OMVolumeSetAclRequest.java index 242c3e3ffa30..49031363cf84 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/volume/acl/OMVolumeSetAclRequest.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/volume/acl/OMVolumeSetAclRequest.java @@ -50,6 +50,10 @@ public class OMVolumeSetAclRequest extends OMVolumeAclRequest { private static final VolumeAclOp VOLUME_SET_ACL_OP = (acls, volArgs) -> volArgs.setAcls(acls); + private final List ozoneAcls; + private final String volumeName; + private final OzoneObj obj; + @Override public OMRequest preExecute(OzoneManager ozoneManager) throws IOException { long modificationTime = Time.now(); @@ -63,10 +67,6 @@ public OMRequest preExecute(OzoneManager ozoneManager) throws IOException { .build(); } - private final List ozoneAcls; - private final String volumeName; - private final OzoneObj obj; - public OMVolumeSetAclRequest(OMRequest omRequest) { super(omRequest, VOLUME_SET_ACL_OP); OzoneManagerProtocolProtos.SetAclRequest setAclRequest = diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/s3/S3SecretCacheProvider.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/s3/S3SecretCacheProvider.java index ea25e37dcce2..693c0d6fc9d7 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/s3/S3SecretCacheProvider.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/s3/S3SecretCacheProvider.java @@ -25,6 +25,10 @@ * Provider of {@link S3SecretCache}. */ public interface S3SecretCacheProvider { + /** + * In-memory cache implementation. + */ + S3SecretCacheProvider IN_MEMORY = conf -> new S3InMemoryCache(); /** * Returns S3 secret cache instance constructed by provided configuration. @@ -33,11 +37,4 @@ public interface S3SecretCacheProvider { * @return S3 secret cache instance. */ S3SecretCache get(Configuration conf); - - /** - * In-memory cache implementation. - */ - S3SecretCacheProvider IN_MEMORY = conf -> { - return new S3InMemoryCache(); - }; } diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/OMRangerBGSyncService.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/OMRangerBGSyncService.java index 4bb672f39a8a..7c4609bb05bd 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/OMRangerBGSyncService.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/OMRangerBGSyncService.java @@ -100,85 +100,6 @@ public class OMRangerBGSyncService extends BackgroundService { private volatile boolean isServiceStarted = false; - static class BGRole { - private final String name; - private String id; - private final HashSet userSet; - - BGRole(String n) { - this.name = n; - userSet = new HashSet<>(); - } - - public void setId(String id) { - this.id = id; - } - - public String getId() { - return id; - } - - public void addUserPrincipal(String userPrincipal) { - userSet.add(userPrincipal); - } - - public HashSet getUserSet() { - return userSet; - } - - @Override - public int hashCode() { - return Objects.hash(name, id, userSet); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BGRole bgRole = (BGRole) o; - return name.equals(bgRole.name) - && id.equals(bgRole.id) - && userSet.equals(bgRole.userSet); - } - } - - enum PolicyType { - BUCKET_NAMESPACE_POLICY, - BUCKET_POLICY - } - - /** - * Helper class that stores the tenant name and policy type. - */ - static class PolicyInfo { - - private final String tenantId; - private final PolicyType policyType; - - PolicyInfo(String tenantId, PolicyType policyType) { - this.tenantId = tenantId; - this.policyType = policyType; - } - - public String getTenantId() { - return tenantId; - } - - public PolicyType getPolicyType() { - return policyType; - } - - @Override - public String toString() { - return "PolicyInfo{" + - "tenantId='" + tenantId + '\'' + ", policyType=" + policyType + '}'; - } - } - // This map keeps all the policies found in OM DB. These policies should be // in Ranger. If not, the default policy will be (re)created. // @@ -868,4 +789,82 @@ private void pushOMDBRoleToRanger(String roleName) throws IOException { public long getRangerSyncRunCount() { return runCount.get(); } + + static class BGRole { + private final String name; + private String id; + private final HashSet userSet; + + BGRole(String n) { + this.name = n; + userSet = new HashSet<>(); + } + + public void setId(String id) { + this.id = id; + } + + public String getId() { + return id; + } + + public void addUserPrincipal(String userPrincipal) { + userSet.add(userPrincipal); + } + + public HashSet getUserSet() { + return userSet; + } + + @Override + public int hashCode() { + return Objects.hash(name, id, userSet); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BGRole bgRole = (BGRole) o; + return name.equals(bgRole.name) + && id.equals(bgRole.id) + && userSet.equals(bgRole.userSet); + } + } + + enum PolicyType { + BUCKET_NAMESPACE_POLICY, + BUCKET_POLICY + } + + /** + * Helper class that stores the tenant name and policy type. + */ + static class PolicyInfo { + + private final String tenantId; + private final PolicyType policyType; + + PolicyInfo(String tenantId, PolicyType policyType) { + this.tenantId = tenantId; + this.policyType = policyType; + } + + public String getTenantId() { + return tenantId; + } + + public PolicyType getPolicyType() { + return policyType; + } + + @Override + public String toString() { + return "PolicyInfo{tenantId='" + tenantId + '\'' + ", policyType=" + policyType + '}'; + } + } } diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/security/AWSV4AuthValidator.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/security/AWSV4AuthValidator.java index 1df5c8390224..4118894e7223 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/security/AWSV4AuthValidator.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/security/AWSV4AuthValidator.java @@ -39,9 +39,6 @@ final class AWSV4AuthValidator { LoggerFactory.getLogger(AWSV4AuthValidator.class); private static final String HMAC_SHA256_ALGORITHM = "HmacSHA256"; - private AWSV4AuthValidator() { - } - /** * ThreadLocal cache of Mac instances. */ @@ -56,6 +53,9 @@ private AWSV4AuthValidator() { } }); + private AWSV4AuthValidator() { + } + public static String hash(String payload) throws NoSuchAlgorithmException { MessageDigest md = MessageDigest.getInstance("SHA-256"); md.update(payload.getBytes(StandardCharsets.UTF_8)); From 99effbc51eccc64cc0aa927deaff6b62d7b72712 Mon Sep 17 00:00:00 2001 From: Ivan Zlenko <241953+ivanzlenko@users.noreply.github.com> Date: Sun, 27 Apr 2025 23:38:17 +0500 Subject: [PATCH 12/26] HDDS-12905. Move field declarations to start of class in ozone-common (#8342) --- .../ozone/client/io/SelectorOutputStream.java | 7 +- .../hadoop/ozone/om/helpers/OmBucketInfo.java | 8 +- .../ozone/om/helpers/OmDBAccessIdInfo.java | 8 +- .../ozone/om/helpers/OmDBTenantState.java | 8 +- .../om/helpers/OmDBUserPrincipalInfo.java | 8 +- .../ozone/om/helpers/OmDirectoryInfo.java | 8 +- .../hadoop/ozone/om/helpers/OmKeyInfo.java | 26 +++---- .../ozone/om/helpers/OmMultipartKeyInfo.java | 62 +++++++-------- .../hadoop/ozone/om/helpers/OmVolumeArgs.java | 8 +- .../hadoop/ozone/om/helpers/OzoneAclUtil.java | 6 +- .../ozone/om/helpers/RepeatedOmKeyInfo.java | 4 +- .../ozone/om/helpers/S3SecretValue.java | 8 +- .../ozone/om/helpers/SnapshotDiffJob.java | 8 +- .../hadoop/ozone/om/helpers/SnapshotInfo.java | 76 +++++++++---------- .../ozone/om/protocolPB/GrpcOmTransport.java | 8 +- .../protocolPB/grpc/GrpcClientConstants.java | 6 +- .../ozone/security/GDPRSymmetricKey.java | 10 +-- .../OzoneDelegationTokenSelector.java | 5 +- .../snapshot/SnapshotDiffReportOzone.java | 13 ++-- .../apache/hadoop/ozone/util/RadixNode.java | 14 ++-- .../apache/hadoop/ozone/util/RadixTree.java | 10 +-- .../hadoop/ozone/web/utils/OzoneUtils.java | 8 +- 22 files changed, 158 insertions(+), 161 deletions(-) diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/client/io/SelectorOutputStream.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/client/io/SelectorOutputStream.java index 58a6408b7fc7..0618d4a354b6 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/client/io/SelectorOutputStream.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/client/io/SelectorOutputStream.java @@ -38,6 +38,10 @@ */ public class SelectorOutputStream extends OutputStream implements Syncable, StreamCapabilities { + + private final ByteArrayBuffer buffer; + private final Underlying underlying; + /** A buffer backed by a byte[]. */ static final class ByteArrayBuffer { private byte[] array; @@ -108,9 +112,6 @@ private OUT select(int outstandingBytes, boolean force) throws IOException { } } - private final ByteArrayBuffer buffer; - private final Underlying underlying; - /** * Construct a {@link SelectorOutputStream} which first writes to a buffer. * Once the buffer has become full, select an {@link OutputStream}. diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmBucketInfo.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmBucketInfo.java index c64f727300cb..85ac9290c60d 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmBucketInfo.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmBucketInfo.java @@ -48,10 +48,6 @@ public final class OmBucketInfo extends WithObjectID implements Auditable, CopyO OmBucketInfo::getProtobuf, OmBucketInfo.class); - public static Codec getCodec() { - return CODEC; - } - /** * Name of the volume in which the bucket belongs to. */ @@ -129,6 +125,10 @@ private OmBucketInfo(Builder b) { this.defaultReplicationConfig = b.defaultReplicationConfig; } + public static Codec getCodec() { + return CODEC; + } + /** * Returns the Volume Name. * @return String. 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 e7feb2564c56..0d2ecc083436 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 @@ -36,10 +36,6 @@ public final class OmDBAccessIdInfo { OmDBAccessIdInfo.class, DelegatedCodec.CopyType.SHALLOW); - public static Codec getCodec() { - return CODEC; - } - /** * Name of the tenant. */ @@ -66,6 +62,10 @@ public OmDBAccessIdInfo(String tenantId, String userPrincipal, this.isDelegatedAdmin = isDelegatedAdmin; } + public static Codec getCodec() { + return CODEC; + } + public String getTenantId() { return tenantId; } 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 ca1b6e2aea5e..70b744e103d5 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 @@ -36,10 +36,6 @@ public final class OmDBTenantState implements Comparable { OmDBTenantState.class, DelegatedCodec.CopyType.SHALLOW); - public static Codec getCodec() { - return CODEC; - } - /** * Name of the tenant. */ @@ -76,6 +72,10 @@ public OmDBTenantState(String tenantId, String bucketNamespaceName, this.bucketPolicyName = bucketPolicyName; } + public static Codec getCodec() { + return CODEC; + } + @Override public boolean equals(Object o) { if (this == o) { 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 cf3d61e06b21..5c7ebdfc67ae 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 @@ -38,10 +38,6 @@ public final class OmDBUserPrincipalInfo { OmDBUserPrincipalInfo::getProtobuf, OmDBUserPrincipalInfo.class); - public static Codec getCodec() { - return CODEC; - } - /** * A set of accessIds. */ @@ -51,6 +47,10 @@ public OmDBUserPrincipalInfo(Set accessIds) { this.accessIds = new HashSet<>(accessIds); } + public static Codec getCodec() { + return CODEC; + } + public Set getAccessIds() { return accessIds; } diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmDirectoryInfo.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmDirectoryInfo.java index 51158df37788..fcd5f4a76008 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmDirectoryInfo.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmDirectoryInfo.java @@ -42,10 +42,6 @@ public class OmDirectoryInfo extends WithParentObjectId OmDirectoryInfo::getProtobuf, OmDirectoryInfo.class); - public static Codec getCodec() { - return CODEC; - } - private final String name; // directory name private String owner; @@ -63,6 +59,10 @@ public OmDirectoryInfo(Builder builder) { this.modificationTime = builder.modificationTime; } + public static Codec getCodec() { + return CODEC; + } + /** * Returns new builder class that builds a OmPrefixInfo. * diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyInfo.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyInfo.java index f6301797a6fa..6da0f57d787b 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyInfo.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyInfo.java @@ -59,19 +59,6 @@ public final class OmKeyInfo extends WithParentObjectId private static final Codec CODEC_TRUE = newCodec(true); private static final Codec CODEC_FALSE = newCodec(false); - private static Codec newCodec(boolean ignorePipeline) { - return new DelegatedCodec<>( - Proto2Codec.get(KeyInfo.getDefaultInstance()), - OmKeyInfo::getFromProtobuf, - k -> k.getProtobuf(ignorePipeline, ClientVersion.CURRENT_VERSION), - OmKeyInfo.class); - } - - public static Codec getCodec(boolean ignorePipeline) { - LOG.debug("OmKeyInfo.getCodec ignorePipeline = {}", ignorePipeline); - return ignorePipeline ? CODEC_TRUE : CODEC_FALSE; - } - private final String volumeName; private final String bucketName; // name of key client specified @@ -134,6 +121,19 @@ private OmKeyInfo(Builder b) { this.expectedDataGeneration = b.expectedDataGeneration; } + private static Codec newCodec(boolean ignorePipeline) { + return new DelegatedCodec<>( + Proto2Codec.get(KeyInfo.getDefaultInstance()), + OmKeyInfo::getFromProtobuf, + k -> k.getProtobuf(ignorePipeline, ClientVersion.CURRENT_VERSION), + OmKeyInfo.class); + } + + public static Codec getCodec(boolean ignorePipeline) { + LOG.debug("OmKeyInfo.getCodec ignorePipeline = {}", ignorePipeline); + return ignorePipeline ? CODEC_TRUE : CODEC_FALSE; + } + public String getVolumeName() { return volumeName; } diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmMultipartKeyInfo.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmMultipartKeyInfo.java index 1f61cd39bf1f..30bd28647595 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmMultipartKeyInfo.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmMultipartKeyInfo.java @@ -45,6 +45,35 @@ public final class OmMultipartKeyInfo extends WithObjectID implements CopyObject OmMultipartKeyInfo::getProto, OmMultipartKeyInfo.class); + private final String uploadID; + private final long creationTime; + private final ReplicationConfig replicationConfig; + private PartKeyInfoMap partKeyInfoMap; + + /** + * A pointer to parent directory used for path traversal. ParentID will be + * used only when the multipart key is created into a FileSystemOptimized(FSO) + * bucket. + *

+ * For example, if a key "a/b/multiKey1" created into a FSOBucket then each + * path component will be assigned an ObjectId and linked to its parent path + * component using parent's objectID. + *

+ * Say, Bucket's ObjectID = 512, which is the parent for its immediate child + * element. + *

+ * ------------------------------------------| + * PathComponent | ObjectID | ParentID | + * ------------------------------------------| + * a | 1024 | 512 | + * ------------------------------------------| + * b | 1025 | 1024 | + * ------------------------------------------| + * multiKey1 | 1026 | 1025 | + * ------------------------------------------| + */ + private final long parentID; + public static Codec getCodec() { return CODEC; } @@ -63,6 +92,8 @@ public static class PartKeyInfoMap implements Iterable { return Integer.compare(partNumber1, partNumber2); }; + private final List sorted; + /** * Adds a PartKeyInfo to sortedPartKeyInfoList. * If a partKeyInfo with the same PartNumber is in the array, the old value @@ -93,8 +124,6 @@ static PartKeyInfoMap put(PartKeyInfo partKeyInfo, return new PartKeyInfoMap(list); } - private final List sorted; - PartKeyInfoMap(List sorted) { this.sorted = Collections.unmodifiableList(sorted); } @@ -130,35 +159,6 @@ public PartKeyInfo lastEntry() { } } - private final String uploadID; - private final long creationTime; - private final ReplicationConfig replicationConfig; - private PartKeyInfoMap partKeyInfoMap; - - /** - * A pointer to parent directory used for path traversal. ParentID will be - * used only when the multipart key is created into a FileSystemOptimized(FSO) - * bucket. - *

- * For example, if a key "a/b/multiKey1" created into a FSOBucket then each - * path component will be assigned an ObjectId and linked to its parent path - * component using parent's objectID. - *

- * Say, Bucket's ObjectID = 512, which is the parent for its immediate child - * element. - *

- * ------------------------------------------| - * PathComponent | ObjectID | ParentID | - * ------------------------------------------| - * a | 1024 | 512 | - * ------------------------------------------| - * b | 1025 | 1024 | - * ------------------------------------------| - * multiKey1 | 1026 | 1025 | - * ------------------------------------------| - */ - private final long parentID; - /** * Construct OmMultipartKeyInfo object which holds multipart upload * information for a key. diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmVolumeArgs.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmVolumeArgs.java index 1a36379bc724..435543d87177 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmVolumeArgs.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmVolumeArgs.java @@ -46,10 +46,6 @@ public final class OmVolumeArgs extends WithObjectID OmVolumeArgs::getProtobuf, OmVolumeArgs.class); - public static Codec getCodec() { - return CODEC; - } - private final String adminName; private String ownerName; private final String volume; @@ -87,6 +83,10 @@ private OmVolumeArgs(Builder b) { this.refCount = b.refCount; } + public static Codec getCodec() { + return CODEC; + } + public long getRefCount() { Preconditions.checkState(refCount >= 0L, "refCount should not be negative"); return refCount; diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OzoneAclUtil.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OzoneAclUtil.java index d9d9d23dc8a3..f3af4f73da98 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OzoneAclUtil.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OzoneAclUtil.java @@ -46,12 +46,12 @@ public final class OzoneAclUtil { static final Logger LOG = LoggerFactory.getLogger(OzoneAclUtil.class); - private OzoneAclUtil() { - } - private static ACLType[] userRights; private static ACLType[] groupRights; + private OzoneAclUtil() { + } + /** * Helper function to get default access acl list for current user. * diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/RepeatedOmKeyInfo.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/RepeatedOmKeyInfo.java index 5461786838e5..8817729a1e0c 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/RepeatedOmKeyInfo.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/RepeatedOmKeyInfo.java @@ -41,6 +41,8 @@ public class RepeatedOmKeyInfo implements CopyObject { private static final Codec CODEC_TRUE = newCodec(true); private static final Codec CODEC_FALSE = newCodec(false); + private final List omKeyInfoList; + private static Codec newCodec(boolean ignorePipeline) { return new DelegatedCodec<>( Proto2Codec.get(RepeatedKeyInfo.getDefaultInstance()), @@ -53,8 +55,6 @@ public static Codec getCodec(boolean ignorePipeline) { return ignorePipeline ? CODEC_TRUE : CODEC_FALSE; } - private final List omKeyInfoList; - public RepeatedOmKeyInfo() { this.omKeyInfoList = new ArrayList<>(); } diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/S3SecretValue.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/S3SecretValue.java index 79936039265c..c27498af8f61 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/S3SecretValue.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/S3SecretValue.java @@ -33,16 +33,16 @@ public final class S3SecretValue { S3SecretValue::getProtobuf, S3SecretValue.class); - public static Codec getCodec() { - return CODEC; - } - // TODO: This field should be renamed to accessId for generalization. private final String kerberosID; private final String awsSecret; private final boolean isDeleted; private final long transactionLogIndex; + public static Codec getCodec() { + return CODEC; + } + public static S3SecretValue of(String kerberosID, String awsSecret) { return of(kerberosID, awsSecret, 0); } diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/SnapshotDiffJob.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/SnapshotDiffJob.java index 30db0815aa9f..2024f9a822a4 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/SnapshotDiffJob.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/SnapshotDiffJob.java @@ -36,10 +36,6 @@ public class SnapshotDiffJob { private static final Codec CODEC = new SnapshotDiffJobCodec(); - public static Codec getCodec() { - return CODEC; - } - private long creationTime; private String jobId; private JobStatus status; @@ -95,6 +91,10 @@ public SnapshotDiffJob(long creationTime, this.keysProcessedPct = keysProcessedPct; } + public static Codec getCodec() { + return CODEC; + } + public String getJobId() { return jobId; } diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/SnapshotInfo.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/SnapshotInfo.java index 6dcb64026a97..ab542a141be9 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/SnapshotInfo.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/SnapshotInfo.java @@ -57,44 +57,6 @@ public final class SnapshotInfo implements Auditable, CopyObject { SnapshotInfo::getProtobuf, SnapshotInfo.class); - public static Codec getCodec() { - return CODEC; - } - - /** - * SnapshotStatus enum composed of active and deleted statuses. - */ - public enum SnapshotStatus { - SNAPSHOT_ACTIVE, - SNAPSHOT_DELETED; - - public static final SnapshotStatus DEFAULT = SNAPSHOT_ACTIVE; - - public SnapshotStatusProto toProto() { - switch (this) { - case SNAPSHOT_ACTIVE: - return SnapshotStatusProto.SNAPSHOT_ACTIVE; - case SNAPSHOT_DELETED: - return SnapshotStatusProto.SNAPSHOT_DELETED; - default: - throw new IllegalStateException( - "BUG: missing valid SnapshotStatus, found status=" + this); - } - } - - public static SnapshotStatus valueOf(SnapshotStatusProto status) { - switch (status) { - case SNAPSHOT_ACTIVE: - return SNAPSHOT_ACTIVE; - case SNAPSHOT_DELETED: - return SNAPSHOT_DELETED; - default: - throw new IllegalStateException( - "BUG: missing valid SnapshotStatus, found status=" + status); - } - } - } - private static final String SEPARATOR = "-"; private static final long INVALID_TIMESTAMP = -1; private static final UUID INITIAL_SNAPSHOT_ID = UUID.randomUUID(); @@ -146,6 +108,10 @@ private SnapshotInfo(Builder b) { this.lastTransactionInfo = b.lastTransactionInfo; } + public static Codec getCodec() { + return CODEC; + } + public void setName(String name) { this.name = name; } @@ -745,4 +711,38 @@ public String toString() { ", lastTransactionInfo: '" + lastTransactionInfo + '\'' + '}'; } + + /** + * SnapshotStatus enum composed of active and deleted statuses. + */ + public enum SnapshotStatus { + SNAPSHOT_ACTIVE, + SNAPSHOT_DELETED; + + public static final SnapshotStatus DEFAULT = SNAPSHOT_ACTIVE; + + public SnapshotStatusProto toProto() { + switch (this) { + case SNAPSHOT_ACTIVE: + return SnapshotStatusProto.SNAPSHOT_ACTIVE; + case SNAPSHOT_DELETED: + return SnapshotStatusProto.SNAPSHOT_DELETED; + default: + throw new IllegalStateException( + "BUG: missing valid SnapshotStatus, found status=" + this); + } + } + + public static SnapshotStatus valueOf(SnapshotStatusProto status) { + switch (status) { + case SNAPSHOT_ACTIVE: + return SNAPSHOT_ACTIVE; + case SNAPSHOT_DELETED: + return SNAPSHOT_DELETED; + default: + throw new IllegalStateException( + "BUG: missing valid SnapshotStatus, found status=" + status); + } + } + } } diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/GrpcOmTransport.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/GrpcOmTransport.java index 3eaedb8753ba..c4791b68131b 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/GrpcOmTransport.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/GrpcOmTransport.java @@ -85,15 +85,15 @@ public class GrpcOmTransport implements OmTransport { private final int maxSize; private SecurityConfig secConfig; - public static void setCaCerts(List x509Certificates) { - caCerts = x509Certificates; - } - private RetryPolicy retryPolicy; private int failoverCount = 0; private GrpcOMFailoverProxyProvider omFailoverProxyProvider; + public static void setCaCerts(List x509Certificates) { + caCerts = x509Certificates; + } + public GrpcOmTransport(ConfigurationSource conf, UserGroupInformation ugi, String omServiceId) throws IOException { diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/grpc/GrpcClientConstants.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/grpc/GrpcClientConstants.java index a1da81997cb0..e59ec98ec784 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/grpc/GrpcClientConstants.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/grpc/GrpcClientConstants.java @@ -24,10 +24,6 @@ * Constants to store grpc-client specific header values. */ public final class GrpcClientConstants { - - private GrpcClientConstants() { - } - public static final Context.Key CLIENT_HOSTNAME_CTX_KEY = Context.key("CLIENT_HOSTNAME"); @@ -40,4 +36,6 @@ private GrpcClientConstants() { public static final Metadata.Key CLIENT_IP_ADDRESS_METADATA_KEY = Metadata.Key.of("CLIENT_IP_ADDRESS", Metadata.ASCII_STRING_MARSHALLER); + private GrpcClientConstants() { + } } diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/security/GDPRSymmetricKey.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/security/GDPRSymmetricKey.java index a27782f2ccb0..83146d3aaed1 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/security/GDPRSymmetricKey.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/security/GDPRSymmetricKey.java @@ -34,6 +34,11 @@ public class GDPRSymmetricKey { private static final ThreadLocal RANDOM = ThreadLocal.withInitial(SecureRandom::new); + private final SecretKeySpec secretKey; + private final Cipher cipher; + private final String algorithm; + private final String secret; + /** @return a new instance with default parameters. */ public static GDPRSymmetricKey newDefaultInstance() { try { @@ -50,11 +55,6 @@ static String randomSecret(SecureRandom secureRandom) { 0, 0, true, true, null, secureRandom); } - private final SecretKeySpec secretKey; - private final Cipher cipher; - private final String algorithm; - private final String secret; - public SecretKeySpec getSecretKey() { return secretKey; } diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/security/OzoneDelegationTokenSelector.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/security/OzoneDelegationTokenSelector.java index 70db28261705..9be00204914f 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/security/OzoneDelegationTokenSelector.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/security/OzoneDelegationTokenSelector.java @@ -33,13 +33,12 @@ public class OzoneDelegationTokenSelector extends AbstractDelegationTokenSelector { + private static final Logger LOG = LoggerFactory.getLogger(OzoneDelegationTokenSelector.class); + public OzoneDelegationTokenSelector() { super(OzoneTokenIdentifier.KIND_NAME); } - private static final Logger LOG = LoggerFactory - .getLogger(OzoneDelegationTokenSelector.class); - @Override public Token selectToken(Text service, Collection> tokens) { diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/snapshot/SnapshotDiffReportOzone.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/snapshot/SnapshotDiffReportOzone.java index 735169175798..7922d3efce0b 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/snapshot/SnapshotDiffReportOzone.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/snapshot/SnapshotDiffReportOzone.java @@ -41,6 +41,8 @@ public class SnapshotDiffReportOzone extends org.apache.hadoop.hdfs.protocol.SnapshotDiffReport { + private static final String LINE_SEPARATOR = System.getProperty("line.separator", "\n"); + private static final Codec CODEC = new DelegatedCodec<>( Proto2Codec.get(DiffReportEntryProto.getDefaultInstance()), SnapshotDiffReportOzone::fromProtobufDiffReportEntry, @@ -48,13 +50,6 @@ public class SnapshotDiffReportOzone DiffReportEntry.class, DelegatedCodec.CopyType.SHALLOW); - public static Codec getDiffReportEntryCodec() { - return CODEC; - } - - private static final String LINE_SEPARATOR = System.getProperty( - "line.separator", "\n"); - /** * Volume name to which the snapshot bucket belongs. */ @@ -82,6 +77,10 @@ public SnapshotDiffReportOzone(final String snapshotRoot, this.token = token; } + public static Codec getDiffReportEntryCodec() { + return CODEC; + } + @Override public List getDiffList() { return super.getDiffList(); diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/util/RadixNode.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/util/RadixNode.java index 6d0bea510ba6..67b5ac0bcb25 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/util/RadixNode.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/util/RadixNode.java @@ -25,6 +25,13 @@ */ public class RadixNode { + private HashMap children; + + private String name; + + // TODO: k/v pairs for more metadata as needed + private T value; + public RadixNode(String name) { this.name = name; this.children = new HashMap<>(); @@ -49,11 +56,4 @@ public void setValue(T v) { public T getValue() { return value; } - - private HashMap children; - - private String name; - - // TODO: k/v pairs for more metadata as needed - private T value; } diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/util/RadixTree.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/util/RadixTree.java index 81ecd89ced0a..89aba42511da 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/util/RadixTree.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/util/RadixTree.java @@ -31,6 +31,11 @@ */ public class RadixTree { + private static final String PATH_DELIMITER = OzoneConsts.OZONE_URI_DELIMITER; + + // root of a radix tree has a name of "/" and may optionally has it value. + private RadixNode root; + /** * create a empty radix tree with root only. */ @@ -211,9 +216,4 @@ public String getLongestPrefix(String path) { return root.getName(); } } - - // root of a radix tree has a name of "/" and may optionally has it value. - private RadixNode root; - - private static final String PATH_DELIMITER = OzoneConsts.OZONE_URI_DELIMITER; } diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/web/utils/OzoneUtils.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/web/utils/OzoneUtils.java index 9121489cc358..18a280563d83 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/web/utils/OzoneUtils.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/web/utils/OzoneUtils.java @@ -42,10 +42,6 @@ public final class OzoneUtils { public static final Charset ENCODING = StandardCharsets.UTF_8; - private OzoneUtils() { - // Never constructed - } - /** * Date format that used in ozone. Here the format is thread safe to use. */ @@ -61,6 +57,10 @@ protected SimpleDateFormat initialValue() { } }; + private OzoneUtils() { + // Never constructed + } + /** * Verifies that max key length is a valid value. * From a9515dbe8782fa235af3964d22b71e1ce7baa7f1 Mon Sep 17 00:00:00 2001 From: Ivan Zlenko <241953+ivanzlenko@users.noreply.github.com> Date: Mon, 28 Apr 2025 12:08:38 +0500 Subject: [PATCH 13/26] HDDS-12907. Enable FieldDeclarationsShouldBeAtStartOfClass PMD rule (#8344) --- dev-support/pmd/pmd-ruleset.xml | 7 + .../hadoop/hdds/utils/NativeConstants.java | 6 +- .../compaction/log/CompactionLogEntry.java | 8 +- .../apache/ozone/graph/PrintableGraph.java | 40 ++-- .../rocksdiff/RocksDBCheckpointDiffer.java | 58 +++--- .../hadoop/ozone/shell/ListOptions.java | 26 +-- .../shell/bucket/CreateBucketHandler.java | 44 ++--- .../ozone/client/OzoneClientFactory.java | 5 +- .../ReplicatedBlockChecksumComputer.java | 4 +- .../ozone/client/io/ECKeyOutputStream.java | 16 +- .../ozone/client/io/KeyDataStreamOutput.java | 17 +- .../ozone/client/io/KeyOutputStream.java | 18 +- .../apache/hadoop/ozone/om/OMConfigKeys.java | 12 +- .../ozone/security/acl/IAccessAuthorizer.java | 10 +- .../ozone/snapshot/SnapshotDiffResponse.java | 78 ++++---- .../ozone/fs/http/server/HttpFSServer.java | 16 +- .../apache/ozone/fs/http/server/JsonUtil.java | 7 +- .../org/apache/ozone/lib/lang/XException.java | 30 ++- .../org/apache/ozone/lib/server/Server.java | 75 ++++---- .../hadoop/FileSystemAccessService.java | 32 ++-- .../hadoop/ozone/om/helpers/OmPrefixInfo.java | 8 +- .../ozone/om/DeletingServiceMetrics.java | 65 +++---- .../hadoop/ozone/om/OmSnapshotMetrics.java | 68 +++---- .../org/apache/hadoop/fs/ozone/Statistic.java | 6 +- .../schema/ContainerSchemaDefinition.java | 28 +-- .../ozone/recon/schema/ReconSqlDbConfig.java | 176 +++++++++--------- .../apache/ozone/recon/schema/SqlDbUtils.java | 30 +-- .../hadoop/ozone/recon/ReconConstants.java | 8 +- .../apache/hadoop/ozone/recon/ReconUtils.java | 6 +- .../api/types/ContainerKeyPrefixImpl.java | 9 +- .../api/types/KeyEntityInfoProtoWrapper.java | 16 +- .../ozone/recon/codec/NSSummaryCodec.java | 8 +- .../recon/metrics/ContainerHealthMetrics.java | 28 +-- .../metrics/OzoneManagerSyncMetrics.java | 30 +-- .../scm/ContainerReplicaHistoryList.java | 8 +- .../ozone/recon/scm/ReconPolicyProvider.java | 14 +- .../spi/impl/KeyPrefixContainerCodec.java | 4 +- .../recon/spi/impl/ReconDBDefinition.java | 10 +- .../ozone/recon/tasks/ReconTaskConfig.java | 48 ++--- .../ozone/s3/endpoint/ObjectEndpoint.java | 6 +- .../hadoop/ozone/s3/endpoint/S3Acl.java | 24 +-- .../ozone/s3/exception/S3ErrorTable.java | 14 +- .../hadoop/ozone/s3/util/RFC1123Util.java | 7 +- .../apache/hadoop/ozone/s3/util/S3Consts.java | 10 +- .../admin/nssummary/NSSummaryCLIUtils.java | 8 +- .../GetFailedDeletedBlocksTxnSubcommand.java | 24 +-- .../ozone/containerlog/parser/DBConsts.java | 7 +- .../ozone/debug/DBDefinitionFactory.java | 8 +- .../audit/parser/common/DatabaseHelper.java | 7 +- .../audit/parser/common/ParserConsts.java | 8 +- .../hadoop/ozone/debug/om/PrefixParser.java | 24 +-- .../ozone/debug/replicas/ReplicasVerify.java | 18 +- .../ozone/freon/OmMetadataGenerator.java | 40 ++-- .../freon/OzoneClientKeyReadWriteListOps.java | 18 +- .../ozone/freon/RandomKeyGenerator.java | 14 +- .../ozone/freon/SCMThroughputBenchmark.java | 18 +- 56 files changed, 650 insertions(+), 684 deletions(-) diff --git a/dev-support/pmd/pmd-ruleset.xml b/dev-support/pmd/pmd-ruleset.xml index e3af967ff3f1..83a44946ba97 100644 --- a/dev-support/pmd/pmd-ruleset.xml +++ b/dev-support/pmd/pmd-ruleset.xml @@ -42,5 +42,12 @@ + + + + + + + .*/generated-sources/.* diff --git a/hadoop-hdds/rocks-native/src/main/java/org/apache/hadoop/hdds/utils/NativeConstants.java b/hadoop-hdds/rocks-native/src/main/java/org/apache/hadoop/hdds/utils/NativeConstants.java index 379ea32b8537..61fbcf03568a 100644 --- a/hadoop-hdds/rocks-native/src/main/java/org/apache/hadoop/hdds/utils/NativeConstants.java +++ b/hadoop-hdds/rocks-native/src/main/java/org/apache/hadoop/hdds/utils/NativeConstants.java @@ -22,10 +22,10 @@ */ public final class NativeConstants { + public static final String ROCKS_TOOLS_NATIVE_LIBRARY_NAME = "ozone_rocksdb_tools"; + public static final String ROCKS_TOOLS_NATIVE_PROPERTY = "rocks_tools_native"; + private NativeConstants() { } - - public static final String ROCKS_TOOLS_NATIVE_LIBRARY_NAME = "ozone_rocksdb_tools"; - public static final String ROCKS_TOOLS_NATIVE_PROPERTY = "rocks_tools_native"; } diff --git a/hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/compaction/log/CompactionLogEntry.java b/hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/compaction/log/CompactionLogEntry.java index 336045e10baa..8ee48e43f903 100644 --- a/hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/compaction/log/CompactionLogEntry.java +++ b/hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/compaction/log/CompactionLogEntry.java @@ -39,10 +39,6 @@ public final class CompactionLogEntry implements CompactionLogEntry::getProtobuf, CompactionLogEntry.class); - public static Codec getCodec() { - return CODEC; - } - private final long dbSequenceNumber; private final long compactionTime; private final List inputFileInfoList; @@ -62,6 +58,10 @@ public CompactionLogEntry(long dbSequenceNumber, this.compactionReason = compactionReason; } + public static Codec getCodec() { + return CODEC; + } + public List getInputFileInfoList() { return inputFileInfoList; } diff --git a/hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/graph/PrintableGraph.java b/hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/graph/PrintableGraph.java index cb76da6d144a..e51f9b312e5f 100644 --- a/hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/graph/PrintableGraph.java +++ b/hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/graph/PrintableGraph.java @@ -38,26 +38,6 @@ */ public class PrintableGraph { - /** - * Enum to print different type of node's name in the graph image. - */ - public enum GraphType { - /** - * To use SST file name as node name. - */ - FILE_NAME, - - /** - * To use SST file name and total key in the file as node name. - */ - KEY_SIZE, - - /** - * To use SST file name and cumulative key as node name. - */ - CUMULATIVE_SIZE - } - private final Graph graph; public PrintableGraph(MutableGraph guavaGraph, @@ -119,4 +99,24 @@ private String getVertex(CompactionNode node, GraphType graphType) { return node.getFileName(); } } + + /** + * Enum to print different type of node's name in the graph image. + */ + public enum GraphType { + /** + * To use SST file name as node name. + */ + FILE_NAME, + + /** + * To use SST file name and total key in the file as node name. + */ + KEY_SIZE, + + /** + * To use SST file name and cumulative key as node name. + */ + CUMULATIVE_SIZE + } } diff --git a/hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/rocksdiff/RocksDBCheckpointDiffer.java b/hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/rocksdiff/RocksDBCheckpointDiffer.java index 0444e4244c36..c9f8c726d284 100644 --- a/hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/rocksdiff/RocksDBCheckpointDiffer.java +++ b/hadoop-hdds/rocksdb-checkpoint-differ/src/main/java/org/apache/ozone/rocksdiff/RocksDBCheckpointDiffer.java @@ -179,6 +179,35 @@ public class RocksDBCheckpointDiffer implements AutoCloseable, public static final Set COLUMN_FAMILIES_TO_TRACK_IN_DAG = ImmutableSet.of("keyTable", "directoryTable", "fileTable"); + // Hash table to track CompactionNode for a given SST File. + private final ConcurrentHashMap compactionNodeMap = + new ConcurrentHashMap<>(); + + // We are maintaining a two way DAG. This allows easy traversal from + // source snapshot to destination snapshot as well as the other direction. + + private final MutableGraph forwardCompactionDAG = + GraphBuilder.directed().build(); + + private final MutableGraph backwardCompactionDAG = + GraphBuilder.directed().build(); + + public static final Integer DEBUG_DAG_BUILD_UP = 2; + public static final Integer DEBUG_DAG_TRAVERSAL = 3; + public static final Integer DEBUG_DAG_LIVE_NODES = 4; + public static final Integer DEBUG_READ_ALL_DB_KEYS = 5; + private static final HashSet DEBUG_LEVEL = new HashSet<>(); + + static { + addDebugLevel(DEBUG_DAG_BUILD_UP); + addDebugLevel(DEBUG_DAG_TRAVERSAL); + addDebugLevel(DEBUG_DAG_LIVE_NODES); + } + + static { + RocksDB.loadLibrary(); + } + /** * This is a package private constructor and should not be used other than * testing. Caller should use RocksDBCheckpointDifferHolder#getInstance() to @@ -309,35 +338,6 @@ public void close() { } } - // Hash table to track CompactionNode for a given SST File. - private final ConcurrentHashMap compactionNodeMap = - new ConcurrentHashMap<>(); - - // We are maintaining a two way DAG. This allows easy traversal from - // source snapshot to destination snapshot as well as the other direction. - - private final MutableGraph forwardCompactionDAG = - GraphBuilder.directed().build(); - - private final MutableGraph backwardCompactionDAG = - GraphBuilder.directed().build(); - - public static final Integer DEBUG_DAG_BUILD_UP = 2; - public static final Integer DEBUG_DAG_TRAVERSAL = 3; - public static final Integer DEBUG_DAG_LIVE_NODES = 4; - public static final Integer DEBUG_READ_ALL_DB_KEYS = 5; - private static final HashSet DEBUG_LEVEL = new HashSet<>(); - - static { - addDebugLevel(DEBUG_DAG_BUILD_UP); - addDebugLevel(DEBUG_DAG_TRAVERSAL); - addDebugLevel(DEBUG_DAG_LIVE_NODES); - } - - static { - RocksDB.loadLibrary(); - } - public static void addDebugLevel(Integer level) { DEBUG_LEVEL.add(level); } diff --git a/hadoop-ozone/cli-shell/src/main/java/org/apache/hadoop/ozone/shell/ListOptions.java b/hadoop-ozone/cli-shell/src/main/java/org/apache/hadoop/ozone/shell/ListOptions.java index e5ba46dd9340..3b0d7f117f8f 100644 --- a/hadoop-ozone/cli-shell/src/main/java/org/apache/hadoop/ozone/shell/ListOptions.java +++ b/hadoop-ozone/cli-shell/src/main/java/org/apache/hadoop/ozone/shell/ListOptions.java @@ -26,19 +26,6 @@ public class ListOptions { @CommandLine.ArgGroup(exclusive = true) private ExclusiveLimit exclusiveLimit = new ExclusiveLimit(); - - static class ExclusiveLimit { - @CommandLine.Option(names = {"--length", "-l"}, - description = "Maximum number of items to list", - defaultValue = "100", - showDefaultValue = CommandLine.Help.Visibility.ALWAYS) - private int limit; - - @CommandLine.Option(names = {"--all", "-a"}, - description = "List all results", - defaultValue = "false") - private boolean all; - } @CommandLine.Option(names = {"--start", "-s"}, description = "The item to start the listing from.\n" + @@ -72,4 +59,17 @@ public String getStartItem() { public String getPrefix() { return prefix; } + + static class ExclusiveLimit { + @CommandLine.Option(names = {"--length", "-l"}, + description = "Maximum number of items to list", + defaultValue = "100", + showDefaultValue = CommandLine.Help.Visibility.ALWAYS) + private int limit; + + @CommandLine.Option(names = {"--all", "-a"}, + description = "List all results", + defaultValue = "false") + private boolean all; + } } diff --git a/hadoop-ozone/cli-shell/src/main/java/org/apache/hadoop/ozone/shell/bucket/CreateBucketHandler.java b/hadoop-ozone/cli-shell/src/main/java/org/apache/hadoop/ozone/shell/bucket/CreateBucketHandler.java index a8bf348eed9c..e74fb0b1b431 100644 --- a/hadoop-ozone/cli-shell/src/main/java/org/apache/hadoop/ozone/shell/bucket/CreateBucketHandler.java +++ b/hadoop-ozone/cli-shell/src/main/java/org/apache/hadoop/ozone/shell/bucket/CreateBucketHandler.java @@ -57,28 +57,6 @@ public class CreateBucketHandler extends BucketHandler { " user if not specified") private String ownerName; - private static class LayoutConverter implements CommandLine.ITypeConverter { - @Override - public BucketLayout convert(String value) { - if (value == null) { - return null; - } - switch (value) { - case "fso": - return BucketLayout.FILE_SYSTEM_OPTIMIZED; - case "obs": - return BucketLayout.OBJECT_STORE; - default: - for (BucketLayout candidate : BucketLayout.values()) { - if (candidate.name().equalsIgnoreCase(value)) { - return candidate; - } - } - throw new IllegalArgumentException("Unknown bucket layout: " + value); - } - } - } - @Option(names = { "--layout", "-l" }, converter = LayoutConverter.class, description = "Allowed Bucket Layouts: fso (for file system optimized buckets FILE_SYSTEM_OPTIMIZED), " + "obs (for object store optimized OBJECT_STORE) and legacy (LEGACY is Deprecated)") @@ -149,4 +127,26 @@ public void execute(OzoneClient client, OzoneAddress address) printObjectAsJson(bucket); } } + + private static class LayoutConverter implements CommandLine.ITypeConverter { + @Override + public BucketLayout convert(String value) { + if (value == null) { + return null; + } + switch (value) { + case "fso": + return BucketLayout.FILE_SYSTEM_OPTIMIZED; + case "obs": + return BucketLayout.OBJECT_STORE; + default: + for (BucketLayout candidate : BucketLayout.values()) { + if (candidate.name().equalsIgnoreCase(value)) { + return candidate; + } + } + throw new IllegalArgumentException("Unknown bucket layout: " + value); + } + } + } } diff --git a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneClientFactory.java b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneClientFactory.java index 705ac1745c39..87a3443aa77d 100644 --- a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneClientFactory.java +++ b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneClientFactory.java @@ -50,14 +50,13 @@ public final class OzoneClientFactory { private static final Logger LOG = LoggerFactory.getLogger( OzoneClientFactory.class); + private static final LeakDetector OZONE_CLIENT_LEAK_DETECTOR = new LeakDetector("OzoneClientObject"); + /** * Private constructor, class is not meant to be initialized. */ private OzoneClientFactory() { } - private static final LeakDetector OZONE_CLIENT_LEAK_DETECTOR = - new LeakDetector("OzoneClientObject"); - public static UncheckedAutoCloseable track(AutoCloseable object) { final Class clazz = object.getClass(); final StackTraceElement[] stackTrace = HddsUtils.getStackTrace(LOG); diff --git a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/checksum/ReplicatedBlockChecksumComputer.java b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/checksum/ReplicatedBlockChecksumComputer.java index f413e27fc931..12eee917a789 100644 --- a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/checksum/ReplicatedBlockChecksumComputer.java +++ b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/checksum/ReplicatedBlockChecksumComputer.java @@ -39,14 +39,14 @@ public class ReplicatedBlockChecksumComputer extends private static final Logger LOG = LoggerFactory.getLogger(ReplicatedBlockChecksumComputer.class); + private final List chunkInfoList; + static MD5Hash digest(ByteBuffer data) { final MessageDigest digester = MD5Hash.getDigester(); digester.update(data); return new MD5Hash(digester.digest()); } - private final List chunkInfoList; - public ReplicatedBlockChecksumComputer( List chunkInfoList) { this.chunkInfoList = chunkInfoList; diff --git a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECKeyOutputStream.java b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECKeyOutputStream.java index d712c2f4c0f7..193b4d078f5c 100644 --- a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECKeyOutputStream.java +++ b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECKeyOutputStream.java @@ -55,6 +55,9 @@ */ public final class ECKeyOutputStream extends KeyOutputStream implements KeyMetadataAware { + + private static final Logger LOG = LoggerFactory.getLogger(KeyOutputStream.class); + private OzoneClientConfig config; private ECChunkBuffers ecChunkBufferCache; private final BlockingQueue ecStripeQueue; @@ -75,14 +78,6 @@ public final class ECKeyOutputStream extends KeyOutputStream */ private boolean atomicKeyCreation; - private enum StripeWriteStatus { - SUCCESS, - FAILED - } - - private static final Logger LOG = - LoggerFactory.getLogger(KeyOutputStream.class); - private volatile boolean closed; private volatile boolean closing; // how much of data is actually written yet to underlying stream @@ -730,4 +725,9 @@ private void releaseBuffers(ByteBuffer[] buffers) { } } } + + private enum StripeWriteStatus { + SUCCESS, + FAILED + } } diff --git a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/KeyDataStreamOutput.java b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/KeyDataStreamOutput.java index 7e4b59ec7db1..dedc36af919c 100644 --- a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/KeyDataStreamOutput.java +++ b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/KeyDataStreamOutput.java @@ -58,18 +58,10 @@ public class KeyDataStreamOutput extends AbstractDataStreamOutput implements KeyMetadataAware { - private OzoneClientConfig config; - - /** - * Defines stream action while calling handleFlushOrClose. - */ - enum StreamAction { - FLUSH, HSYNC, CLOSE, FULL - } - private static final Logger LOG = LoggerFactory.getLogger(KeyDataStreamOutput.class); + private OzoneClientConfig config; private boolean closed; // how much of data is actually written yet to underlying stream @@ -560,4 +552,11 @@ private void checkNotClosed() throws IOException { + blockDataStreamOutputEntryPool.getKeyName()); } } + + /** + * Defines stream action while calling handleFlushOrClose. + */ + enum StreamAction { + FLUSH, HSYNC, CLOSE, FULL + } } diff --git a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/KeyOutputStream.java b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/KeyOutputStream.java index 9103f30b96e0..c9e5a312ca90 100644 --- a/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/KeyOutputStream.java +++ b/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/KeyOutputStream.java @@ -75,18 +75,11 @@ public class KeyOutputStream extends OutputStream implements Syncable, KeyMetadataAware { - private final ReplicationConfig replication; - - /** - * Defines stream action while calling handleFlushOrClose. - */ - enum StreamAction { - FLUSH, HSYNC, CLOSE, FULL - } - private static final Logger LOG = LoggerFactory.getLogger(KeyOutputStream.class); + private final ReplicationConfig replication; + private boolean closed; private final Map, RetryPolicy> retryPolicyMap; private int retryCount; @@ -850,4 +843,11 @@ private void checkNotClosed() throws IOException { + blockOutputStreamEntryPool.getKeyName()); } } + + /** + * Defines stream action while calling handleFlushOrClose. + */ + enum StreamAction { + FLUSH, HSYNC, CLOSE, FULL + } } diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/OMConfigKeys.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/OMConfigKeys.java index 200c63028b75..89b6e2a10312 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/OMConfigKeys.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/OMConfigKeys.java @@ -31,12 +31,6 @@ public final class OMConfigKeys { "ozone.om.snapshot.load.native.lib"; public static final boolean OZONE_OM_SNAPSHOT_LOAD_NATIVE_LIB_DEFAULT = true; - /** - * Never constructed. - */ - private OMConfigKeys() { - } - public static final String OZONE_FILESYSTEM_SNAPSHOT_ENABLED_KEY = "ozone.filesystem.snapshot.enabled"; public static final boolean OZONE_FILESYSTEM_SNAPSHOT_ENABLED_DEFAULT = true; @@ -646,4 +640,10 @@ private OMConfigKeys() { = "ozone.om.compaction.service.columnfamilies"; public static final String OZONE_OM_COMPACTION_SERVICE_COLUMNFAMILIES_DEFAULT = "keyTable,fileTable,directoryTable,deletedTable,deletedDirectoryTable,multipartInfoTable"; + + /** + * Never constructed. + */ + private OMConfigKeys() { + } } diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/security/acl/IAccessAuthorizer.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/security/acl/IAccessAuthorizer.java index d4a1c3d87ff7..128939a87146 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/security/acl/IAccessAuthorizer.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/security/acl/IAccessAuthorizer.java @@ -174,11 +174,6 @@ enum ACLIdentityType { // TODO: Add support for acl checks based on CLIENT_IP. - @Override - public String toString() { - return value; - } - /** * String value for this Enum. */ @@ -192,6 +187,11 @@ public String toString() { ACLIdentityType(String val) { value = val; } + + @Override + public String toString() { + return value; + } } } diff --git a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/snapshot/SnapshotDiffResponse.java b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/snapshot/SnapshotDiffResponse.java index 47b586b8dd05..ad1dc50c3d5f 100644 --- a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/snapshot/SnapshotDiffResponse.java +++ b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/snapshot/SnapshotDiffResponse.java @@ -26,45 +26,6 @@ */ public class SnapshotDiffResponse { - /** - * Snapshot diff job status enum. - */ - public enum JobStatus { - QUEUED, - IN_PROGRESS, - DONE, - REJECTED, - FAILED, - CANCELLED; - - public JobStatusProto toProtobuf() { - return JobStatusProto.valueOf(this.name()); - } - - public static JobStatus fromProtobuf(JobStatusProto jobStatusProto) { - return JobStatus.valueOf(jobStatusProto.name()); - } - } - - /** - * Snapshot diff job sub-status enum. - */ - public enum SubStatus { - SST_FILE_DELTA_DAG_WALK, - SST_FILE_DELTA_FULL_DIFF, - OBJECT_ID_MAP_GEN_OBS, - OBJECT_ID_MAP_GEN_FSO, - DIFF_REPORT_GEN; - - public static SubStatus fromProtoBuf(OzoneManagerProtocolProtos.SnapshotDiffResponse.SubStatus subStatusProto) { - return SubStatus.valueOf(subStatusProto.name()); - } - - public OzoneManagerProtocolProtos.SnapshotDiffResponse.SubStatus toProtoBuf() { - return OzoneManagerProtocolProtos.SnapshotDiffResponse.SubStatus.valueOf(this.name()); - } - } - private final SnapshotDiffReportOzone snapshotDiffReport; private final JobStatus jobStatus; private final long waitTimeInMs; @@ -154,4 +115,43 @@ public String toString() { } return str.toString(); } + + /** + * Snapshot diff job status enum. + */ + public enum JobStatus { + QUEUED, + IN_PROGRESS, + DONE, + REJECTED, + FAILED, + CANCELLED; + + public JobStatusProto toProtobuf() { + return JobStatusProto.valueOf(this.name()); + } + + public static JobStatus fromProtobuf(JobStatusProto jobStatusProto) { + return JobStatus.valueOf(jobStatusProto.name()); + } + } + + /** + * Snapshot diff job sub-status enum. + */ + public enum SubStatus { + SST_FILE_DELTA_DAG_WALK, + SST_FILE_DELTA_FULL_DIFF, + OBJECT_ID_MAP_GEN_OBS, + OBJECT_ID_MAP_GEN_FSO, + DIFF_REPORT_GEN; + + public static SubStatus fromProtoBuf(OzoneManagerProtocolProtos.SnapshotDiffResponse.SubStatus subStatusProto) { + return SubStatus.valueOf(subStatusProto.name()); + } + + public OzoneManagerProtocolProtos.SnapshotDiffResponse.SubStatus toProtoBuf() { + return OzoneManagerProtocolProtos.SnapshotDiffResponse.SubStatus.valueOf(this.name()); + } + } } diff --git a/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/fs/http/server/HttpFSServer.java b/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/fs/http/server/HttpFSServer.java index 4623dee4832a..262b9fa69455 100644 --- a/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/fs/http/server/HttpFSServer.java +++ b/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/fs/http/server/HttpFSServer.java @@ -98,10 +98,6 @@ @InterfaceAudience.Private public class HttpFSServer { - enum AccessMode { - READWRITE, WRITEONLY, READONLY; - } - private static final Logger AUDIT_LOG = LoggerFactory.getLogger("httpfsaudit"); private static final Logger LOG = LoggerFactory.getLogger(HttpFSServer.class); @@ -109,10 +105,6 @@ enum AccessMode { private static final HttpFSParametersProvider PARAMETERS_PROVIDER = new HttpFSParametersProvider(); - private Parameters getParams(HttpServletRequest request) { - return PARAMETERS_PROVIDER.get(request); - } - private AccessMode accessMode = AccessMode.READWRITE; public HttpFSServer() { @@ -129,6 +121,10 @@ public HttpFSServer() { } } + private Parameters getParams(HttpServletRequest request) { + return PARAMETERS_PROVIDER.get(request); + } + /** * Executes a {@link FileSystemAccess.FileSystemExecutor} using a filesystem * for the effective user. @@ -1245,4 +1241,8 @@ private Response handleCreate(InputStream is, } return response; } + + enum AccessMode { + READWRITE, WRITEONLY, READONLY; + } } diff --git a/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/fs/http/server/JsonUtil.java b/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/fs/http/server/JsonUtil.java index 829ac339c30a..9a6d57b0c6d1 100644 --- a/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/fs/http/server/JsonUtil.java +++ b/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/fs/http/server/JsonUtil.java @@ -28,16 +28,15 @@ /** JSON Utilities. */ final class JsonUtil { - - private JsonUtil() { - } - // Reuse ObjectMapper instance for improving performance. // ObjectMapper is thread safe as long as we always configure instance // before use. We don't have a re-entrant call pattern in WebHDFS, // so we just need to worry about thread-safety. private static final ObjectMapper MAPPER = new ObjectMapper(); + private JsonUtil() { + } + private static String toJsonString(final Class clazz, final Object value) { return toJsonString(clazz.getSimpleName(), value); } diff --git a/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/lib/lang/XException.java b/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/lib/lang/XException.java index d9e014798799..ff35fbcc4f8a 100644 --- a/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/lib/lang/XException.java +++ b/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/lib/lang/XException.java @@ -27,23 +27,6 @@ */ @InterfaceAudience.Private public class XException extends Exception { - - /** - * Interface to define error codes. - */ - public interface ERROR { - - /** - * Returns the template for the error. - * - * @return the template for the error, the template must be in JDK - * MessageFormat syntax (using {#} positional - * parameters). - */ - String getTemplate(); - - } - private ERROR error; /** @@ -124,4 +107,17 @@ private static Throwable getCause(Object... params) { return throwable; } + /** + * Interface to define error codes. + */ + public interface ERROR { + /** + * Returns the template for the error. + * + * @return the template for the error, the template must be in JDK + * MessageFormat syntax (using {#} positional + * parameters). + */ + String getTemplate(); + } } diff --git a/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/lib/server/Server.java b/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/lib/server/Server.java index 82534ac73855..1a74e55ffd32 100644 --- a/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/lib/server/Server.java +++ b/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/lib/server/Server.java @@ -95,44 +95,6 @@ public class Server { */ public static final String CONF_STARTUP_STATUS = "startup.status"; - /** - * Enumeration that defines the server status. - */ - @InterfaceAudience.Private - public enum Status { - UNDEF(false, false), - BOOTING(false, true), - HALTED(true, true), - ADMIN(true, true), - NORMAL(true, true), - SHUTTING_DOWN(false, true), - SHUTDOWN(false, false); - - private boolean settable; - private boolean operational; - - /** - * Status constructor. - * - * @param settable indicates if the status is settable. - * @param operational indicates if the server is operational - * when in this status. - */ - Status(boolean settable, boolean operational) { - this.settable = settable; - this.operational = operational; - } - - /** - * Returns if this server status is operational. - * - * @return if this server status is operational. - */ - public boolean isOperational() { - return operational; - } - } - /** * Name of the log4j configuration file the Server will load from the * classpath if the #SERVER#-log4j.properties is not defined @@ -836,4 +798,41 @@ public void setService(Class klass) } } + /** + * Enumeration that defines the server status. + */ + @InterfaceAudience.Private + public enum Status { + UNDEF(false, false), + BOOTING(false, true), + HALTED(true, true), + ADMIN(true, true), + NORMAL(true, true), + SHUTTING_DOWN(false, true), + SHUTDOWN(false, false); + + private boolean settable; + private boolean operational; + + /** + * Status constructor. + * + * @param settable indicates if the status is settable. + * @param operational indicates if the server is operational + * when in this status. + */ + Status(boolean settable, boolean operational) { + this.settable = settable; + this.operational = operational; + } + + /** + * Returns if this server status is operational. + * + * @return if this server status is operational. + */ + public boolean isOperational() { + return operational; + } + } } diff --git a/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/lib/service/hadoop/FileSystemAccessService.java b/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/lib/service/hadoop/FileSystemAccessService.java index c4dfc28df47a..8ae106ad2184 100644 --- a/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/lib/service/hadoop/FileSystemAccessService.java +++ b/hadoop-ozone/httpfsgateway/src/main/java/org/apache/ozone/lib/service/hadoop/FileSystemAccessService.java @@ -83,6 +83,21 @@ public class FileSystemAccessService extends BaseService public static final String FILE_SYSTEM_SERVICE_CREATED = "FileSystemAccessService.created"; + private static final String HTTPFS_FS_USER = "httpfs.fs.user"; + + private Collection nameNodeWhitelist; + + private Configuration serviceHadoopConf; + + private Configuration fileSystemConf; + + private AtomicInteger unmanagedFileSystems = new AtomicInteger(); + + private ConcurrentHashMap fsCache = + new ConcurrentHashMap(); + + private long purgeTimeout; + private static class CachedFileSystem { private FileSystem fs; private long lastUse; @@ -141,21 +156,6 @@ public FileSystemAccessService() { super(PREFIX); } - private Collection nameNodeWhitelist; - - // Suppressed because serviceHadoopConf only used in this class and in the - // tests, which will be removed later. - @SuppressWarnings("checkstyle:VisibilityModifier") - Configuration serviceHadoopConf; - private Configuration fileSystemConf; - - private AtomicInteger unmanagedFileSystems = new AtomicInteger(); - - private ConcurrentHashMap fsCache = - new ConcurrentHashMap(); - - private long purgeTimeout; - @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", @@ -325,8 +325,6 @@ protected void setRequiredServiceHadoopConf(Configuration conf) { conf.set("fs.hdfs.impl.disable.cache", "true"); } - private static final String HTTPFS_FS_USER = "httpfs.fs.user"; - protected FileSystem createFileSystem(Configuration namenodeConf) throws IOException { String user = UserGroupInformation.getCurrentUser().getShortUserName(); diff --git a/hadoop-ozone/interface-storage/src/main/java/org/apache/hadoop/ozone/om/helpers/OmPrefixInfo.java b/hadoop-ozone/interface-storage/src/main/java/org/apache/hadoop/ozone/om/helpers/OmPrefixInfo.java index 6760cbd05f81..1644100f8fb5 100644 --- a/hadoop-ozone/interface-storage/src/main/java/org/apache/hadoop/ozone/om/helpers/OmPrefixInfo.java +++ b/hadoop-ozone/interface-storage/src/main/java/org/apache/hadoop/ozone/om/helpers/OmPrefixInfo.java @@ -43,10 +43,6 @@ public final class OmPrefixInfo extends WithObjectID implements CopyObject getCodec() { - return CODEC; - } - private final String name; private final CopyOnWriteArrayList acls; @@ -56,6 +52,10 @@ private OmPrefixInfo(Builder b) { acls = new CopyOnWriteArrayList<>(b.acls); } + public static Codec getCodec() { + return CODEC; + } + /** * Returns the ACL's associated with this prefix. * @return {@literal List} diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/DeletingServiceMetrics.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/DeletingServiceMetrics.java index eed4e7f0beb8..3e6a4b937f47 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/DeletingServiceMetrics.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/DeletingServiceMetrics.java @@ -35,6 +35,37 @@ public final class DeletingServiceMetrics { DeletingServiceMetrics.class.getSimpleName(); private MetricsRegistry registry; + /* + * Total directory deletion metrics across all iterations of DirectoryDeletingService since last restart. + */ + @Metric("Total no. of deleted directories sent for purge") + private MutableGaugeLong numDirsSentForPurge; + @Metric("Total no. of sub-directories sent for purge") + private MutableGaugeLong numSubDirsSentForPurge; + @Metric("Total no. of sub-files sent for purge") + private MutableGaugeLong numSubFilesSentForPurge; + /* + * Total key deletion metrics across all iterations of KeyDeletingService since last restart. + */ + @Metric("Total no. of keys processed") + private MutableGaugeLong numKeysProcessed; + @Metric("Total no. of deleted keys sent for purge") + private MutableGaugeLong numKeysSentForPurge; + /* + * Directory purge request metrics. + */ + @Metric("Total no. of directories purged") + private MutableGaugeLong numDirsPurged; + @Metric("Total no. of subFiles moved to deletedTable") + private MutableGaugeLong numSubFilesMovedToDeletedTable; + @Metric("Total no. of subDirectories moved to deletedDirTable") + private MutableGaugeLong numSubDirsMovedToDeletedDirTable; + /* + * Key purge request metrics. + */ + @Metric("Total no. of keys purged") + private MutableGaugeLong numKeysPurged; + private DeletingServiceMetrics() { this.registry = new MetricsRegistry(METRICS_SOURCE_NAME); } @@ -57,16 +88,6 @@ public static void unregister() { DefaultMetricsSystem.instance().unregisterSource(METRICS_SOURCE_NAME); } - /* - * Total directory deletion metrics across all iterations of DirectoryDeletingService since last restart. - */ - @Metric("Total no. of deleted directories sent for purge") - private MutableGaugeLong numDirsSentForPurge; - @Metric("Total no. of sub-directories sent for purge") - private MutableGaugeLong numSubDirsSentForPurge; - @Metric("Total no. of sub-files sent for purge") - private MutableGaugeLong numSubFilesSentForPurge; - public void incrNumDirsSentForPurge(long dirDel) { numDirsSentForPurge.incr(dirDel); } @@ -97,14 +118,6 @@ public long getNumSubFilesSentForPurge() { return numSubFilesSentForPurge.value(); } - /* - * Total key deletion metrics across all iterations of KeyDeletingService since last restart. - */ - @Metric("Total no. of keys processed") - private MutableGaugeLong numKeysProcessed; - @Metric("Total no. of deleted keys sent for purge") - private MutableGaugeLong numKeysSentForPurge; - public void incrNumKeysProcessed(long keysProcessed) { this.numKeysProcessed.incr(keysProcessed); } @@ -113,16 +126,6 @@ public void incrNumKeysSentForPurge(long keysPurge) { this.numKeysSentForPurge.incr(keysPurge); } - /* - * Directory purge request metrics. - */ - @Metric("Total no. of directories purged") - private MutableGaugeLong numDirsPurged; - @Metric("Total no. of subFiles moved to deletedTable") - private MutableGaugeLong numSubFilesMovedToDeletedTable; - @Metric("Total no. of subDirectories moved to deletedDirTable") - private MutableGaugeLong numSubDirsMovedToDeletedDirTable; - public void incrNumDirPurged(long dirPurged) { this.numDirsPurged.incr(dirPurged); } @@ -147,12 +150,6 @@ public long getNumSubDirsMovedToDeletedDirTable() { return numSubDirsMovedToDeletedDirTable.value(); } - /* - * Key purge request metrics. - */ - @Metric("Total no. of keys purged") - private MutableGaugeLong numKeysPurged; - public void incrNumKeysPurged(long keysPurged) { this.numKeysPurged.incr(keysPurged); } diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotMetrics.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotMetrics.java index 3fe8c154cd3d..65cb1d567323 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotMetrics.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmSnapshotMetrics.java @@ -35,9 +35,6 @@ public final class OmSnapshotMetrics implements OmMetadataReaderMetrics { private static final String SOURCE_NAME = OmSnapshotMetrics.class.getSimpleName(); - private OmSnapshotMetrics() { - } - private static final Supplier SUPPLIER = MemoizedSupplier.valueOf(() -> { MetricsSystem ms = DefaultMetricsSystem.instance(); @@ -46,15 +43,31 @@ private OmSnapshotMetrics() { new OmSnapshotMetrics()); }); + private @Metric MutableCounterLong numKeyLookup; + private @Metric MutableCounterLong numKeyLookupFails; + private @Metric MutableCounterLong numGetKeyInfo; + private @Metric MutableCounterLong numGetKeyInfoFails; + private @Metric MutableCounterLong numListStatus; + private @Metric MutableCounterLong numListStatusFails; + private @Metric MutableCounterLong numGetFileStatus; + private @Metric MutableCounterLong numGetFileStatusFails; + private @Metric MutableCounterLong numLookupFile; + private @Metric MutableCounterLong numLookupFileFails; + private @Metric MutableCounterLong numKeyLists; + private @Metric MutableCounterLong numKeyListFails; + private @Metric MutableCounterLong numGetAcl; + private @Metric MutableCounterLong numKeyOps; + private @Metric MutableCounterLong numFSOps; + private @Metric MutableCounterLong numGetObjectTagging; + private @Metric MutableCounterLong numGetObjectTaggingFails; + + private OmSnapshotMetrics() { + } + public static OmSnapshotMetrics getInstance() { return SUPPLIER.get(); } - private @Metric - MutableCounterLong numKeyLookup; - private @Metric - MutableCounterLong numKeyLookupFails; - @Override public void incNumKeyLookups() { numKeyOps.incr(); @@ -66,11 +79,6 @@ public void incNumKeyLookupFails() { numKeyLookupFails.incr(); } - private @Metric - MutableCounterLong numGetKeyInfo; - private @Metric - MutableCounterLong numGetKeyInfoFails; - @Override public void incNumGetKeyInfo() { numKeyOps.incr(); @@ -82,11 +90,6 @@ public void incNumGetKeyInfoFails() { numGetKeyInfoFails.incr(); } - private @Metric - MutableCounterLong numListStatus; - private @Metric - MutableCounterLong numListStatusFails; - @Override public void incNumListStatus() { numKeyOps.incr(); @@ -99,11 +102,6 @@ public void incNumListStatusFails() { numListStatusFails.incr(); } - private @Metric - MutableCounterLong numGetFileStatus; - private @Metric - MutableCounterLong numGetFileStatusFails; - @Override public void incNumGetFileStatus() { numKeyOps.incr(); @@ -116,11 +114,6 @@ public void incNumGetFileStatusFails() { numGetFileStatusFails.incr(); } - private @Metric - MutableCounterLong numLookupFile; - private @Metric - MutableCounterLong numLookupFileFails; - @Override public void incNumLookupFile() { numKeyOps.incr(); @@ -133,12 +126,6 @@ public void incNumLookupFileFails() { numLookupFileFails.incr(); } - private @Metric - MutableCounterLong numKeyLists; - - private @Metric - MutableCounterLong numKeyListFails; - @Override public void incNumKeyLists() { numKeyLists.incr(); @@ -149,24 +136,11 @@ public void incNumKeyListFails() { numKeyListFails.incr(); } - private @Metric - MutableCounterLong numGetAcl; - @Override public void incNumGetAcl() { numGetAcl.incr(); } - private @Metric - MutableCounterLong numKeyOps; - private @Metric - MutableCounterLong numFSOps; - - private @Metric - MutableCounterLong numGetObjectTagging; - private @Metric - MutableCounterLong numGetObjectTaggingFails; - @Override public void incNumGetObjectTagging() { numGetObjectTagging.incr(); diff --git a/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/Statistic.java b/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/Statistic.java index 504a25643d14..45f4e31d3348 100644 --- a/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/Statistic.java +++ b/hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/Statistic.java @@ -90,14 +90,14 @@ public enum Statistic { } } + private final String symbol; + private final String description; + Statistic(String symbol, String description) { this.symbol = symbol; this.description = description; } - private final String symbol; - private final String description; - public String getSymbol() { return symbol; } diff --git a/hadoop-ozone/recon-codegen/src/main/java/org/apache/ozone/recon/schema/ContainerSchemaDefinition.java b/hadoop-ozone/recon-codegen/src/main/java/org/apache/ozone/recon/schema/ContainerSchemaDefinition.java index 0fffeb9edeff..8a28d0eee098 100644 --- a/hadoop-ozone/recon-codegen/src/main/java/org/apache/ozone/recon/schema/ContainerSchemaDefinition.java +++ b/hadoop-ozone/recon-codegen/src/main/java/org/apache/ozone/recon/schema/ContainerSchemaDefinition.java @@ -43,20 +43,6 @@ public class ContainerSchemaDefinition implements ReconSchemaDefinition { private static final Logger LOG = LoggerFactory.getLogger(ContainerSchemaDefinition.class); - /** - * ENUM describing the allowed container states which can be stored in the - * unhealthy containers table. - */ - public enum UnHealthyContainerStates { - MISSING, - EMPTY_MISSING, - UNDER_REPLICATED, - OVER_REPLICATED, - MIS_REPLICATED, - ALL_REPLICAS_BAD, - NEGATIVE_SIZE // Added new state to track containers with negative sizes - } - private static final String CONTAINER_ID = "container_id"; private static final String CONTAINER_STATE = "container_state"; private final DataSource dataSource; @@ -104,4 +90,18 @@ public DSLContext getDSLContext() { public DataSource getDataSource() { return dataSource; } + + /** + * ENUM describing the allowed container states which can be stored in the + * unhealthy containers table. + */ + public enum UnHealthyContainerStates { + MISSING, + EMPTY_MISSING, + UNDER_REPLICATED, + OVER_REPLICATED, + MIS_REPLICATED, + ALL_REPLICAS_BAD, + NEGATIVE_SIZE // Added new state to track containers with negative sizes + } } diff --git a/hadoop-ozone/recon-codegen/src/main/java/org/apache/ozone/recon/schema/ReconSqlDbConfig.java b/hadoop-ozone/recon-codegen/src/main/java/org/apache/ozone/recon/schema/ReconSqlDbConfig.java index 49afac6c37da..7acd93490379 100644 --- a/hadoop-ozone/recon-codegen/src/main/java/org/apache/ozone/recon/schema/ReconSqlDbConfig.java +++ b/hadoop-ozone/recon-codegen/src/main/java/org/apache/ozone/recon/schema/ReconSqlDbConfig.java @@ -38,14 +38,6 @@ public class ReconSqlDbConfig { ) private String driverClass; - public String getDriverClass() { - return driverClass; - } - - public void setDriverClass(String driverClass) { - this.driverClass = driverClass; - } - @Config(key = "jdbc.url", type = ConfigType.STRING, defaultValue = "jdbc:derby:${ozone.recon.db.dir}/ozone_recon_derby.db", @@ -54,14 +46,6 @@ public void setDriverClass(String driverClass) { ) private String jdbcUrl; - public String getJdbcUrl() { - return jdbcUrl; - } - - public void setJdbcUrl(String jdbcUrl) { - this.jdbcUrl = jdbcUrl; - } - @Config(key = "username", type = ConfigType.STRING, defaultValue = "", @@ -70,14 +54,6 @@ public void setJdbcUrl(String jdbcUrl) { ) private String username; - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - @Config(key = "password", type = ConfigType.STRING, defaultValue = "", @@ -86,14 +62,6 @@ public void setUsername(String username) { ) private String password; - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - @Config(key = "auto.commit", type = ConfigType.BOOLEAN, defaultValue = "true", @@ -103,14 +71,6 @@ public void setPassword(String password) { ) private boolean autoCommit; - public boolean isAutoCommit() { - return autoCommit; - } - - public void setAutoCommit(boolean autoCommit) { - this.autoCommit = autoCommit; - } - @Config(key = "conn.timeout", type = ConfigType.TIME, defaultValue = "30000ms", @@ -120,14 +80,6 @@ public void setAutoCommit(boolean autoCommit) { ) private long connectionTimeout; - public long getConnectionTimeout() { - return connectionTimeout; - } - - public void setConnectionTimeout(long connectionTimeout) { - this.connectionTimeout = connectionTimeout; - } - @Config(key = "conn.max.active", type = ConfigType.INT, defaultValue = "5", @@ -136,14 +88,6 @@ public void setConnectionTimeout(long connectionTimeout) { ) private int maxActiveConnections; - public int getMaxActiveConnections() { - return maxActiveConnections; - } - - public void setMaxActiveConnections(int maxActiveConnections) { - this.maxActiveConnections = maxActiveConnections; - } - @Config(key = "conn.max.age", type = ConfigType.TIME, timeUnit = SECONDS, defaultValue = "1800s", @@ -152,14 +96,6 @@ public void setMaxActiveConnections(int maxActiveConnections) { ) private long connectionMaxAge; - public long getConnectionMaxAge() { - return connectionMaxAge; - } - - public void setConnectionMaxAge(long connectionMaxAge) { - this.connectionMaxAge = connectionMaxAge; - } - @Config(key = "conn.idle.max.age", type = ConfigType.TIME, timeUnit = SECONDS, defaultValue = "3600s", @@ -168,14 +104,6 @@ public void setConnectionMaxAge(long connectionMaxAge) { ) private long connectionIdleMaxAge; - public long getConnectionIdleMaxAge() { - return connectionIdleMaxAge; - } - - public void setConnectionIdleMaxAge(long connectionIdleMaxAge) { - this.connectionIdleMaxAge = connectionIdleMaxAge; - } - @Config(key = "conn.idle.test.period", type = ConfigType.TIME, timeUnit = SECONDS, defaultValue = "60s", @@ -184,14 +112,6 @@ public void setConnectionIdleMaxAge(long connectionIdleMaxAge) { ) private long connectionIdleTestPeriod; - public long getConnectionIdleTestPeriod() { - return connectionIdleTestPeriod; - } - - public void setConnectionIdleTestPeriod(long connectionIdleTestPeriod) { - this.connectionIdleTestPeriod = connectionIdleTestPeriod; - } - @Config(key = "conn.idle.test", type = ConfigType.STRING, defaultValue = "SELECT 1", @@ -201,14 +121,6 @@ public void setConnectionIdleTestPeriod(long connectionIdleTestPeriod) { ) private String idleTestQuery; - public String getIdleTestQuery() { - return idleTestQuery; - } - - public void setIdleTestQuery(String idleTestQuery) { - this.idleTestQuery = idleTestQuery; - } - @Config(key = "jooq.dialect", type = ConfigType.STRING, defaultValue = "DERBY", @@ -220,6 +132,94 @@ public void setIdleTestQuery(String idleTestQuery) { ) private String sqlDbDialect; + public String getDriverClass() { + return driverClass; + } + + public void setDriverClass(String driverClass) { + this.driverClass = driverClass; + } + + public String getJdbcUrl() { + return jdbcUrl; + } + + public void setJdbcUrl(String jdbcUrl) { + this.jdbcUrl = jdbcUrl; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public boolean isAutoCommit() { + return autoCommit; + } + + public void setAutoCommit(boolean autoCommit) { + this.autoCommit = autoCommit; + } + + public long getConnectionTimeout() { + return connectionTimeout; + } + + public void setConnectionTimeout(long connectionTimeout) { + this.connectionTimeout = connectionTimeout; + } + + public int getMaxActiveConnections() { + return maxActiveConnections; + } + + public void setMaxActiveConnections(int maxActiveConnections) { + this.maxActiveConnections = maxActiveConnections; + } + + public long getConnectionMaxAge() { + return connectionMaxAge; + } + + public void setConnectionMaxAge(long connectionMaxAge) { + this.connectionMaxAge = connectionMaxAge; + } + + public long getConnectionIdleMaxAge() { + return connectionIdleMaxAge; + } + + public void setConnectionIdleMaxAge(long connectionIdleMaxAge) { + this.connectionIdleMaxAge = connectionIdleMaxAge; + } + + public long getConnectionIdleTestPeriod() { + return connectionIdleTestPeriod; + } + + public void setConnectionIdleTestPeriod(long connectionIdleTestPeriod) { + this.connectionIdleTestPeriod = connectionIdleTestPeriod; + } + + public String getIdleTestQuery() { + return idleTestQuery; + } + + public void setIdleTestQuery(String idleTestQuery) { + this.idleTestQuery = idleTestQuery; + } + public String getSqlDbDialect() { return sqlDbDialect; } diff --git a/hadoop-ozone/recon-codegen/src/main/java/org/apache/ozone/recon/schema/SqlDbUtils.java b/hadoop-ozone/recon-codegen/src/main/java/org/apache/ozone/recon/schema/SqlDbUtils.java index 0ec998d5b8fc..22c00cb9685b 100644 --- a/hadoop-ozone/recon-codegen/src/main/java/org/apache/ozone/recon/schema/SqlDbUtils.java +++ b/hadoop-ozone/recon-codegen/src/main/java/org/apache/ozone/recon/schema/SqlDbUtils.java @@ -47,6 +47,21 @@ public final class SqlDbUtils { private static final Logger LOG = LoggerFactory.getLogger(SqlDbUtils.class); + /** + * Helper function to check if table exists through JOOQ. + */ + public static final BiPredicate TABLE_EXISTS_CHECK = + (conn, tableName) -> { + try { + DSL.using(conn).select(count()).from(tableName).execute(); + } catch (DataAccessException ex) { + LOG.debug(ex.getMessage()); + return false; + } + LOG.info("{} table already exists, skipping creation.", tableName); + return true; + }; + private SqlDbUtils() { } @@ -82,21 +97,6 @@ public void write(int b) throws IOException { }; } - /** - * Helper function to check if table exists through JOOQ. - */ - public static final BiPredicate TABLE_EXISTS_CHECK = - (conn, tableName) -> { - try { - DSL.using(conn).select(count()).from(tableName).execute(); - } catch (DataAccessException ex) { - LOG.debug(ex.getMessage()); - return false; - } - LOG.info("{} table already exists, skipping creation.", tableName); - return true; - }; - /** * Utility method to list all user-defined tables in the database. * diff --git a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconConstants.java b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconConstants.java index a7a2a1daf80d..00950cfd716b 100644 --- a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconConstants.java +++ b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconConstants.java @@ -24,10 +24,6 @@ */ public final class ReconConstants { - private ReconConstants() { - // Never Constructed - } - public static final String RECON_CONTAINER_KEY_DB = "recon-container-key.db"; public static final String CONTAINER_COUNT_KEY = "containerCount"; @@ -97,6 +93,10 @@ private ReconConstants() { public static final AtomicBoolean CONTAINER_KEY_TABLES_TRUNCATED = new AtomicBoolean(false); + private ReconConstants() { + // Never Constructed + } + /** * Resets the table truncated flag for the given tables. This should be called once per reprocess cycle, * for example by the OM task controller, before the tasks run. diff --git a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconUtils.java b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconUtils.java index 86035c45df10..2999c21e61dd 100644 --- a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconUtils.java +++ b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconUtils.java @@ -96,14 +96,14 @@ @Singleton public class ReconUtils { - public ReconUtils() { - } - private static Logger log = LoggerFactory.getLogger( ReconUtils.class); private static AtomicBoolean rebuildTriggered = new AtomicBoolean(false); + public ReconUtils() { + } + public static File getReconScmDbDir(ConfigurationSource conf) { return new ReconUtils().getReconDbDir(conf, OZONE_RECON_SCM_DB_DIR); } diff --git a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/ContainerKeyPrefixImpl.java b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/ContainerKeyPrefixImpl.java index dc5ecdd89bde..33d7114f1697 100644 --- a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/ContainerKeyPrefixImpl.java +++ b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/ContainerKeyPrefixImpl.java @@ -27,10 +27,6 @@ */ final class ContainerKeyPrefixImpl implements ContainerKeyPrefix, KeyPrefixContainer { - static ContainerKeyPrefixImpl get(long containerId, String keyPrefix, - long keyVersion) { - return new ContainerKeyPrefixImpl(containerId, keyPrefix, keyVersion); - } private final long containerId; private final String keyPrefix; @@ -43,6 +39,11 @@ private ContainerKeyPrefixImpl(long containerId, String keyPrefix, this.keyVersion = keyVersion; } + static ContainerKeyPrefixImpl get(long containerId, String keyPrefix, + long keyVersion) { + return new ContainerKeyPrefixImpl(containerId, keyPrefix, keyVersion); + } + @Override public long getContainerId() { return containerId; diff --git a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/KeyEntityInfoProtoWrapper.java b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/KeyEntityInfoProtoWrapper.java index 830ebe9773c9..b515ff14756d 100644 --- a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/KeyEntityInfoProtoWrapper.java +++ b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/KeyEntityInfoProtoWrapper.java @@ -31,14 +31,6 @@ */ public final class KeyEntityInfoProtoWrapper { - public static Codec getCodec() { - return new DelegatedCodec<>( - Proto2Codec.get(OzoneManagerProtocolProtos.KeyInfo.getDefaultInstance()), - KeyEntityInfoProtoWrapper::getFromProtobuf, - KeyEntityInfoProtoWrapper::toProtobuf, - KeyEntityInfoProtoWrapper.class); - } - private final OzoneManagerProtocolProtos.KeyInfo keyInfoProto; /** This is key table key of rocksDB and will help UI to implement pagination @@ -63,6 +55,14 @@ private KeyEntityInfoProtoWrapper(OzoneManagerProtocolProtos.KeyInfo proto) { this.replicatedSize = QuotaUtil.getReplicatedSize(getSize(), getReplicationConfig()); } + public static Codec getCodec() { + return new DelegatedCodec<>( + Proto2Codec.get(OzoneManagerProtocolProtos.KeyInfo.getDefaultInstance()), + KeyEntityInfoProtoWrapper::getFromProtobuf, + KeyEntityInfoProtoWrapper::toProtobuf, + KeyEntityInfoProtoWrapper.class); + } + public static KeyEntityInfoProtoWrapper getFromProtobuf(OzoneManagerProtocolProtos.KeyInfo keyInfo) { return new KeyEntityInfoProtoWrapper(keyInfo); } diff --git a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/codec/NSSummaryCodec.java b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/codec/NSSummaryCodec.java index 9541f51c80f2..1d5b33cbcc65 100644 --- a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/codec/NSSummaryCodec.java +++ b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/codec/NSSummaryCodec.java @@ -39,10 +39,6 @@ public final class NSSummaryCodec implements Codec { private static final Codec INSTANCE = new NSSummaryCodec(); - public static Codec get() { - return INSTANCE; - } - private final Codec integerCodec = IntegerCodec.get(); private final Codec shortCodec = ShortCodec.get(); private final Codec longCodec = LongCodec.get(); @@ -56,6 +52,10 @@ private NSSummaryCodec() { // singleton } + public static Codec get() { + return INSTANCE; + } + @Override public Class getTypeClass() { return NSSummary.class; diff --git a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/metrics/ContainerHealthMetrics.java b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/metrics/ContainerHealthMetrics.java index d9531fafcc5f..f013f8670afe 100644 --- a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/metrics/ContainerHealthMetrics.java +++ b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/metrics/ContainerHealthMetrics.java @@ -35,9 +35,23 @@ public final class ContainerHealthMetrics { private static final String SOURCE_NAME = ContainerHealthMetrics.class.getSimpleName(); + @Metric(about = "Number of missing containers detected in Recon.") + private MutableGaugeLong missingContainerCount; + + @Metric(about = "Number of under replicated containers detected in Recon.") + private MutableGaugeLong underReplicatedContainerCount; + + @Metric(about = "Number of replica mismatch containers detected in Recon.") + private MutableGaugeLong replicaMisMatchContainerCount; + private ContainerHealthMetrics() { } + public void unRegister() { + MetricsSystem ms = DefaultMetricsSystem.instance(); + ms.unregisterSource(SOURCE_NAME); + } + public static ContainerHealthMetrics create() { MetricsSystem ms = DefaultMetricsSystem.instance(); return ms.register(SOURCE_NAME, @@ -45,20 +59,6 @@ public static ContainerHealthMetrics create() { new ContainerHealthMetrics()); } - public void unRegister() { - MetricsSystem ms = DefaultMetricsSystem.instance(); - ms.unregisterSource(SOURCE_NAME); - } - - @Metric(about = "Number of missing containers detected in Recon.") - private MutableGaugeLong missingContainerCount; - - @Metric(about = "Number of under replicated containers detected in Recon.") - private MutableGaugeLong underReplicatedContainerCount; - - @Metric(about = "Number of replica mismatch containers detected in Recon.") - private MutableGaugeLong replicaMisMatchContainerCount; - public void setMissingContainerCount(long missingContainerCount) { this.missingContainerCount.set(missingContainerCount); } diff --git a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/metrics/OzoneManagerSyncMetrics.java b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/metrics/OzoneManagerSyncMetrics.java index c4df2a5e98d4..403a08b5b098 100644 --- a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/metrics/OzoneManagerSyncMetrics.java +++ b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/metrics/OzoneManagerSyncMetrics.java @@ -38,21 +38,6 @@ public final class OzoneManagerSyncMetrics { private static final String SOURCE_NAME = OzoneManagerSyncMetrics.class.getSimpleName(); - private OzoneManagerSyncMetrics() { - } - - public static OzoneManagerSyncMetrics create() { - MetricsSystem ms = DefaultMetricsSystem.instance(); - return ms.register(SOURCE_NAME, - "Recon Ozone Manager Sync Metrics", - new OzoneManagerSyncMetrics()); - } - - public void unRegister() { - MetricsSystem ms = DefaultMetricsSystem.instance(); - ms.unregisterSource(SOURCE_NAME); - } - @Metric(about = "Number of OM snapshot requests made by Recon.") private MutableCounterLong numSnapshotRequests; @@ -78,6 +63,21 @@ public void unRegister() { @Metric(about = "The lag of sequence number between Recon and OM") private MutableGaugeLong sequenceNumberLag; + private OzoneManagerSyncMetrics() { + } + + public static OzoneManagerSyncMetrics create() { + MetricsSystem ms = DefaultMetricsSystem.instance(); + return ms.register(SOURCE_NAME, + "Recon Ozone Manager Sync Metrics", + new OzoneManagerSyncMetrics()); + } + + public void unRegister() { + MetricsSystem ms = DefaultMetricsSystem.instance(); + ms.unregisterSource(SOURCE_NAME); + } + public void incrNumSnapshotRequests() { this.numSnapshotRequests.incr(); } diff --git a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ContainerReplicaHistoryList.java b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ContainerReplicaHistoryList.java index a31300785b2f..6c43630ad228 100644 --- a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ContainerReplicaHistoryList.java +++ b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ContainerReplicaHistoryList.java @@ -38,10 +38,6 @@ public class ContainerReplicaHistoryList { ContainerReplicaHistoryList::toProto, ContainerReplicaHistoryList.class); - public static Codec getCodec() { - return CODEC; - } - private List replicaHistories; public ContainerReplicaHistoryList( @@ -49,6 +45,10 @@ public ContainerReplicaHistoryList( this.replicaHistories = new ArrayList<>(replicaHistories); } + public static Codec getCodec() { + return CODEC; + } + public List asList() { return Collections.unmodifiableList(replicaHistories); } diff --git a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconPolicyProvider.java b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconPolicyProvider.java index 56171a835128..76fd43e1dff6 100644 --- a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconPolicyProvider.java +++ b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconPolicyProvider.java @@ -37,6 +37,13 @@ public final class ReconPolicyProvider extends PolicyProvider { private static final Supplier SUPPLIER = MemoizedSupplier.valueOf(ReconPolicyProvider::new); + private static final List RECON_SERVICES = + Collections.singletonList( + new Service( + OZONE_RECON_SECURITY_CLIENT_DATANODE_CONTAINER_PROTOCOL_ACL, + ReconDatanodeProtocol.class) + ); + private ReconPolicyProvider() { } @@ -46,13 +53,6 @@ public static ReconPolicyProvider getInstance() { return SUPPLIER.get(); } - private static final List RECON_SERVICES = - Collections.singletonList( - new Service( - OZONE_RECON_SECURITY_CLIENT_DATANODE_CONTAINER_PROTOCOL_ACL, - ReconDatanodeProtocol.class) - ); - @Override public Service[] getServices() { return RECON_SERVICES.toArray(new Service[0]); diff --git a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/KeyPrefixContainerCodec.java b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/KeyPrefixContainerCodec.java index 9b88343a7e48..52a6998ca1a7 100644 --- a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/KeyPrefixContainerCodec.java +++ b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/KeyPrefixContainerCodec.java @@ -35,6 +35,8 @@ public final class KeyPrefixContainerCodec private static final Codec INSTANCE = new KeyPrefixContainerCodec(); + private static final String KEY_DELIMITER = "_"; + public static Codec get() { return INSTANCE; } @@ -43,8 +45,6 @@ private KeyPrefixContainerCodec() { // singleton } - private static final String KEY_DELIMITER = "_"; - @Override public Class getTypeClass() { return KeyPrefixContainer.class; diff --git a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/ReconDBDefinition.java b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/ReconDBDefinition.java index 83cc90adc614..a5d6cd914537 100644 --- a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/ReconDBDefinition.java +++ b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/ReconDBDefinition.java @@ -36,11 +36,6 @@ public class ReconDBDefinition extends DBDefinition.WithMap { private final String dbName; - public ReconDBDefinition(String dbName) { - super(COLUMN_FAMILIES); - this.dbName = dbName; - } - public static final DBColumnFamilyDefinition CONTAINER_KEY = new DBColumnFamilyDefinition<>( @@ -92,6 +87,11 @@ public ReconDBDefinition(String dbName) { REPLICA_HISTORY, REPLICA_HISTORY_V2); + public ReconDBDefinition(String dbName) { + super(COLUMN_FAMILIES); + this.dbName = dbName; + } + @Override public String getName() { return dbName; diff --git a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/ReconTaskConfig.java b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/ReconTaskConfig.java index dc6c676662e9..9ccab5b083e0 100644 --- a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/ReconTaskConfig.java +++ b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/ReconTaskConfig.java @@ -38,14 +38,6 @@ public class ReconTaskConfig { ) private Duration pipelineSyncTaskInterval = Duration.ofMinutes(5); - public Duration getPipelineSyncTaskInterval() { - return pipelineSyncTaskInterval; - } - - public void setPipelineSyncTaskInterval(Duration interval) { - this.pipelineSyncTaskInterval = interval; - } - @Config(key = "missingcontainer.interval", type = ConfigType.TIME, defaultValue = "300s", @@ -56,14 +48,6 @@ public void setPipelineSyncTaskInterval(Duration interval) { ) private Duration missingContainerTaskInterval = Duration.ofMinutes(5); - public Duration getMissingContainerTaskInterval() { - return missingContainerTaskInterval; - } - - public void setMissingContainerTaskInterval(Duration interval) { - this.missingContainerTaskInterval = interval; - } - @Config(key = "safemode.wait.threshold", type = ConfigType.TIME, defaultValue = "300s", @@ -74,14 +58,6 @@ public void setMissingContainerTaskInterval(Duration interval) { ) private Duration safeModeWaitThreshold = Duration.ofMinutes(5); - public Duration getSafeModeWaitThreshold() { - return safeModeWaitThreshold; - } - - public void setSafeModeWaitThreshold(Duration safeModeWaitThreshold) { - this.safeModeWaitThreshold = safeModeWaitThreshold; - } - @Config(key = "containercounttask.interval", type = ConfigType.TIME, defaultValue = "60s", @@ -91,6 +67,30 @@ public void setSafeModeWaitThreshold(Duration safeModeWaitThreshold) { ) private Duration containerSizeCountTaskInterval = Duration.ofMinutes(1); + public Duration getPipelineSyncTaskInterval() { + return pipelineSyncTaskInterval; + } + + public void setPipelineSyncTaskInterval(Duration interval) { + this.pipelineSyncTaskInterval = interval; + } + + public Duration getMissingContainerTaskInterval() { + return missingContainerTaskInterval; + } + + public void setMissingContainerTaskInterval(Duration interval) { + this.missingContainerTaskInterval = interval; + } + + public Duration getSafeModeWaitThreshold() { + return safeModeWaitThreshold; + } + + public void setSafeModeWaitThreshold(Duration safeModeWaitThreshold) { + this.safeModeWaitThreshold = safeModeWaitThreshold; + } + public Duration getContainerSizeCountTaskInterval() { return containerSizeCountTaskInterval; } diff --git a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java index 21718295b9c1..1b11d47a166e 100644 --- a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java +++ b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java @@ -176,6 +176,9 @@ public class ObjectEndpoint extends EndpointBase { private boolean datastreamEnabled; private long datastreamMinLength; + @Inject + private OzoneConfiguration ozoneConfiguration; + public ObjectEndpoint() { overrideQueryParameter = ImmutableMap.builder() .put("Content-Type", "response-content-type") @@ -187,9 +190,6 @@ public ObjectEndpoint() { .build(); } - @Inject - private OzoneConfiguration ozoneConfiguration; - @Override @PostConstruct public void init() { diff --git a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/S3Acl.java b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/S3Acl.java index de92c315a82a..63b9923947b5 100644 --- a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/S3Acl.java +++ b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/S3Acl.java @@ -63,10 +63,6 @@ enum ACLType { // Allows grantee above all permissions on the bucket FULL_CONTROL("FULL_CONTROL"); - public String getValue() { - return value; - } - /** * String value for this Enum. */ @@ -79,6 +75,10 @@ public String getValue() { value = val; } + public String getValue() { + return value; + } + public static ACLType getType(String typeStr) { for (ACLType type: ACLType.values()) { if (type.getValue().equals(typeStr)) { @@ -97,14 +97,6 @@ enum ACLIdentityType { GROUP("Group", false, "url"), USER_BY_EMAIL("AmazonCustomerByEmail", false, "emailAddress"); - public String getGranteeType() { - return granteeType; - } - - public String getHeaderType() { - return granteeInHeader; - } - /** * Grantee type in body XML. */ @@ -131,6 +123,14 @@ public String getHeaderType() { granteeInHeader = headerType; } + public String getGranteeType() { + return granteeType; + } + + public String getHeaderType() { + return granteeInHeader; + } + boolean isSupported() { return supported; } diff --git a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/exception/S3ErrorTable.java b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/exception/S3ErrorTable.java index ed10f2894f0b..b09ba5c9547f 100644 --- a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/exception/S3ErrorTable.java +++ b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/exception/S3ErrorTable.java @@ -40,10 +40,6 @@ public final class S3ErrorTable { private static final Logger LOG = LoggerFactory.getLogger( S3ErrorTable.class); - private S3ErrorTable() { - //No one should construct this object. - } - public static final OS3Exception INVALID_URI = new OS3Exception("InvalidURI", "Couldn't parse the specified URI.", HTTP_BAD_REQUEST); @@ -154,6 +150,13 @@ private S3ErrorTable() { HTTP_FORBIDDEN ); + private static Function generateInternalError = + e -> new OS3Exception("InternalError", e.getMessage(), HTTP_INTERNAL_ERROR); + + private S3ErrorTable() { + //No one should construct this object. + } + public static OS3Exception newError(OS3Exception e, String resource) { return newError(e, resource, null); } @@ -178,9 +181,6 @@ public static OS3Exception newError(OS3Exception e, String resource, return err; } - private static Function generateInternalError = e -> - new OS3Exception("InternalError", e.getMessage(), HTTP_INTERNAL_ERROR); - public static OS3Exception getInternalError(Exception e) { return generateInternalError.apply(e); } diff --git a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/util/RFC1123Util.java b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/util/RFC1123Util.java index 539154384419..8a33c7d7fd8c 100644 --- a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/util/RFC1123Util.java +++ b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/util/RFC1123Util.java @@ -39,10 +39,6 @@ * golang clients. */ public final class RFC1123Util { - - private RFC1123Util() { - } - /** * An RFC-1123 compatible file format which always use two digits for the * days. @@ -95,4 +91,7 @@ private RFC1123Util() { .appendOffset("+HHMM", OzoneConsts.OZONE_TIME_ZONE) .toFormatter(); } + + private RFC1123Util() { + } } diff --git a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/util/S3Consts.java b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/util/S3Consts.java index 3204abeebab3..1060f2568c80 100644 --- a/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/util/S3Consts.java +++ b/hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/util/S3Consts.java @@ -26,11 +26,6 @@ @InterfaceAudience.Private public final class S3Consts { - //Never Constructed - private S3Consts() { - - } - public static final String COPY_SOURCE_HEADER = "x-amz-copy-source"; public static final String COPY_SOURCE_HEADER_RANGE = "x-amz-copy-source-range"; @@ -92,6 +87,11 @@ private S3Consts() { public static final Pattern TAG_REGEX_PATTERN = Pattern.compile("^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-]*)$"); public static final String MP_PARTS_COUNT = "x-amz-mp-parts-count"; + //Never Constructed + private S3Consts() { + + } + /** * Copy directive for metadata and tags. */ diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/nssummary/NSSummaryCLIUtils.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/nssummary/NSSummaryCLIUtils.java index 5c6d744a4522..e34e72d95483 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/nssummary/NSSummaryCLIUtils.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/nssummary/NSSummaryCLIUtils.java @@ -37,10 +37,6 @@ */ public final class NSSummaryCLIUtils { - private NSSummaryCLIUtils() { - - } - private static final String OFS_PREFIX = "ofs://"; public static String makeHttpCall(StringBuilder url, String path, @@ -154,4 +150,8 @@ public static String parseInputPath(String path) { } return path.substring(idx); } + + private NSSummaryCLIUtils() { + + } } diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/scm/GetFailedDeletedBlocksTxnSubcommand.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/scm/GetFailedDeletedBlocksTxnSubcommand.java index 9717a3856789..c9b8d7fbe534 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/scm/GetFailedDeletedBlocksTxnSubcommand.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/admin/scm/GetFailedDeletedBlocksTxnSubcommand.java @@ -46,18 +46,6 @@ public class GetFailedDeletedBlocksTxnSubcommand extends ScmSubcommand { @CommandLine.ArgGroup(multiplicity = "1") private TransactionsOption group; - static class TransactionsOption { - @CommandLine.Option(names = {"-a", "--all"}, - description = "Get all the failed transactions.") - private boolean getAll; - - @CommandLine.Option(names = {"-c", "--count"}, - defaultValue = "20", - description = "Get at most the count number of the" + - " failed transactions.") - private int count; - } - @CommandLine.Option(names = {"-s", "--startTxId", "--start-tx-id"}, defaultValue = "0", description = "The least transaction ID to start with, default 0." + @@ -89,4 +77,16 @@ public void execute(ScmClient client) throws IOException { System.out.println(result); } } + + static class TransactionsOption { + @CommandLine.Option(names = {"-a", "--all"}, + description = "Get all the failed transactions.") + private boolean getAll; + + @CommandLine.Option(names = {"-c", "--count"}, + defaultValue = "20", + description = "Get at most the count number of the" + + " failed transactions.") + private int count; + } } diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/containerlog/parser/DBConsts.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/containerlog/parser/DBConsts.java index 7f8bb903ae70..d4b3c5a32043 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/containerlog/parser/DBConsts.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/containerlog/parser/DBConsts.java @@ -22,10 +22,6 @@ */ public final class DBConsts { - private DBConsts() { - //Never constructed - } - public static final String DRIVER = "org.sqlite.JDBC"; public static final String CONNECTION_PREFIX = "jdbc:sqlite:"; public static final String DATABASE_NAME = "container_datanode.db"; @@ -35,4 +31,7 @@ private DBConsts() { public static final String DATANODE_CONTAINER_LOG_TABLE_NAME = "DatanodeContainerLogTable"; public static final String CONTAINER_LOG_TABLE_NAME = "ContainerLogTable"; + private DBConsts() { + //Never constructed + } } diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBDefinitionFactory.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBDefinitionFactory.java index 0e3b3cfadde7..5b082ea49803 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBDefinitionFactory.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/DBDefinitionFactory.java @@ -46,20 +46,20 @@ */ public final class DBDefinitionFactory { - private DBDefinitionFactory() { - } - private static final AtomicReference DATANODE_DB_SCHEMA_VERSION = new AtomicReference<>(); private static final Map DB_MAP; static { final Map map = new HashMap<>(); Arrays.asList(SCMDBDefinition.get(), OMDBDefinition.get(), ReconSCMDBDefinition.get(), - WitnessedContainerDBDefinition.get()) + WitnessedContainerDBDefinition.get()) .forEach(dbDefinition -> map.put(dbDefinition.getName(), dbDefinition)); DB_MAP = Collections.unmodifiableMap(map); } + private DBDefinitionFactory() { + } + public static DBDefinition getDefinition(String dbName) { // OM snapshot DB name starts with this prefix. if (!dbName.equals(OM_DB_NAME) && dbName.startsWith(OM_DB_NAME)) { diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/audit/parser/common/DatabaseHelper.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/audit/parser/common/DatabaseHelper.java index 7d6271aca3c8..63f3fa53cde5 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/audit/parser/common/DatabaseHelper.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/audit/parser/common/DatabaseHelper.java @@ -45,9 +45,6 @@ * Database helper for ozone audit parser tool. */ public final class DatabaseHelper { - private DatabaseHelper() { - //Never constructed - } static { loadProperties(); @@ -57,6 +54,10 @@ private DatabaseHelper() { LoggerFactory.getLogger(DatabaseHelper.class); private static Map properties; + private DatabaseHelper() { + //Never constructed + } + public static boolean setup(String dbName, String logs) throws Exception { if (createAuditTable(dbName)) { return insertAudits(dbName, logs); diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/audit/parser/common/ParserConsts.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/audit/parser/common/ParserConsts.java index ee93ce5aa0c8..1265a7fca523 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/audit/parser/common/ParserConsts.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/audit/parser/common/ParserConsts.java @@ -21,11 +21,6 @@ * Constants used for ozone audit parser. */ public final class ParserConsts { - - private ParserConsts() { - //Never constructed - } - public static final String DRIVER = "org.sqlite.JDBC"; public static final String CONNECTION_PREFIX = "jdbc:sqlite:"; public static final String DATE_REGEX = "^\\d{4}-\\d{2}-\\d{2}.*$"; @@ -33,4 +28,7 @@ private ParserConsts() { public static final String INSERT_AUDITS = "insertAuditEntry"; public static final String CREATE_AUDIT_TABLE = "createAuditTable"; + private ParserConsts() { + //Never constructed + } } diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/om/PrefixParser.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/om/PrefixParser.java index a9ba5961b517..31b14754eeb0 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/om/PrefixParser.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/om/PrefixParser.java @@ -48,18 +48,6 @@ description = "Parse prefix contents") public class PrefixParser implements Callable { - /** - * Types to represent the level or path component type. - */ - public enum Types { - VOLUME, - BUCKET, - FILE, - DIRECTORY, - INTERMEDIATE_DIRECTORY, - NON_EXISTENT_DIRECTORY, - } - private final int[] parserStats = new int[Types.values().length]; @CommandLine.Option(names = {"--db"}, @@ -248,4 +236,16 @@ private static MetadataKeyFilters.KeyPrefixFilter getPrefixFilter( public int getParserStats(Types type) { return parserStats[type.ordinal()]; } + + /** + * Types to represent the level or path component type. + */ + public enum Types { + VOLUME, + BUCKET, + FILE, + DIRECTORY, + INTERMEDIATE_DIRECTORY, + NON_EXISTENT_DIRECTORY, + } } diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/replicas/ReplicasVerify.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/replicas/ReplicasVerify.java index 2aa72fa56700..2f1a30ed26d9 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/replicas/ReplicasVerify.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/replicas/ReplicasVerify.java @@ -57,15 +57,6 @@ public class ReplicasVerify extends Handler { @CommandLine.ArgGroup(exclusive = false, multiplicity = "1") private Verification verification; - static class Verification { - @CommandLine.Option(names = "--checksums", - description = "Do client side data checksum validation of all replicas.", - // value will be true only if the "--checksums" option was specified on the CLI - defaultValue = "false") - private boolean doExecuteChecksums; - - } - private List replicaVerifiers; @Override @@ -126,4 +117,13 @@ void checkBucket(OzoneBucket bucket) throws IOException { void processKey(OzoneKeyDetails keyDetails) { replicaVerifiers.forEach(verifier -> verifier.verifyKey(keyDetails)); } + + static class Verification { + @CommandLine.Option(names = "--checksums", + description = "Do client side data checksum validation of all replicas.", + // value will be true only if the "--checksums" option was specified on the CLI + defaultValue = "false") + private boolean doExecuteChecksums; + + } } diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/OmMetadataGenerator.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/OmMetadataGenerator.java index e89c71ed111a..852ed68930f1 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/OmMetadataGenerator.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/OmMetadataGenerator.java @@ -73,26 +73,6 @@ public class OmMetadataGenerator extends BaseFreonGenerator implements Callable { - enum Operation { - CREATE_FILE, - CREATE_STREAM_FILE, - LOOKUP_FILE, - READ_FILE, - LIST_STATUS, - LIST_STATUS_LIGHT, - CREATE_KEY, - CREATE_STREAM_KEY, - LOOKUP_KEY, - GET_KEYINFO, - HEAD_KEY, - READ_KEY, - LIST_KEYS, - LIST_KEYS_LIGHT, - INFO_BUCKET, - INFO_VOLUME, - MIXED, - } - @Option(names = {"-v", "--volume"}, description = "Name of the volume which contains the test data. Will be" + " created if missing.", @@ -464,4 +444,24 @@ private Void performReadOperation(ReadOperation readOp, byte[] buffer) throws IO public boolean allowEmptyPrefix() { return true; } + + enum Operation { + CREATE_FILE, + CREATE_STREAM_FILE, + LOOKUP_FILE, + READ_FILE, + LIST_STATUS, + LIST_STATUS_LIGHT, + CREATE_KEY, + CREATE_STREAM_KEY, + LOOKUP_KEY, + GET_KEYINFO, + HEAD_KEY, + READ_KEY, + LIST_KEYS, + LIST_KEYS_LIGHT, + INFO_BUCKET, + INFO_VOLUME, + MIXED, + } } diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/OzoneClientKeyReadWriteListOps.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/OzoneClientKeyReadWriteListOps.java index a820bbe9c7a4..a41252e848a0 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/OzoneClientKeyReadWriteListOps.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/OzoneClientKeyReadWriteListOps.java @@ -144,15 +144,6 @@ public class OzoneClientKeyReadWriteListOps extends BaseFreonGenerator private static final AtomicLong NEXT_NUMBER = new AtomicLong(); - /** - * Task type of read task, or write task. - */ - public enum TaskType { - READ_TASK, - WRITE_TASK, - LIST_TASK - } - private KeyGeneratorUtil kg; @Override @@ -278,4 +269,13 @@ public String getKeyName() { public boolean allowEmptyPrefix() { return true; } + + /** + * Task type of read task, or write task. + */ + public enum TaskType { + READ_TASK, + WRITE_TASK, + LIST_TASK + } } diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/RandomKeyGenerator.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/RandomKeyGenerator.java index db335ac23c1a..3c2e364668e5 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/RandomKeyGenerator.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/RandomKeyGenerator.java @@ -94,13 +94,6 @@ public final class RandomKeyGenerator implements Callable, FreonSubcommand @ParentCommand private Freon freon; - enum FreonOps { - VOLUME_CREATE, - BUCKET_CREATE, - KEY_CREATE, - KEY_WRITE - } - private static final String DURATION_FORMAT = "HH:mm:ss,SSS"; private static final int QUANTILES = 10; @@ -1218,4 +1211,11 @@ public void run() { public int getThreadPoolSize() { return threadPoolSize; } + + enum FreonOps { + VOLUME_CREATE, + BUCKET_CREATE, + KEY_CREATE, + KEY_WRITE + } } diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/SCMThroughputBenchmark.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/SCMThroughputBenchmark.java index 70fd469f915b..64c8d1bddf68 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/SCMThroughputBenchmark.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/freon/SCMThroughputBenchmark.java @@ -116,15 +116,6 @@ public final class SCMThroughputBenchmark implements Callable, FreonSubcom private static final Logger LOG = LoggerFactory.getLogger(SCMThroughputBenchmark.class); - /** - * Type of benchmarks. - */ - public enum BenchmarkType { - AllocateBlocks, - AllocateContainers, - ProcessReports, - } - @CommandLine.ParentCommand private Freon freon; @@ -921,4 +912,13 @@ private static ContainerReportsProto createContainerReport() { private static PipelineReportsProto createPipelineReport() { return PipelineReportsProto.newBuilder().build(); } + + /** + * Type of benchmarks. + */ + public enum BenchmarkType { + AllocateBlocks, + AllocateContainers, + ProcessReports, + } } From 441a9542e315aa92486726d0e426ddf020ad226d Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Mon, 28 Apr 2025 10:27:21 +0200 Subject: [PATCH 14/26] HDDS-12915. Mark testCreatePipelineThrowErrorWithDataNodeLimit as flaky --- .../hadoop/hdds/scm/pipeline/TestRatisPipelineProvider.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestRatisPipelineProvider.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestRatisPipelineProvider.java index 3b40d6c6077c..0653e78e7df9 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestRatisPipelineProvider.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestRatisPipelineProvider.java @@ -60,6 +60,7 @@ import org.apache.hadoop.hdds.utils.db.DBStore; import org.apache.hadoop.hdds.utils.db.DBStoreBuilder; import org.apache.hadoop.ozone.ClientVersion; +import org.apache.ozone.test.tag.Flaky; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assumptions; import org.junit.jupiter.api.Test; @@ -365,6 +366,7 @@ public void testCreatePipelinesWhenNotEnoughSpace(@TempDir File tempDir) throws @ParameterizedTest @CsvSource({ "1, 2", "2, 5" }) + @Flaky("HDDS-12915") public void testCreatePipelineThrowErrorWithDataNodeLimit(int limit, int pipelineCount) throws Exception { init(limit); From d676f14c4d45ec74de350b9b0fb5367be982a74f Mon Sep 17 00:00:00 2001 From: Tsz-Wo Nicholas Sze Date: Mon, 28 Apr 2025 03:10:44 -0700 Subject: [PATCH 15/26] HDDS-12900. Use OMDBDefinition in OmMetadataManagerImpl (#8337) --- .../utils/db/DBColumnFamilyDefinition.java | 28 ++- .../apache/hadoop/hdds/utils/db/DBStore.java | 6 + .../ha/TestInterSCMGrpcProtocolService.java | 9 +- .../ozone/om/OmMetadataManagerImpl.java | 236 +++++++----------- .../hadoop/ozone/om/codec/OMDBDefinition.java | 4 +- .../ozone/om/TestOmMetadataManager.java | 55 +++- .../ozone/om/TestOmSnapshotManager.java | 17 +- 7 files changed, 180 insertions(+), 175 deletions(-) diff --git a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/DBColumnFamilyDefinition.java b/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/DBColumnFamilyDefinition.java index 89326bb4223a..3d0c2fe196c1 100644 --- a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/DBColumnFamilyDefinition.java +++ b/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/DBColumnFamilyDefinition.java @@ -17,12 +17,16 @@ package org.apache.hadoop.hdds.utils.db; +import static org.apache.ratis.util.JavaUtils.getClassSimpleName; + import java.io.IOException; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.Objects; import org.apache.hadoop.hdds.utils.CollectionUtils; +import org.apache.hadoop.hdds.utils.db.cache.TableCache.CacheType; import org.apache.hadoop.hdds.utils.db.managed.ManagedColumnFamilyOptions; /** @@ -34,17 +38,18 @@ public class DBColumnFamilyDefinition { private final String tableName; - private final Codec keyCodec; - private final Codec valueCodec; + private final String name; private volatile ManagedColumnFamilyOptions cfOptions; public DBColumnFamilyDefinition(String tableName, Codec keyCodec, Codec valueCodec) { - this.tableName = tableName; - this.keyCodec = keyCodec; - this.valueCodec = valueCodec; + this.tableName = Objects.requireNonNull(tableName, "tableName == null"); + this.keyCodec = Objects.requireNonNull(keyCodec, "keyCodec == null"); + this.valueCodec = Objects.requireNonNull(valueCodec, "valueCodec == null"); + this.name = tableName + "-def: " + getClassSimpleName(getKeyType()) + + " -> " + getClassSimpleName(getValueType()); this.cfOptions = null; } @@ -67,8 +72,12 @@ public DBColumnFamilyDefinition(String tableName, Codec keyCodec, Codec getTable(DBStore db) throws IOException { - return db.getTable(tableName, getKeyType(), getValueType()); + public TypedTable getTable(DBStore db) throws IOException { + return db.getTable(tableName, keyCodec, valueCodec); + } + + public TypedTable getTable(DBStore db, CacheType cacheType) throws IOException { + return db.getTable(tableName, keyCodec, valueCodec, cacheType); } public String getName() { @@ -98,4 +107,9 @@ public ManagedColumnFamilyOptions getCfOptions() { public void setCfOptions(ManagedColumnFamilyOptions cfOptions) { this.cfOptions = cfOptions; } + + @Override + public String toString() { + return name; + } } diff --git a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/DBStore.java b/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/DBStore.java index 4d83acba39ef..eae3148ae04b 100644 --- a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/DBStore.java +++ b/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/DBStore.java @@ -24,6 +24,7 @@ import java.util.Map; import org.apache.hadoop.hdds.annotation.InterfaceStability; import org.apache.hadoop.hdds.utils.db.cache.TableCache; +import org.apache.hadoop.hdds.utils.db.cache.TableCache.CacheType; import org.apache.ozone.rocksdiff.RocksDBCheckpointDiffer; /** @@ -45,6 +46,11 @@ public interface DBStore extends Closeable, BatchOperationHandler { */ Table getTable(String name) throws IOException; + /** The same as getTable(name, keyCodec, valueCodec, CacheType.PARTIAL_CACHE). */ + default TypedTable getTable(String name, Codec keyCodec, Codec valueCodec) + throws IOException { + return getTable(name, keyCodec, valueCodec, CacheType.PARTIAL_CACHE); + } /** * Gets an existing TableStore with implicit key/value conversion and diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/ha/TestInterSCMGrpcProtocolService.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/ha/TestInterSCMGrpcProtocolService.java index 92416ca22f36..8697521f0752 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/ha/TestInterSCMGrpcProtocolService.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/ha/TestInterSCMGrpcProtocolService.java @@ -53,9 +53,10 @@ import org.apache.hadoop.hdds.security.x509.CertificateTestUtils; import org.apache.hadoop.hdds.security.x509.certificate.client.SCMCertificateClient; import org.apache.hadoop.hdds.utils.TransactionInfo; +import org.apache.hadoop.hdds.utils.db.Codec; import org.apache.hadoop.hdds.utils.db.DBCheckpoint; import org.apache.hadoop.hdds.utils.db.DBStore; -import org.apache.hadoop.hdds.utils.db.Table; +import org.apache.hadoop.hdds.utils.db.TypedTable; import org.apache.hadoop.ozone.OzoneConfigKeys; import org.apache.ozone.test.GenericTestUtils.PortAllocator; import org.junit.jupiter.api.Test; @@ -172,7 +173,7 @@ private SCMMetadataStore metadataStore() throws IOException { private DBStore dbStore() throws IOException { DBStore dbStoreMock = mock(DBStore.class); - doReturn(trInfoTable()).when(dbStoreMock).getTable(any(), any(), any()); + doReturn(trInfoTable()).when(dbStoreMock).getTable(any(), (Codec) any(), any()); doReturn(checkPoint()).when(dbStoreMock).getCheckpoint(anyBoolean()); return dbStoreMock; } @@ -186,9 +187,9 @@ private DBCheckpoint checkPoint() throws IOException { return checkpoint; } - private Table trInfoTable() + private TypedTable trInfoTable() throws IOException { - Table tableMock = mock(Table.class); + final TypedTable tableMock = mock(TypedTable.class); doReturn(mock(TransactionInfo.class)).when(tableMock).get(any()); return tableMock; } diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java index 01d187fffd69..219fa080c6c5 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OmMetadataManagerImpl.java @@ -69,6 +69,7 @@ import org.apache.hadoop.hdds.utils.TransactionInfo; import org.apache.hadoop.hdds.utils.db.BatchOperation; import org.apache.hadoop.hdds.utils.db.DBCheckpoint; +import org.apache.hadoop.hdds.utils.db.DBColumnFamilyDefinition; import org.apache.hadoop.hdds.utils.db.DBStore; import org.apache.hadoop.hdds.utils.db.DBStoreBuilder; import org.apache.hadoop.hdds.utils.db.RDBCheckpointUtils; @@ -76,6 +77,7 @@ import org.apache.hadoop.hdds.utils.db.Table; import org.apache.hadoop.hdds.utils.db.Table.KeyValue; import org.apache.hadoop.hdds.utils.db.TableIterator; +import org.apache.hadoop.hdds.utils.db.TypedTable; import org.apache.hadoop.hdds.utils.db.cache.CacheKey; import org.apache.hadoop.hdds.utils.db.cache.CacheValue; import org.apache.hadoop.hdds.utils.db.cache.TableCache.CacheType; @@ -83,6 +85,7 @@ import org.apache.hadoop.ozone.OmUtils; import org.apache.hadoop.ozone.OzoneConsts; import org.apache.hadoop.ozone.common.BlockGroup; +import org.apache.hadoop.ozone.om.codec.OMDBDefinition; import org.apache.hadoop.ozone.om.codec.TokenIdentifierCodec; import org.apache.hadoop.ozone.om.exceptions.OMException; import org.apache.hadoop.ozone.om.exceptions.OMException.ResultCodes; @@ -257,61 +260,38 @@ public class OmMetadataManagerImpl implements OMMetadataManager, public static final String COMPACTION_LOG_TABLE = "compactionLogTable"; - static final String[] ALL_TABLES = new String[] { - USER_TABLE, - VOLUME_TABLE, - BUCKET_TABLE, - KEY_TABLE, - DELETED_TABLE, - OPEN_KEY_TABLE, - MULTIPARTINFO_TABLE, - S3_SECRET_TABLE, - DELEGATION_TOKEN_TABLE, - PREFIX_TABLE, - TRANSACTION_INFO_TABLE, - DIRECTORY_TABLE, - FILE_TABLE, - DELETED_DIR_TABLE, - OPEN_FILE_TABLE, - META_TABLE, - TENANT_ACCESS_ID_TABLE, - PRINCIPAL_TO_ACCESS_IDS_TABLE, - TENANT_STATE_TABLE, - SNAPSHOT_INFO_TABLE, - SNAPSHOT_RENAMED_TABLE, - COMPACTION_LOG_TABLE - }; - private DBStore store; private final IOzoneManagerLock lock; - private Table userTable; - private Table volumeTable; - private Table bucketTable; - private Table keyTable; - private Table deletedTable; - private Table openKeyTable; - private Table multipartInfoTable; - private Table s3SecretTable; - private Table dTokenTable; - private Table prefixTable; - private Table dirTable; - private Table fileTable; - private Table openFileTable; - private Table transactionInfoTable; - private Table metaTable; + private TypedTable userTable; + private TypedTable volumeTable; + private TypedTable bucketTable; + private TypedTable keyTable; - // Tables required for multi-tenancy - private Table tenantAccessIdTable; - private Table principalToAccessIdsTable; - private Table tenantStateTable; + private TypedTable openKeyTable; + private TypedTable multipartInfoTable; + private TypedTable deletedTable; + + private TypedTable dirTable; + private TypedTable fileTable; + private TypedTable openFileTable; + private TypedTable deletedDirTable; - private Table snapshotInfoTable; - private Table snapshotRenamedTable; - private Table compactionLogTable; + private TypedTable s3SecretTable; + private TypedTable dTokenTable; + private TypedTable prefixTable; + private TypedTable transactionInfoTable; + private TypedTable metaTable; + + // Tables required for multi-tenancy + private TypedTable tenantAccessIdTable; + private TypedTable principalToAccessIdsTable; + private TypedTable tenantStateTable; - private Table deletedDirTable; + private TypedTable snapshotInfoTable; + private TypedTable snapshotRenamedTable; + private TypedTable compactionLogTable; private OzoneManager ozoneManager; @@ -506,25 +486,6 @@ public Table getMultipartInfoTable() { return multipartInfoTable; } - private void checkTableStatus(Table table, String name, - boolean addCacheMetrics) throws IOException { - String logMessage = "Unable to get a reference to %s table. Cannot " + - "continue."; - String errMsg = "Inconsistent DB state, Table - %s. Please check the logs" + - "for more info."; - if (table == null) { - LOG.error(String.format(logMessage, name)); - throw new IOException(String.format(errMsg, name)); - } - this.tableMap.put(name, table); - if (addCacheMetrics) { - if (tableCacheMetricsMap.containsKey(name)) { - tableCacheMetricsMap.get(name).unregister(); - } - tableCacheMetricsMap.put(name, table.createCacheMetrics()); - } - } - /** * Start metadata manager. */ @@ -648,110 +609,50 @@ public static DBStoreBuilder addOMTablesAndCodecs(DBStoreBuilder builder) { protected void initializeOmTables(CacheType cacheType, boolean addCacheMetrics) throws IOException { - userTable = - this.store.getTable(USER_TABLE, String.class, - PersistedUserVolumeInfo.class); - checkTableStatus(userTable, USER_TABLE, addCacheMetrics); - - volumeTable = - this.store.getTable(VOLUME_TABLE, String.class, OmVolumeArgs.class, - cacheType); - checkTableStatus(volumeTable, VOLUME_TABLE, addCacheMetrics); - - bucketTable = - this.store.getTable(BUCKET_TABLE, String.class, OmBucketInfo.class, - cacheType); - - checkTableStatus(bucketTable, BUCKET_TABLE, addCacheMetrics); - - keyTable = this.store.getTable(KEY_TABLE, String.class, OmKeyInfo.class); - checkTableStatus(keyTable, KEY_TABLE, addCacheMetrics); - - deletedTable = this.store.getTable(DELETED_TABLE, String.class, - RepeatedOmKeyInfo.class); - checkTableStatus(deletedTable, DELETED_TABLE, addCacheMetrics); - - openKeyTable = - this.store.getTable(OPEN_KEY_TABLE, String.class, - OmKeyInfo.class); - checkTableStatus(openKeyTable, OPEN_KEY_TABLE, addCacheMetrics); - - multipartInfoTable = this.store.getTable(MULTIPARTINFO_TABLE, - String.class, OmMultipartKeyInfo.class); - checkTableStatus(multipartInfoTable, MULTIPARTINFO_TABLE, addCacheMetrics); + final TableInitializer initializer = new TableInitializer(addCacheMetrics); - dTokenTable = this.store.getTable(DELEGATION_TOKEN_TABLE, - OzoneTokenIdentifier.class, Long.class); - checkTableStatus(dTokenTable, DELEGATION_TOKEN_TABLE, addCacheMetrics); + userTable = initializer.get(OMDBDefinition.USER_TABLE); - s3SecretTable = this.store.getTable(S3_SECRET_TABLE, String.class, - S3SecretValue.class); - checkTableStatus(s3SecretTable, S3_SECRET_TABLE, addCacheMetrics); + volumeTable = initializer.get(OMDBDefinition.VOLUME_TABLE, cacheType); + bucketTable = initializer.get(OMDBDefinition.BUCKET_TABLE, cacheType); + keyTable = initializer.get(OMDBDefinition.KEY_TABLE); - prefixTable = this.store.getTable(PREFIX_TABLE, String.class, - OmPrefixInfo.class); - checkTableStatus(prefixTable, PREFIX_TABLE, addCacheMetrics); + openKeyTable = initializer.get(OMDBDefinition.OPEN_KEY_TABLE); + multipartInfoTable = initializer.get(OMDBDefinition.MULTIPART_INFO_TABLE); + deletedTable = initializer.get(OMDBDefinition.DELETED_TABLE); - dirTable = this.store.getTable(DIRECTORY_TABLE, String.class, - OmDirectoryInfo.class); - checkTableStatus(dirTable, DIRECTORY_TABLE, addCacheMetrics); + dirTable = initializer.get(OMDBDefinition.DIRECTORY_TABLE); + fileTable = initializer.get(OMDBDefinition.FILE_TABLE); + openFileTable = initializer.get(OMDBDefinition.OPEN_FILE_TABLE); + deletedDirTable = initializer.get(OMDBDefinition.DELETED_DIR_TABLE); - fileTable = this.store.getTable(FILE_TABLE, String.class, - OmKeyInfo.class); - checkTableStatus(fileTable, FILE_TABLE, addCacheMetrics); + dTokenTable = initializer.get(OMDBDefinition.DELEGATION_TOKEN_TABLE); + s3SecretTable = initializer.get(OMDBDefinition.S3_SECRET_TABLE); + prefixTable = initializer.get(OMDBDefinition.PREFIX_TABLE); - openFileTable = this.store.getTable(OPEN_FILE_TABLE, String.class, - OmKeyInfo.class); - checkTableStatus(openFileTable, OPEN_FILE_TABLE, addCacheMetrics); + transactionInfoTable = initializer.get(OMDBDefinition.TRANSACTION_INFO_TABLE); - deletedDirTable = this.store.getTable(DELETED_DIR_TABLE, String.class, - OmKeyInfo.class); - checkTableStatus(deletedDirTable, DELETED_DIR_TABLE, addCacheMetrics); - - transactionInfoTable = this.store.getTable(TRANSACTION_INFO_TABLE, - String.class, TransactionInfo.class); - checkTableStatus(transactionInfoTable, TRANSACTION_INFO_TABLE, - addCacheMetrics); - - metaTable = this.store.getTable(META_TABLE, String.class, String.class); - checkTableStatus(metaTable, META_TABLE, addCacheMetrics); + metaTable = initializer.get(OMDBDefinition.META_TABLE); // accessId -> OmDBAccessIdInfo (tenantId, secret, Kerberos principal) - tenantAccessIdTable = this.store.getTable(TENANT_ACCESS_ID_TABLE, - String.class, OmDBAccessIdInfo.class); - checkTableStatus(tenantAccessIdTable, TENANT_ACCESS_ID_TABLE, - addCacheMetrics); + tenantAccessIdTable = initializer.get(OMDBDefinition.TENANT_ACCESS_ID_TABLE); // User principal -> OmDBUserPrincipalInfo (a list of accessIds) - principalToAccessIdsTable = this.store.getTable( - PRINCIPAL_TO_ACCESS_IDS_TABLE, - String.class, OmDBUserPrincipalInfo.class); - checkTableStatus(principalToAccessIdsTable, PRINCIPAL_TO_ACCESS_IDS_TABLE, - addCacheMetrics); + principalToAccessIdsTable = initializer.get(OMDBDefinition.PRINCIPAL_TO_ACCESS_IDS_TABLE); // tenant name -> tenant (tenant states) - tenantStateTable = this.store.getTable(TENANT_STATE_TABLE, - String.class, OmDBTenantState.class); - checkTableStatus(tenantStateTable, TENANT_STATE_TABLE, addCacheMetrics); + tenantStateTable = initializer.get(OMDBDefinition.TENANT_STATE_TABLE); // TODO: [SNAPSHOT] Consider FULL_CACHE for snapshotInfoTable since // exclusiveSize in SnapshotInfo can be frequently updated. // path -> snapshotInfo (snapshot info for snapshot) - snapshotInfoTable = this.store.getTable(SNAPSHOT_INFO_TABLE, - String.class, SnapshotInfo.class); - checkTableStatus(snapshotInfoTable, SNAPSHOT_INFO_TABLE, addCacheMetrics); + snapshotInfoTable = initializer.get(OMDBDefinition.SNAPSHOT_INFO_TABLE); // volumeName/bucketName/objectID -> renamedKey or renamedDir - snapshotRenamedTable = this.store.getTable(SNAPSHOT_RENAMED_TABLE, - String.class, String.class); - checkTableStatus(snapshotRenamedTable, SNAPSHOT_RENAMED_TABLE, - addCacheMetrics); + snapshotRenamedTable = initializer.get(OMDBDefinition.SNAPSHOT_RENAMED_TABLE); // TODO: [SNAPSHOT] Initialize table lock for snapshotRenamedTable. - compactionLogTable = this.store.getTable(COMPACTION_LOG_TABLE, - String.class, CompactionLogEntry.class); - checkTableStatus(compactionLogTable, COMPACTION_LOG_TABLE, - addCacheMetrics); + compactionLogTable = initializer.get(OMDBDefinition.COMPACTION_LOG_TABLE); } /** @@ -2250,4 +2151,39 @@ public void deleteWithBatch(AutoCloseable batchOperator, String id) } } } + + private class TableInitializer { + private final boolean addCacheMetrics; + + TableInitializer(boolean addCacheMetrics) { + this.addCacheMetrics = addCacheMetrics; + } + + TypedTable get(DBColumnFamilyDefinition definition) + throws IOException { + return get(definition.getTable(store)); + } + + TypedTable get(DBColumnFamilyDefinition definition, CacheType cacheType) + throws IOException { + return get(definition.getTable(store, cacheType)); + } + + private TypedTable get(TypedTable table) { + Objects.requireNonNull(table, "table == null"); + final String name = table.getName(); + final Table previousTable = tableMap.put(name, table); + if (previousTable != null) { + LOG.warn("Overwriting an existing table {}: {}", name, previousTable); + } + + if (addCacheMetrics) { + final TableCacheMetrics previous = tableCacheMetricsMap.put(name, table.createCacheMetrics()); + if (previous != null) { + previous.unregister(); + } + } + return table; + } + } } diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/codec/OMDBDefinition.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/codec/OMDBDefinition.java index a529aa38e40e..b0a6f79b9489 100644 --- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/codec/OMDBDefinition.java +++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/codec/OMDBDefinition.java @@ -105,7 +105,7 @@ public final class OMDBDefinition extends DBDefinition.WithMap { OmPrefixInfo.getCodec()); public static final DBColumnFamilyDefinition - DTOKEN_TABLE = + DELEGATION_TOKEN_TABLE = new DBColumnFamilyDefinition<>( OmMetadataManagerImpl.DELEGATION_TOKEN_TABLE, TokenIdentifierCodec.get(), @@ -228,7 +228,7 @@ public final class OMDBDefinition extends DBDefinition.WithMap { DELETED_DIR_TABLE, DELETED_TABLE, DIRECTORY_TABLE, - DTOKEN_TABLE, + DELEGATION_TOKEN_TABLE, FILE_TABLE, KEY_TABLE, META_TABLE, diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmMetadataManager.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmMetadataManager.java index 0f7401fb8728..c2e8ee894d13 100644 --- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmMetadataManager.java +++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmMetadataManager.java @@ -24,6 +24,28 @@ import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_MPU_EXPIRE_THRESHOLD_DEFAULT; import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_OPEN_KEY_EXPIRE_THRESHOLD; import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_OPEN_KEY_EXPIRE_THRESHOLD_DEFAULT; +import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.BUCKET_TABLE; +import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.COMPACTION_LOG_TABLE; +import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.DELEGATION_TOKEN_TABLE; +import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.DELETED_DIR_TABLE; +import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.DELETED_TABLE; +import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.DIRECTORY_TABLE; +import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.FILE_TABLE; +import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.KEY_TABLE; +import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.META_TABLE; +import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.MULTIPARTINFO_TABLE; +import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.OPEN_FILE_TABLE; +import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.OPEN_KEY_TABLE; +import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.PREFIX_TABLE; +import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.PRINCIPAL_TO_ACCESS_IDS_TABLE; +import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.S3_SECRET_TABLE; +import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.SNAPSHOT_INFO_TABLE; +import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.SNAPSHOT_RENAMED_TABLE; +import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.TENANT_ACCESS_ID_TABLE; +import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.TENANT_STATE_TABLE; +import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.TRANSACTION_INFO_TABLE; +import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.USER_TABLE; +import static org.apache.hadoop.ozone.om.OmMetadataManagerImpl.VOLUME_TABLE; import static org.apache.hadoop.ozone.om.exceptions.OMException.ResultCodes.BUCKET_NOT_FOUND; import static org.apache.hadoop.ozone.om.exceptions.OMException.ResultCodes.VOLUME_NOT_FOUND; import static org.assertj.core.api.Assertions.assertThat; @@ -57,6 +79,7 @@ import org.apache.hadoop.hdds.utils.TransactionInfo; import org.apache.hadoop.hdds.utils.db.cache.CacheKey; import org.apache.hadoop.hdds.utils.db.cache.CacheValue; +import org.apache.hadoop.ozone.om.codec.OMDBDefinition; import org.apache.hadoop.ozone.om.exceptions.OMException; import org.apache.hadoop.ozone.om.exceptions.OMException.ResultCodes; import org.apache.hadoop.ozone.om.helpers.BucketLayout; @@ -954,12 +977,38 @@ private void addKeysToOM(String volumeName, String bucketName, } } + static final String[] ALL_TABLES = new String[] { + USER_TABLE, + VOLUME_TABLE, + BUCKET_TABLE, + KEY_TABLE, + DELETED_TABLE, + OPEN_KEY_TABLE, + MULTIPARTINFO_TABLE, + S3_SECRET_TABLE, + DELEGATION_TOKEN_TABLE, + PREFIX_TABLE, + TRANSACTION_INFO_TABLE, + DIRECTORY_TABLE, + FILE_TABLE, + DELETED_DIR_TABLE, + OPEN_FILE_TABLE, + META_TABLE, + TENANT_ACCESS_ID_TABLE, + PRINCIPAL_TO_ACCESS_IDS_TABLE, + TENANT_STATE_TABLE, + SNAPSHOT_INFO_TABLE, + SNAPSHOT_RENAMED_TABLE, + COMPACTION_LOG_TABLE + }; + @Test public void testAllTablesAreProperInOMMetadataManagerImpl() { - Set tablesByDefinition = - new HashSet<>(Arrays.asList(OmMetadataManagerImpl.ALL_TABLES)); - Set tablesInManager = omMetadataManager.listTableNames(); + final Set expected = new HashSet<>(Arrays.asList(ALL_TABLES)); + final Set tablesByDefinition = new HashSet<>(OMDBDefinition.get().getColumnFamilyNames()); + assertEquals(expected, tablesByDefinition); + final Set tablesInManager = omMetadataManager.listTableNames(); assertEquals(tablesByDefinition, tablesInManager); } diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshotManager.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshotManager.java index 7cb1e2e38ab8..0c061ba2aac9 100644 --- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshotManager.java +++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshotManager.java @@ -66,7 +66,7 @@ import org.apache.hadoop.hdds.utils.db.DBStore; import org.apache.hadoop.hdds.utils.db.RDBBatchOperation; import org.apache.hadoop.hdds.utils.db.RDBStore; -import org.apache.hadoop.hdds.utils.db.Table; +import org.apache.hadoop.hdds.utils.db.TypedTable; import org.apache.hadoop.ozone.om.exceptions.OMException; import org.apache.hadoop.ozone.om.helpers.OmBucketInfo; import org.apache.hadoop.ozone.om.helpers.OmVolumeArgs; @@ -128,8 +128,7 @@ void stop() { public void testSnapshotFeatureFlagSafetyCheck() throws IOException { // Verify that the snapshot feature config safety check method // is returning the expected value. - - Table snapshotInfoTable = mock(Table.class); + final TypedTable snapshotInfoTable = mock(TypedTable.class); HddsWhiteboxTestUtils.setInternalState( om.getMetadataManager(), SNAPSHOT_INFO_TABLE, snapshotInfoTable); @@ -147,9 +146,9 @@ public void testCloseOnEviction() throws IOException, GenericTestUtils.setLogLevel(RDBStore.class, Level.DEBUG); LogCapturer logCapture = LogCapturer.captureLogs(RDBStore.class); // set up db tables - Table volumeTable = mock(Table.class); - Table bucketTable = mock(Table.class); - Table snapshotInfoTable = mock(Table.class); + final TypedTable volumeTable = mock(TypedTable.class); + final TypedTable bucketTable = mock(TypedTable.class); + final TypedTable snapshotInfoTable = mock(TypedTable.class); HddsWhiteboxTestUtils.setInternalState( om.getMetadataManager(), VOLUME_TABLE, volumeTable); HddsWhiteboxTestUtils.setInternalState( @@ -655,9 +654,9 @@ void testProcessFileWithDestDirParameter(@TempDir File testDir) throws IOExcepti public void testCreateSnapshotIdempotent() throws Exception { // set up db tables LogCapturer logCapturer = LogCapturer.captureLogs(OmSnapshotManager.class); - Table volumeTable = mock(Table.class); - Table bucketTable = mock(Table.class); - Table snapshotInfoTable = mock(Table.class); + final TypedTable volumeTable = mock(TypedTable.class); + final TypedTable bucketTable = mock(TypedTable.class); + final TypedTable snapshotInfoTable = mock(TypedTable.class); HddsWhiteboxTestUtils.setInternalState( om.getMetadataManager(), VOLUME_TABLE, volumeTable); HddsWhiteboxTestUtils.setInternalState( From a3b572eb7c81b2f5c4e7391146148c8944067630 Mon Sep 17 00:00:00 2001 From: Chia-Chuan Yu Date: Mon, 28 Apr 2025 18:21:48 +0800 Subject: [PATCH 16/26] Removed timeout annotations --- .../java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java | 1 - .../hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFso.java | 3 +++ .../snapshot/TestOmSnapshotFileSystemFsoWithLinkedBuckets.java | 3 +++ .../ozone/om/snapshot/TestOmSnapshotFileSystemLegacy.java | 3 +++ .../TestOmSnapshotFileSystemLegacyWithLinkedBuckets.java | 3 +++ .../ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLib.java | 3 +++ .../TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets.java | 3 +++ .../hadoop/ozone/om/snapshot/TestOmSnapshotObjectStore.java | 3 +++ .../snapshot/TestOmSnapshotObjectStoreWithLinkedBuckets.java | 3 +++ .../om/snapshot/TestOmSnapshotWithBucketLinkingLegacy.java | 3 +++ .../om/snapshot/TestOmSnapshotWithoutBucketLinkingLegacy.java | 3 +++ 11 files changed, 30 insertions(+), 1 deletion(-) diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java index a8d3e6b62be0..2466614d4370 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java @@ -29,7 +29,6 @@ import java.util.List; import java.util.Map; import java.util.UUID; -import java.util.concurrent.TimeUnit; import org.apache.hadoop.hdds.client.ReplicationFactor; import org.apache.hadoop.hdds.client.ReplicationType; import org.apache.hadoop.hdds.conf.OzoneConfiguration; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFso.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFso.java index 2f166bea0220..5f010285bc9d 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFso.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFso.java @@ -17,9 +17,12 @@ package org.apache.hadoop.ozone.om.snapshot; +import org.junit.jupiter.api.Timeout; + /** * OmSnapshot file system tests for FSO. */ +@Timeout(120) public class TestOmSnapshotFileSystemFso extends TestOmSnapshotFileSystem { TestOmSnapshotFileSystemFso() throws Exception { super(BUCKET_NAME_FSO, false); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFsoWithLinkedBuckets.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFsoWithLinkedBuckets.java index 05b665458543..0575a6c96fb5 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFsoWithLinkedBuckets.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFsoWithLinkedBuckets.java @@ -17,9 +17,12 @@ package org.apache.hadoop.ozone.om.snapshot; +import org.junit.jupiter.api.Timeout; + /** * OmSnapshot file system tests for FSO. */ +@Timeout(120) public class TestOmSnapshotFileSystemFsoWithLinkedBuckets extends TestOmSnapshotFileSystem { TestOmSnapshotFileSystemFsoWithLinkedBuckets() throws Exception { super(BUCKET_NAME_FSO, true); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacy.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacy.java index 0266049394fa..be20cdf3fb12 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacy.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacy.java @@ -17,9 +17,12 @@ package org.apache.hadoop.ozone.om.snapshot; +import org.junit.jupiter.api.Timeout; + /** * OmSnapshot file system tests for Legacy. */ +@Timeout(120) public class TestOmSnapshotFileSystemLegacy extends TestOmSnapshotFileSystem { TestOmSnapshotFileSystemLegacy() throws Exception { super(BUCKET_NAME_LEGACY, false); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacyWithLinkedBuckets.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacyWithLinkedBuckets.java index e8935ecb9c28..647c4392c740 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacyWithLinkedBuckets.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacyWithLinkedBuckets.java @@ -17,9 +17,12 @@ package org.apache.hadoop.ozone.om.snapshot; +import org.junit.jupiter.api.Timeout; + /** * OmSnapshot file system tests for Legacy. */ +@Timeout(120) public class TestOmSnapshotFileSystemLegacyWithLinkedBuckets extends TestOmSnapshotFileSystem { TestOmSnapshotFileSystemLegacyWithLinkedBuckets() throws Exception { super(BUCKET_NAME_LEGACY, true); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLib.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLib.java index 149527f6f7bb..0eb5b103fb6b 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLib.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLib.java @@ -19,9 +19,12 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.FILE_SYSTEM_OPTIMIZED; +import org.junit.jupiter.api.Timeout; + /** * Test OmSnapshot for FSO bucket type when native lib is disabled. */ +@Timeout(300) public class TestOmSnapshotFsoWithoutNativeLib extends TestOmSnapshot { public TestOmSnapshotFsoWithoutNativeLib() throws Exception { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets.java index 4d58158fb2ac..c7a1a609380d 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets.java @@ -19,9 +19,12 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.FILE_SYSTEM_OPTIMIZED; +import org.junit.jupiter.api.Timeout; + /** * Test OmSnapshot for FSO bucket type when native lib is disabled. */ +@Timeout(300) public class TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets extends TestOmSnapshot { public TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets() throws Exception { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStore.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStore.java index 723e752eb30e..8781d1c48419 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStore.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStore.java @@ -19,9 +19,12 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.OBJECT_STORE; +import org.junit.jupiter.api.Timeout; + /** * Test OmSnapshot for Object Store bucket type. */ +@Timeout(300) public class TestOmSnapshotObjectStore extends TestOmSnapshot { public TestOmSnapshotObjectStore() throws Exception { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStoreWithLinkedBuckets.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStoreWithLinkedBuckets.java index ca264dae8909..22a9c8af1f14 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStoreWithLinkedBuckets.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStoreWithLinkedBuckets.java @@ -19,9 +19,12 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.OBJECT_STORE; +import org.junit.jupiter.api.Timeout; + /** * Test OmSnapshot for Object Store bucket type. */ +@Timeout(300) public class TestOmSnapshotObjectStoreWithLinkedBuckets extends TestOmSnapshot { public TestOmSnapshotObjectStoreWithLinkedBuckets() throws Exception { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithBucketLinkingLegacy.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithBucketLinkingLegacy.java index 62bc2d678871..ae994e5dfc8c 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithBucketLinkingLegacy.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithBucketLinkingLegacy.java @@ -19,9 +19,12 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.LEGACY; +import org.junit.jupiter.api.Timeout; + /** * Test OmSnapshot for Legacy bucket type. */ +@Timeout(300) public class TestOmSnapshotWithBucketLinkingLegacy extends TestOmSnapshot { public TestOmSnapshotWithBucketLinkingLegacy() throws Exception { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithoutBucketLinkingLegacy.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithoutBucketLinkingLegacy.java index ee301b4d76ac..ad1e5ade825d 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithoutBucketLinkingLegacy.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithoutBucketLinkingLegacy.java @@ -19,9 +19,12 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.LEGACY; +import org.junit.jupiter.api.Timeout; + /** * Test OmSnapshot for Legacy bucket type. */ +@Timeout(300) public class TestOmSnapshotWithoutBucketLinkingLegacy extends TestOmSnapshot { public TestOmSnapshotWithoutBucketLinkingLegacy() throws Exception { From 948e4a6d3cec21c443da5102d4c5834956d73d66 Mon Sep 17 00:00:00 2001 From: Chia-Chuan Yu Date: Mon, 28 Apr 2025 18:40:26 +0800 Subject: [PATCH 17/26] Restore to pass PMD --- .../container/common/volume/TestStorageVolumeChecker.java | 2 ++ .../ozone/container/common/volume/TestVolumeSetDiskChecks.java | 2 ++ .../container/keyvalue/TestKeyValueContainerMarkUnhealthy.java | 2 ++ .../java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java | 2 ++ .../java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java | 3 +++ .../java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java | 2 ++ .../src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java | 2 ++ .../org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java | 2 ++ .../org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java | 2 ++ .../apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java | 2 ++ 10 files changed, 21 insertions(+) diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java index bbcf50a6e1c8..424de5d78651 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java @@ -59,6 +59,7 @@ import org.apache.hadoop.util.FakeTimer; import org.apache.ozone.test.GenericTestUtils; import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -69,6 +70,7 @@ /** * Tests for {@link StorageVolumeChecker}. */ +@Timeout(300) public class TestStorageVolumeChecker { private static final Logger LOG = LoggerFactory.getLogger( TestStorageVolumeChecker.class); diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java index a88cc818770c..137537b711d4 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java @@ -64,6 +64,7 @@ import org.apache.hadoop.util.Timer; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -72,6 +73,7 @@ * Verify that {@link MutableVolumeSet} correctly checks for failed disks * during initialization. */ +@Timeout(300) public class TestVolumeSetDiskChecks { @TempDir private Path tempDir; diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerMarkUnhealthy.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerMarkUnhealthy.java index 85c9f574b525..06f56a192d34 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerMarkUnhealthy.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerMarkUnhealthy.java @@ -41,6 +41,7 @@ import org.apache.hadoop.ozone.container.common.volume.RoundRobinVolumeChoosingPolicy; import org.apache.hadoop.ozone.container.common.volume.VolumeSet; import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,6 +50,7 @@ * Tests unhealthy container functionality in the {@link KeyValueContainer} * class. */ +@Timeout(600) public class TestKeyValueContainerMarkUnhealthy { private static final Logger LOG = LoggerFactory.getLogger( TestKeyValueContainerMarkUnhealthy.class); diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java index fe3b6d9d4a30..d1335ae41c58 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java @@ -40,12 +40,14 @@ import org.apache.hadoop.net.NetUtils; import org.apache.hadoop.test.PathUtils; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Unit tests for {@link HddsServerUtil}. */ +@Timeout(300) public class TestHddsServerUtils { private static final Logger LOG = LoggerFactory.getLogger( TestHddsServerUtils.class); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java index 2466614d4370..439bbb114001 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java @@ -29,6 +29,7 @@ import java.util.List; import java.util.Map; import java.util.UUID; +import java.util.concurrent.TimeUnit; import org.apache.hadoop.hdds.client.ReplicationFactor; import org.apache.hadoop.hdds.client.ReplicationType; import org.apache.hadoop.hdds.conf.OzoneConfiguration; @@ -49,11 +50,13 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; /** * Test cases for ContainerMapper. */ +@Timeout(value = 300, unit = TimeUnit.SECONDS) public class TestContainerMapper { @TempDir private static Path dbPath; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java index 93dad64a4a67..fe02eaf6642a 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java @@ -92,6 +92,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.rocksdb.RocksDB; import org.rocksdb.RocksDBException; @@ -101,6 +102,7 @@ /** * Tests the Ratis snapshots feature in OM. */ +@Timeout(5000) public class TestOMRatisSnapshots { // tried up to 1000 snapshots and this test works, but some of the // timeouts have to be increased. diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java index 0b9915d11973..2e281f506c2c 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java @@ -26,10 +26,12 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; /** * Test Ozone Manager Init. */ +@Timeout(300) public class TestOmInit { private static MiniOzoneCluster cluster = null; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java index 38d237829265..594f5cd47e25 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java @@ -59,6 +59,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -71,6 +72,7 @@ * TODO: HDDS-6338. Add a Kerberized version of this * TODO: HDDS-6336. Add a mock Ranger server to test Ranger HTTP endpoint calls */ +@Timeout(300) public class TestOzoneTenantShell { private static final Logger LOG = diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java index 255b9c5b4b91..e76657b07cbc 100644 --- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java +++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java @@ -22,12 +22,14 @@ import org.apache.hadoop.hdds.conf.OzoneConfiguration; import org.apache.hadoop.ozone.protocolPB.OzoneManagerProtocolServerSideTranslatorPB; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Tests for GrpcOzoneManagerServer. */ +@Timeout(30) public class TestGrpcOzoneManagerServer { private static final Logger LOG = LoggerFactory.getLogger(TestGrpcOzoneManagerServer.class); diff --git a/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java b/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java index 33f3be12b873..93f321282118 100644 --- a/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java +++ b/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java @@ -33,12 +33,14 @@ import org.apache.hadoop.security.UserGroupInformation; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Tests for GrpcOmTransport. */ +@Timeout(3000) public class TestGrpcOmTransport { private static final Logger LOG = From 18978aaef81a3cacf914f3f9ce1b22e9b615967c Mon Sep 17 00:00:00 2001 From: Chia-Chuan Yu Date: Tue, 29 Apr 2025 21:00:37 +0800 Subject: [PATCH 18/26] Removed the leftovers --- .../ozone/container/common/volume/TestStorageVolumeChecker.java | 2 -- .../ozone/container/common/volume/TestVolumeSetDiskChecks.java | 2 +- .../container/keyvalue/TestKeyValueContainerMarkUnhealthy.java | 2 -- .../java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java | 2 -- .../java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java | 2 -- .../java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java | 2 -- .../src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java | 2 -- .../org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java | 2 -- .../org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java | 2 -- .../org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java | 2 -- 10 files changed, 1 insertion(+), 19 deletions(-) diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java index 424de5d78651..bbcf50a6e1c8 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java @@ -59,7 +59,6 @@ import org.apache.hadoop.util.FakeTimer; import org.apache.ozone.test.GenericTestUtils; import org.junit.jupiter.api.TestInfo; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -70,7 +69,6 @@ /** * Tests for {@link StorageVolumeChecker}. */ -@Timeout(300) public class TestStorageVolumeChecker { private static final Logger LOG = LoggerFactory.getLogger( TestStorageVolumeChecker.class); diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java index 137537b711d4..85e5fe1580cc 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java @@ -73,7 +73,7 @@ * Verify that {@link MutableVolumeSet} correctly checks for failed disks * during initialization. */ -@Timeout(300) +@Timeout(30) public class TestVolumeSetDiskChecks { @TempDir private Path tempDir; diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerMarkUnhealthy.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerMarkUnhealthy.java index 06f56a192d34..85c9f574b525 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerMarkUnhealthy.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerMarkUnhealthy.java @@ -41,7 +41,6 @@ import org.apache.hadoop.ozone.container.common.volume.RoundRobinVolumeChoosingPolicy; import org.apache.hadoop.ozone.container.common.volume.VolumeSet; import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -50,7 +49,6 @@ * Tests unhealthy container functionality in the {@link KeyValueContainer} * class. */ -@Timeout(600) public class TestKeyValueContainerMarkUnhealthy { private static final Logger LOG = LoggerFactory.getLogger( TestKeyValueContainerMarkUnhealthy.class); diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java index d1335ae41c58..fe3b6d9d4a30 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java @@ -40,14 +40,12 @@ import org.apache.hadoop.net.NetUtils; import org.apache.hadoop.test.PathUtils; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Unit tests for {@link HddsServerUtil}. */ -@Timeout(300) public class TestHddsServerUtils { private static final Logger LOG = LoggerFactory.getLogger( TestHddsServerUtils.class); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java index 439bbb114001..a8d3e6b62be0 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java @@ -50,13 +50,11 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; /** * Test cases for ContainerMapper. */ -@Timeout(value = 300, unit = TimeUnit.SECONDS) public class TestContainerMapper { @TempDir private static Path dbPath; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java index fe02eaf6642a..93dad64a4a67 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java @@ -92,7 +92,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.rocksdb.RocksDB; import org.rocksdb.RocksDBException; @@ -102,7 +101,6 @@ /** * Tests the Ratis snapshots feature in OM. */ -@Timeout(5000) public class TestOMRatisSnapshots { // tried up to 1000 snapshots and this test works, but some of the // timeouts have to be increased. diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java index 2e281f506c2c..0b9915d11973 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java @@ -26,12 +26,10 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test Ozone Manager Init. */ -@Timeout(300) public class TestOmInit { private static MiniOzoneCluster cluster = null; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java index 594f5cd47e25..38d237829265 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java @@ -59,7 +59,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -72,7 +71,6 @@ * TODO: HDDS-6338. Add a Kerberized version of this * TODO: HDDS-6336. Add a mock Ranger server to test Ranger HTTP endpoint calls */ -@Timeout(300) public class TestOzoneTenantShell { private static final Logger LOG = diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java index e76657b07cbc..255b9c5b4b91 100644 --- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java +++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java @@ -22,14 +22,12 @@ import org.apache.hadoop.hdds.conf.OzoneConfiguration; import org.apache.hadoop.ozone.protocolPB.OzoneManagerProtocolServerSideTranslatorPB; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Tests for GrpcOzoneManagerServer. */ -@Timeout(30) public class TestGrpcOzoneManagerServer { private static final Logger LOG = LoggerFactory.getLogger(TestGrpcOzoneManagerServer.class); diff --git a/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java b/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java index 93f321282118..33f3be12b873 100644 --- a/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java +++ b/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java @@ -33,14 +33,12 @@ import org.apache.hadoop.security.UserGroupInformation; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Tests for GrpcOmTransport. */ -@Timeout(3000) public class TestGrpcOmTransport { private static final Logger LOG = From 8c86575e7c3d096e984b1a65f95cf07b4f416e2b Mon Sep 17 00:00:00 2001 From: Chia-Chuan Yu Date: Tue, 29 Apr 2025 21:04:36 +0800 Subject: [PATCH 19/26] Fixed style --- .../java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java | 1 - 1 file changed, 1 deletion(-) diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java index a8d3e6b62be0..2466614d4370 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java @@ -29,7 +29,6 @@ import java.util.List; import java.util.Map; import java.util.UUID; -import java.util.concurrent.TimeUnit; import org.apache.hadoop.hdds.client.ReplicationFactor; import org.apache.hadoop.hdds.client.ReplicationType; import org.apache.hadoop.hdds.conf.OzoneConfiguration; From 934ff12a78ab29e836bba61f5ddce325ce334912 Mon Sep 17 00:00:00 2001 From: Chia-Chuan Yu Date: Mon, 28 Apr 2025 18:21:48 +0800 Subject: [PATCH 20/26] Removed timeout annotations --- .../ozone/container/common/volume/TestVolumeSetDiskChecks.java | 2 -- .../hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFso.java | 2 -- .../snapshot/TestOmSnapshotFileSystemFsoWithLinkedBuckets.java | 2 -- .../ozone/om/snapshot/TestOmSnapshotFileSystemLegacy.java | 2 -- .../TestOmSnapshotFileSystemLegacyWithLinkedBuckets.java | 2 -- .../ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLib.java | 2 -- .../TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets.java | 2 -- .../hadoop/ozone/om/snapshot/TestOmSnapshotObjectStore.java | 2 -- .../om/snapshot/TestOmSnapshotObjectStoreWithLinkedBuckets.java | 2 -- .../om/snapshot/TestOmSnapshotWithBucketLinkingLegacy.java | 2 -- .../om/snapshot/TestOmSnapshotWithoutBucketLinkingLegacy.java | 2 -- 11 files changed, 22 deletions(-) diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java index 85e5fe1580cc..a88cc818770c 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java @@ -64,7 +64,6 @@ import org.apache.hadoop.util.Timer; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -73,7 +72,6 @@ * Verify that {@link MutableVolumeSet} correctly checks for failed disks * during initialization. */ -@Timeout(30) public class TestVolumeSetDiskChecks { @TempDir private Path tempDir; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFso.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFso.java index 5f010285bc9d..4e02643ccc11 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFso.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFso.java @@ -17,12 +17,10 @@ package org.apache.hadoop.ozone.om.snapshot; -import org.junit.jupiter.api.Timeout; /** * OmSnapshot file system tests for FSO. */ -@Timeout(120) public class TestOmSnapshotFileSystemFso extends TestOmSnapshotFileSystem { TestOmSnapshotFileSystemFso() throws Exception { super(BUCKET_NAME_FSO, false); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFsoWithLinkedBuckets.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFsoWithLinkedBuckets.java index 0575a6c96fb5..96cc7d24f47b 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFsoWithLinkedBuckets.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFsoWithLinkedBuckets.java @@ -17,12 +17,10 @@ package org.apache.hadoop.ozone.om.snapshot; -import org.junit.jupiter.api.Timeout; /** * OmSnapshot file system tests for FSO. */ -@Timeout(120) public class TestOmSnapshotFileSystemFsoWithLinkedBuckets extends TestOmSnapshotFileSystem { TestOmSnapshotFileSystemFsoWithLinkedBuckets() throws Exception { super(BUCKET_NAME_FSO, true); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacy.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacy.java index be20cdf3fb12..d6a2750704c3 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacy.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacy.java @@ -17,12 +17,10 @@ package org.apache.hadoop.ozone.om.snapshot; -import org.junit.jupiter.api.Timeout; /** * OmSnapshot file system tests for Legacy. */ -@Timeout(120) public class TestOmSnapshotFileSystemLegacy extends TestOmSnapshotFileSystem { TestOmSnapshotFileSystemLegacy() throws Exception { super(BUCKET_NAME_LEGACY, false); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacyWithLinkedBuckets.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacyWithLinkedBuckets.java index 647c4392c740..eb6d71e73a9b 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacyWithLinkedBuckets.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacyWithLinkedBuckets.java @@ -17,12 +17,10 @@ package org.apache.hadoop.ozone.om.snapshot; -import org.junit.jupiter.api.Timeout; /** * OmSnapshot file system tests for Legacy. */ -@Timeout(120) public class TestOmSnapshotFileSystemLegacyWithLinkedBuckets extends TestOmSnapshotFileSystem { TestOmSnapshotFileSystemLegacyWithLinkedBuckets() throws Exception { super(BUCKET_NAME_LEGACY, true); diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLib.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLib.java index 0eb5b103fb6b..6244efc2c816 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLib.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLib.java @@ -19,12 +19,10 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.FILE_SYSTEM_OPTIMIZED; -import org.junit.jupiter.api.Timeout; /** * Test OmSnapshot for FSO bucket type when native lib is disabled. */ -@Timeout(300) public class TestOmSnapshotFsoWithoutNativeLib extends TestOmSnapshot { public TestOmSnapshotFsoWithoutNativeLib() throws Exception { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets.java index c7a1a609380d..ec53c91e11ef 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets.java @@ -19,12 +19,10 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.FILE_SYSTEM_OPTIMIZED; -import org.junit.jupiter.api.Timeout; /** * Test OmSnapshot for FSO bucket type when native lib is disabled. */ -@Timeout(300) public class TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets extends TestOmSnapshot { public TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets() throws Exception { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStore.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStore.java index 8781d1c48419..81e4a7d7e670 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStore.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStore.java @@ -19,12 +19,10 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.OBJECT_STORE; -import org.junit.jupiter.api.Timeout; /** * Test OmSnapshot for Object Store bucket type. */ -@Timeout(300) public class TestOmSnapshotObjectStore extends TestOmSnapshot { public TestOmSnapshotObjectStore() throws Exception { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStoreWithLinkedBuckets.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStoreWithLinkedBuckets.java index 22a9c8af1f14..b6c734f57a1f 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStoreWithLinkedBuckets.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStoreWithLinkedBuckets.java @@ -19,12 +19,10 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.OBJECT_STORE; -import org.junit.jupiter.api.Timeout; /** * Test OmSnapshot for Object Store bucket type. */ -@Timeout(300) public class TestOmSnapshotObjectStoreWithLinkedBuckets extends TestOmSnapshot { public TestOmSnapshotObjectStoreWithLinkedBuckets() throws Exception { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithBucketLinkingLegacy.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithBucketLinkingLegacy.java index ae994e5dfc8c..342210e125ee 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithBucketLinkingLegacy.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithBucketLinkingLegacy.java @@ -19,12 +19,10 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.LEGACY; -import org.junit.jupiter.api.Timeout; /** * Test OmSnapshot for Legacy bucket type. */ -@Timeout(300) public class TestOmSnapshotWithBucketLinkingLegacy extends TestOmSnapshot { public TestOmSnapshotWithBucketLinkingLegacy() throws Exception { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithoutBucketLinkingLegacy.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithoutBucketLinkingLegacy.java index ad1e5ade825d..1dc4489b0633 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithoutBucketLinkingLegacy.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithoutBucketLinkingLegacy.java @@ -19,12 +19,10 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.LEGACY; -import org.junit.jupiter.api.Timeout; /** * Test OmSnapshot for Legacy bucket type. */ -@Timeout(300) public class TestOmSnapshotWithoutBucketLinkingLegacy extends TestOmSnapshot { public TestOmSnapshotWithoutBucketLinkingLegacy() throws Exception { From 86cb59d3858f339ea4803c2edaf786434b6e74ee Mon Sep 17 00:00:00 2001 From: Chia-Chuan Yu Date: Tue, 29 Apr 2025 21:00:37 +0800 Subject: [PATCH 21/26] Cherry pick back --- .../volume/TestStorageVolumeChecker.java | 52 +++++++++++-------- .../volume/TestVolumeSetDiskChecks.java | 2 - .../TestKeyValueContainerMarkUnhealthy.java | 2 - .../hadoop/hdds/scm/TestHddsServerUtils.java | 6 ++- .../ozone/fsck/TestContainerMapper.java | 2 - .../hadoop/ozone/om/TestOMRatisSnapshots.java | 2 - .../apache/hadoop/ozone/om/TestOmInit.java | 2 - .../ozone/shell/TestOzoneTenantShell.java | 2 - .../ozone/om/TestGrpcOzoneManagerServer.java | 6 ++- .../ozone/protocolPB/TestGrpcOmTransport.java | 6 ++- 10 files changed, 42 insertions(+), 40 deletions(-) diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java index 7177eb914aa7..bbcf50a6e1c8 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java @@ -34,7 +34,6 @@ import java.nio.file.Path; import java.time.Duration; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.Optional; import java.util.Set; @@ -59,7 +58,7 @@ import org.apache.hadoop.util.DiskChecker.DiskErrorException; import org.apache.hadoop.util.FakeTimer; import org.apache.ozone.test.GenericTestUtils; -import org.junit.jupiter.api.Timeout; +import org.junit.jupiter.api.TestInfo; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -70,7 +69,6 @@ /** * Tests for {@link StorageVolumeChecker}. */ -@Timeout(300) public class TestStorageVolumeChecker { private static final Logger LOG = LoggerFactory.getLogger( TestStorageVolumeChecker.class); @@ -87,8 +85,12 @@ public class TestStorageVolumeChecker { */ private VolumeCheckResult expectedVolumeHealth; - private void initTest(VolumeCheckResult result) { + private ContainerLayoutVersion layoutVersion; + + private void initTest(VolumeCheckResult result, + ContainerLayoutVersion layout) { this.expectedVolumeHealth = result; + this.layoutVersion = layout; setup(); } @@ -102,19 +104,13 @@ private void setup() { * Run each test case for each possible value of {@link VolumeCheckResult}. * Including "null" for 'throw exception'. */ - private static List volumeCheckResults() { - List list = new ArrayList<>(Arrays.asList(VolumeCheckResult.values())); - list.add(null); - return list; - } - private static List provideTestData() { - List volumeCheckResults = volumeCheckResults(); List values = new ArrayList<>(); for (ContainerLayoutVersion layout : ContainerLayoutVersion.values()) { - for (VolumeCheckResult result : volumeCheckResults) { + for (VolumeCheckResult result : VolumeCheckResult.values()) { values.add(Arguments.of(result, layout)); } + values.add(Arguments.of(null, layout)); } return values; } @@ -123,18 +119,23 @@ private static List provideTestData() { /** * Test {@link StorageVolumeChecker#checkVolume} propagates the * check to the delegate checker. + * + * @throws Exception */ @ParameterizedTest - @MethodSource("volumeCheckResults") - public void testCheckOneVolume(VolumeCheckResult checkResult) throws Exception { - initTest(checkResult); + @MethodSource("provideTestData") + public void testCheckOneVolume( + VolumeCheckResult checkResult, ContainerLayoutVersion layout, + TestInfo testInfo) throws Exception { + initTest(checkResult, layout); + LOG.info("Executing {}", testInfo.getTestMethod()); final HddsVolume volume = makeVolumes(1, expectedVolumeHealth).get(0); final StorageVolumeChecker checker = new StorageVolumeChecker(new OzoneConfiguration(), new FakeTimer(), ""); checker.setDelegateChecker(new DummyChecker()); final AtomicLong numCallbackInvocations = new AtomicLong(0); - /* + /** * Request a check and ensure it triggered {@link HddsVolume#check}. */ boolean result = @@ -164,11 +165,15 @@ public void testCheckOneVolume(VolumeCheckResult checkResult) throws Exception { /** * Test {@link StorageVolumeChecker#checkAllVolumes} propagates * checks for all volumes to the delegate checker. + * + * @throws Exception */ @ParameterizedTest - @MethodSource("volumeCheckResults") - public void testCheckAllVolumes(VolumeCheckResult checkResult) throws Exception { - initTest(checkResult); + @MethodSource("provideTestData") + public void testCheckAllVolumes(VolumeCheckResult checkResult, + ContainerLayoutVersion layout, TestInfo testInfo) throws Exception { + initTest(checkResult, layout); + LOG.info("Executing {}", testInfo.getTestMethod()); final List volumes = makeVolumes( NUM_VOLUMES, expectedVolumeHealth); @@ -198,12 +203,15 @@ public void testCheckAllVolumes(VolumeCheckResult checkResult) throws Exception /** * Test {@link StorageVolumeChecker#checkAllVolumes} propagates * checks for all volumes to the delegate checker. + * + * @throws Exception */ @ParameterizedTest @MethodSource("provideTestData") public void testVolumeDeletion(VolumeCheckResult checkResult, - ContainerLayoutVersion layout) throws Exception { - initTest(checkResult); + ContainerLayoutVersion layout, TestInfo testInfo) throws Exception { + initTest(checkResult, layout); + LOG.info("Executing {}", testInfo.getTestMethod()); DatanodeConfiguration dnConf = conf.getObject(DatanodeConfiguration.class); @@ -270,7 +278,7 @@ public Optional> schedule( return Optional.of( Futures.immediateFuture(target.check(context))); } catch (Exception e) { - LOG.info("check routine threw exception", e); + LOG.info("check routine threw exception {}", e); return Optional.of(Futures.immediateFailedFuture(e)); } } diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java index 5d65eae81af2..e310eaf3dea7 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestVolumeSetDiskChecks.java @@ -64,14 +64,12 @@ import org.apache.hadoop.util.Timer; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; /** * Verify that {@link MutableVolumeSet} correctly checks for failed disks * during initialization. */ -@Timeout(30) public class TestVolumeSetDiskChecks { @TempDir private Path tempDir; diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerMarkUnhealthy.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerMarkUnhealthy.java index 952d19400861..63459f7c12f7 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerMarkUnhealthy.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerMarkUnhealthy.java @@ -41,14 +41,12 @@ import org.apache.hadoop.ozone.container.common.volume.RoundRobinVolumeChoosingPolicy; import org.apache.hadoop.ozone.container.common.volume.VolumeSet; import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; /** * Tests unhealthy container functionality in the {@link KeyValueContainer} * class. */ -@Timeout(600) public class TestKeyValueContainerMarkUnhealthy { @TempDir diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java index 81cb041fd4f4..fe3b6d9d4a30 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java @@ -40,13 +40,15 @@ import org.apache.hadoop.net.NetUtils; import org.apache.hadoop.test.PathUtils; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Unit tests for {@link HddsServerUtil}. */ -@Timeout(300) public class TestHddsServerUtils { + private static final Logger LOG = LoggerFactory.getLogger( + TestHddsServerUtils.class); /** * Test getting OZONE_SCM_DATANODE_ADDRESS_KEY with port. diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java index ff40330a63ec..5dfae419322c 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/fsck/TestContainerMapper.java @@ -48,13 +48,11 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; /** * Test cases for ContainerMapper. */ -@Timeout(value = 300, unit = TimeUnit.SECONDS) public class TestContainerMapper { @TempDir private static Path dbPath; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java index a6177ef7e92b..5afec8be6313 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMRatisSnapshots.java @@ -92,7 +92,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.rocksdb.RocksDB; import org.rocksdb.RocksDBException; @@ -102,7 +101,6 @@ /** * Tests the Ratis snapshots feature in OM. */ -@Timeout(5000) public class TestOMRatisSnapshots { // tried up to 1000 snapshots and this test works, but some of the // timeouts have to be increased. diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java index f444a3c68569..e461fc44c2a9 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmInit.java @@ -26,12 +26,10 @@ import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; /** * Test Ozone Manager Init. */ -@Timeout(300) public class TestOmInit { private static MiniOzoneCluster cluster = null; diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java index c31b2a28a70e..fd7439a3878b 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneTenantShell.java @@ -58,7 +58,6 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; import org.junit.jupiter.api.io.TempDir; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -71,7 +70,6 @@ * TODO: HDDS-6338. Add a Kerberized version of this * TODO: HDDS-6336. Add a mock Ranger server to test Ranger HTTP endpoint calls */ -@Timeout(300) public class TestOzoneTenantShell { private static final Logger LOG = diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java index b7659f776fad..255b9c5b4b91 100644 --- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java +++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java @@ -22,13 +22,15 @@ import org.apache.hadoop.hdds.conf.OzoneConfiguration; import org.apache.hadoop.ozone.protocolPB.OzoneManagerProtocolServerSideTranslatorPB; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Tests for GrpcOzoneManagerServer. */ -@Timeout(30) public class TestGrpcOzoneManagerServer { + private static final Logger LOG = + LoggerFactory.getLogger(TestGrpcOzoneManagerServer.class); private OzoneManager ozoneManager; private OzoneManagerProtocolServerSideTranslatorPB omServerProtocol; private GrpcOzoneManagerServer server; diff --git a/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java b/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java index da47fe4f8cbc..33f3be12b873 100644 --- a/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java +++ b/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java @@ -33,14 +33,16 @@ import org.apache.hadoop.security.UserGroupInformation; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.Timeout; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Tests for GrpcOmTransport. */ -@Timeout(3000) public class TestGrpcOmTransport { + private static final Logger LOG = + LoggerFactory.getLogger(TestGrpcOmTransport.class); private static OzoneConfiguration conf; @BeforeAll From b703a8a01b12e43558405f484e362352da341885 Mon Sep 17 00:00:00 2001 From: Chia-Chuan Yu Date: Tue, 29 Apr 2025 22:55:28 +0800 Subject: [PATCH 22/26] Fixed merge issues --- .../apache/hadoop/hdds/utils/db/DBStore.java | 27 ------------ .../apache/hadoop/hdds/utils/db/RDBStore.java | 10 ++--- .../snapshot/TestOmSnapshotFileSystemFso.java | 1 - ...napshotFileSystemFsoWithLinkedBuckets.java | 1 - .../TestOmSnapshotFileSystemLegacy.java | 1 - ...shotFileSystemLegacyWithLinkedBuckets.java | 1 - .../TestOmSnapshotFsoWithoutNativeLib.java | 1 - ...tFsoWithoutNativeLibWithLinkedBuckets.java | 1 - .../snapshot/TestOmSnapshotObjectStore.java | 1 - ...mSnapshotObjectStoreWithLinkedBuckets.java | 1 - ...TestOmSnapshotWithBucketLinkingLegacy.java | 1 - ...tOmSnapshotWithoutBucketLinkingLegacy.java | 1 - .../ozone/om/TestOmMetadataManager.java | 41 ++++--------------- .../parser/ContainerDatanodeDatabase.java | 17 ++++---- .../ozone/containerlog/parser/DBConsts.java | 37 ++++++++++++++++- 15 files changed, 56 insertions(+), 86 deletions(-) diff --git a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/DBStore.java b/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/DBStore.java index eae3148ae04b..0b61822fb519 100644 --- a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/DBStore.java +++ b/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/DBStore.java @@ -52,33 +52,6 @@ default TypedTable getTable(String name, Codec key return getTable(name, keyCodec, valueCodec, CacheType.PARTIAL_CACHE); } - /** - * Gets an existing TableStore with implicit key/value conversion and - * with default cache type for cache. Default cache type is partial cache. - * - * @param name - Name of the TableStore to get - * @param keyType - * @param valueType - * @return - TableStore. - * @throws IOException on Failure - */ - Table getTable(String name, - Class keyType, Class valueType) throws IOException; - - /** - * Gets an existing TableStore with implicit key/value conversion and - * with specified cache type. - * @param name - Name of the TableStore to get - * @param keyType - * @param valueType - * @param cacheType - * @return - TableStore. - * @throws IOException - */ - Table getTable(String name, - Class keyType, Class valueType, - TableCache.CacheType cacheType) throws IOException; - /** * Gets table store with implict key/value conversion. * diff --git a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RDBStore.java b/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RDBStore.java index 491f8ff54192..d6168aee5413 100644 --- a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RDBStore.java +++ b/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RDBStore.java @@ -243,7 +243,7 @@ public void close() throws IOException { @Override public void move(K key, Table source, - Table dest) throws IOException { + Table dest) throws IOException { try (BatchOperation batchOperation = initBatchOperation()) { V value = source.get(key); @@ -255,14 +255,14 @@ public void move(K key, Table source, @Override public void move(K key, V value, Table source, - Table dest) throws IOException { + Table dest) throws IOException { move(key, key, value, source, dest); } @Override public void move(K sourceKey, K destKey, V value, - Table source, - Table dest) throws IOException { + Table source, + Table dest) throws IOException { try (BatchOperation batchOperation = initBatchOperation()) { dest.putWithBatch(batchOperation, destKey, value); source.deleteWithBatch(batchOperation, sourceKey); @@ -372,7 +372,7 @@ public DBUpdatesWrapper getUpdatesSince(long sequenceNumber, long limitCount) long cumulativeDBUpdateLogBatchSize = 0L; DBUpdatesWrapper dbUpdatesWrapper = new DBUpdatesWrapper(); try (ManagedTransactionLogIterator logIterator = - db.getUpdatesSince(sequenceNumber)) { + db.getUpdatesSince(sequenceNumber)) { // If Recon's sequence number is out-of-date and the iterator is invalid, // throw SNNFE and let Recon fall back to full snapshot. diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFso.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFso.java index 4e02643ccc11..2f166bea0220 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFso.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFso.java @@ -17,7 +17,6 @@ package org.apache.hadoop.ozone.om.snapshot; - /** * OmSnapshot file system tests for FSO. */ diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFsoWithLinkedBuckets.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFsoWithLinkedBuckets.java index 96cc7d24f47b..05b665458543 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFsoWithLinkedBuckets.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemFsoWithLinkedBuckets.java @@ -17,7 +17,6 @@ package org.apache.hadoop.ozone.om.snapshot; - /** * OmSnapshot file system tests for FSO. */ diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacy.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacy.java index d6a2750704c3..0266049394fa 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacy.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacy.java @@ -17,7 +17,6 @@ package org.apache.hadoop.ozone.om.snapshot; - /** * OmSnapshot file system tests for Legacy. */ diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacyWithLinkedBuckets.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacyWithLinkedBuckets.java index eb6d71e73a9b..e8935ecb9c28 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacyWithLinkedBuckets.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFileSystemLegacyWithLinkedBuckets.java @@ -17,7 +17,6 @@ package org.apache.hadoop.ozone.om.snapshot; - /** * OmSnapshot file system tests for Legacy. */ diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLib.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLib.java index 6244efc2c816..149527f6f7bb 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLib.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLib.java @@ -19,7 +19,6 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.FILE_SYSTEM_OPTIMIZED; - /** * Test OmSnapshot for FSO bucket type when native lib is disabled. */ diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets.java index ec53c91e11ef..4d58158fb2ac 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithoutNativeLibWithLinkedBuckets.java @@ -19,7 +19,6 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.FILE_SYSTEM_OPTIMIZED; - /** * Test OmSnapshot for FSO bucket type when native lib is disabled. */ diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStore.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStore.java index 81e4a7d7e670..723e752eb30e 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStore.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStore.java @@ -19,7 +19,6 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.OBJECT_STORE; - /** * Test OmSnapshot for Object Store bucket type. */ diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStoreWithLinkedBuckets.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStoreWithLinkedBuckets.java index b6c734f57a1f..ca264dae8909 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStoreWithLinkedBuckets.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotObjectStoreWithLinkedBuckets.java @@ -19,7 +19,6 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.OBJECT_STORE; - /** * Test OmSnapshot for Object Store bucket type. */ diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithBucketLinkingLegacy.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithBucketLinkingLegacy.java index 342210e125ee..62bc2d678871 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithBucketLinkingLegacy.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithBucketLinkingLegacy.java @@ -19,7 +19,6 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.LEGACY; - /** * Test OmSnapshot for Legacy bucket type. */ diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithoutBucketLinkingLegacy.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithoutBucketLinkingLegacy.java index 1dc4489b0633..ee301b4d76ac 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithoutBucketLinkingLegacy.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotWithoutBucketLinkingLegacy.java @@ -19,7 +19,6 @@ import static org.apache.hadoop.ozone.om.helpers.BucketLayout.LEGACY; - /** * Test OmSnapshot for Legacy bucket type. */ diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmMetadataManager.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmMetadataManager.java index 3e7b4bdbee38..d6bcd2463278 100644 --- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmMetadataManager.java +++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmMetadataManager.java @@ -720,10 +720,10 @@ public void testGetExpiredOpenKeys(BucketLayout bucketLayout) final String volumeName = UUID.randomUUID().toString(); // Add volume, bucket, key entries to DB. OMRequestTestUtils.addVolumeAndBucketToDB(volumeName, bucketName, - omMetadataManager, BucketLayout.FILE_SYSTEM_OPTIMIZED); + omMetadataManager, BucketLayout.FILE_SYSTEM_OPTIMIZED); final long volumeId = omMetadataManager.getVolumeId(volumeName); final long bucketId = omMetadataManager.getBucketId(volumeName, - bucketName); + bucketName); final int numExpiredOpenKeys = 4; final int numUnexpiredOpenKeys = 1; final long clientID = 1000L; @@ -990,7 +990,7 @@ private List getMultipartKeyNames( } private void addKeysToOM(String volumeName, String bucketName, - String keyName, int i) throws Exception { + String keyName, int i) throws Exception { if (i % 2 == 0) { OMRequestTestUtils.addKeyToTable(false, volumeName, bucketName, keyName, @@ -1002,31 +1002,6 @@ private void addKeysToOM(String volumeName, String bucketName, } } - static final String[] ALL_TABLES = new String[] { - USER_TABLE, - VOLUME_TABLE, - BUCKET_TABLE, - KEY_TABLE, - DELETED_TABLE, - OPEN_KEY_TABLE, - MULTIPARTINFO_TABLE, - S3_SECRET_TABLE, - DELEGATION_TOKEN_TABLE, - PREFIX_TABLE, - TRANSACTION_INFO_TABLE, - DIRECTORY_TABLE, - FILE_TABLE, - DELETED_DIR_TABLE, - OPEN_FILE_TABLE, - META_TABLE, - TENANT_ACCESS_ID_TABLE, - PRINCIPAL_TO_ACCESS_IDS_TABLE, - TENANT_STATE_TABLE, - SNAPSHOT_INFO_TABLE, - SNAPSHOT_RENAMED_TABLE, - COMPACTION_LOG_TABLE - }; - @Test public void testAllTablesAreProperInOMMetadataManagerImpl() { final Set expected = new HashSet<>(Arrays.asList(ALL_TABLES)); @@ -1130,7 +1105,7 @@ private static Stream listSnapshotWithInvalidPathCases() { @Test public void testListSnapshotDoesNotListOtherBucketSnapshots() - throws Exception { + throws Exception { String vol1 = "vol1"; String bucket1 = "bucket1"; String bucket2 = "bucket2"; @@ -1143,12 +1118,12 @@ public void testListSnapshotDoesNotListOtherBucketSnapshots() for (int i = 1; i <= 2; i++) { OMRequestTestUtils.addSnapshotToTable(vol1, bucket1, - snapshotName1 + i, omMetadataManager); + snapshotName1 + i, omMetadataManager); } for (int i = 1; i <= 5; i++) { OMRequestTestUtils.addSnapshotToTable(vol1, bucket2, - snapshotName2 + i, omMetadataManager); + snapshotName2 + i, omMetadataManager); } //Test listing snapshots only lists snapshots of specified bucket @@ -1185,8 +1160,8 @@ public void testGetMultipartUploadKeys() throws Exception { // Create multipart key info OmKeyInfo keyInfo = OMRequestTestUtils.createOmKeyInfo( - volumeName, bucketName, key, - RatisReplicationConfig.getInstance(ONE)) + volumeName, bucketName, key, + RatisReplicationConfig.getInstance(ONE)) .build(); OmMultipartKeyInfo multipartKeyInfo = OMRequestTestUtils diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/containerlog/parser/ContainerDatanodeDatabase.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/containerlog/parser/ContainerDatanodeDatabase.java index 9dcf3fb71872..f07b20701949 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/containerlog/parser/ContainerDatanodeDatabase.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/containerlog/parser/ContainerDatanodeDatabase.java @@ -34,9 +34,9 @@ * Provides methods for table creation, log data insertion, and index setup. */ public class ContainerDatanodeDatabase { - + private static String databasePath; - + public static void setDatabasePath(String dbPath) { if (databasePath == null) { databasePath = dbPath; @@ -47,7 +47,7 @@ private static Connection getConnection() throws Exception { if (databasePath == null) { throw new IllegalStateException("Database path not set"); } - + Class.forName(DBConsts.DRIVER); SQLiteConfig config = new SQLiteConfig(); @@ -99,14 +99,14 @@ private void createContainerLogTable() throws SQLException { * * @param transitionList List of container log entries to insert into the table. */ - + public synchronized void insertContainerDatanodeData(List transitionList) throws SQLException { String insertSQL = DBConsts.INSERT_DATANODE_CONTAINER_LOG; long containerId = 0; String datanodeId = null; - + try (Connection connection = getConnection(); PreparedStatement preparedStatement = connection.prepareStatement(insertSQL)) { @@ -165,9 +165,9 @@ public void insertLatestContainerLogData() throws SQLException { PreparedStatement selectStmt = connection.prepareStatement(selectSQL); ResultSet resultSet = selectStmt.executeQuery(); PreparedStatement insertStmt = connection.prepareStatement(insertSQL)) { - + int count = 0; - + while (resultSet.next()) { String datanodeId = resultSet.getString("datanode_id"); long containerId = resultSet.getLong("container_id"); @@ -273,7 +273,7 @@ public void listContainersByState(String state, Integer limit) throws SQLExcepti writer.printf("%-25s | %-35s | %-15d | %-15d | %-40s | %-12d%n", timestamp, datanodeId, containerId, latestBcsid, errorMessage, indexValue); } - + if (count == 0) { writer.printf("No containers found for state: %s%n", state); } else { @@ -288,4 +288,3 @@ public void listContainersByState(String state, Integer limit) throws SQLExcepti } } } - diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/containerlog/parser/DBConsts.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/containerlog/parser/DBConsts.java index d4b3c5a32043..48c6150608c7 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/containerlog/parser/DBConsts.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/containerlog/parser/DBConsts.java @@ -22,14 +22,47 @@ */ public final class DBConsts { + public static final String DEFAULT_DB_FILENAME = "container_datanode.db"; public static final String DRIVER = "org.sqlite.JDBC"; public static final String CONNECTION_PREFIX = "jdbc:sqlite:"; - public static final String DATABASE_NAME = "container_datanode.db"; - public static final String PROPS_FILE = "container-log-db-queries.properties"; public static final int CACHE_SIZE = 1000000; public static final int BATCH_SIZE = 2500; public static final String DATANODE_CONTAINER_LOG_TABLE_NAME = "DatanodeContainerLogTable"; public static final String CONTAINER_LOG_TABLE_NAME = "ContainerLogTable"; + public static final String CREATE_DATANODE_CONTAINER_LOG_TABLE = + "CREATE TABLE IF NOT EXISTS DatanodeContainerLogTable (datanode_id TEXT NOT NULL, " + + "container_id INTEGER NOT NULL, timestamp TEXT NOT NULL, container_state TEXT, bcsid INTEGER, " + + "error_message TEXT, log_level TEXT NOT NULL," + + " index_value INTEGER);"; + public static final String CREATE_CONTAINER_LOG_TABLE = + "CREATE TABLE IF NOT EXISTS ContainerLogTable (datanode_id TEXT NOT NULL, container_id INTEGER NOT NULL," + + " latest_state TEXT, latest_bcsid INTEGER, PRIMARY KEY (datanode_id, container_id));"; + public static final String CREATE_DATANODE_CONTAINER_INDEX = + "CREATE INDEX IF NOT EXISTS idx_datanode_container ON DatanodeContainerLogTable (datanode_id," + + " container_id, timestamp);"; + public static final String INSERT_DATANODE_CONTAINER_LOG = + "INSERT INTO DatanodeContainerLogTable (datanode_id, container_id, timestamp, container_state, bcsid," + + " error_message, log_level, index_value) VALUES (?, ?, ?, ?, ?, ?, ?, ?);"; + public static final String INSERT_CONTAINER_LOG = + "INSERT OR REPLACE INTO ContainerLogTable (datanode_id, container_id, latest_state," + + " latest_bcsid) VALUES (?, ?, ?, ?);"; + public static final String SELECT_LATEST_CONTAINER_LOG = + "SELECT a.datanode_id, a.container_id, a.container_state, a.bcsid, a.timestamp FROM DatanodeContainerLogTable" + + " AS a JOIN (SELECT datanode_id, container_id, MAX(timestamp) as timestamp FROM DatanodeContainerLogTable" + + " GROUP BY datanode_id, container_id) as b ON a.datanode_id = b.datanode_id AND " + + "a.container_id = b.container_id AND a.timestamp=b.timestamp;"; + public static final String DROP_TABLE = "DROP TABLE IF EXISTS {table_name};"; + public static final String CREATE_INDEX_LATEST_STATE = + "CREATE INDEX IF NOT EXISTS idx_container_log_state ON ContainerLogTable(latest_state);"; + public static final String SELECT_LATEST_CONTAINER_LOGS_BY_STATE = + "SELECT cl.datanode_id, cl.container_id, cl.latest_state, cl.latest_bcsid, dcl.error_message, dcl.index_value," + + " dcl.timestamp FROM ContainerLogTable cl LEFT JOIN DatanodeContainerLogTable dcl ON" + + " cl.datanode_id = dcl.datanode_id AND cl.container_id = dcl.container_id AND cl.latest_bcsid = dcl.bcsid " + + "AND cl.latest_state = dcl.container_state WHERE cl.latest_state = ? " + + "AND dcl.timestamp = (SELECT MAX(timestamp) FROM DatanodeContainerLogTable sub_dcl " + + "WHERE sub_dcl.datanode_id = cl.datanode_id AND" + + " sub_dcl.container_id = cl.container_id AND sub_dcl.bcsid = cl.latest_bcsid" + + " AND sub_dcl.container_state = cl.latest_state)"; private DBConsts() { //Never constructed From 4e889f4bd1fbb3fba8f7a060882830a0a72d4e86 Mon Sep 17 00:00:00 2001 From: Chia-Chuan Yu Date: Tue, 29 Apr 2025 23:04:12 +0800 Subject: [PATCH 23/26] Fixed PMD --- .../volume/TestStorageVolumeChecker.java | 50 ++++++++----------- .../hadoop/hdds/scm/TestHddsServerUtils.java | 4 -- .../ozone/om/TestGrpcOzoneManagerServer.java | 4 -- .../ozone/protocolPB/TestGrpcOmTransport.java | 4 -- 4 files changed, 20 insertions(+), 42 deletions(-) diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java index bbcf50a6e1c8..1c90c6128016 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java @@ -34,6 +34,7 @@ import java.nio.file.Path; import java.time.Duration; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Optional; import java.util.Set; @@ -58,7 +59,6 @@ import org.apache.hadoop.util.DiskChecker.DiskErrorException; import org.apache.hadoop.util.FakeTimer; import org.apache.ozone.test.GenericTestUtils; -import org.junit.jupiter.api.TestInfo; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -85,12 +85,8 @@ public class TestStorageVolumeChecker { */ private VolumeCheckResult expectedVolumeHealth; - private ContainerLayoutVersion layoutVersion; - - private void initTest(VolumeCheckResult result, - ContainerLayoutVersion layout) { + private void initTest(VolumeCheckResult result) { this.expectedVolumeHealth = result; - this.layoutVersion = layout; setup(); } @@ -104,13 +100,19 @@ private void setup() { * Run each test case for each possible value of {@link VolumeCheckResult}. * Including "null" for 'throw exception'. */ + private static List volumeCheckResults() { + List list = new ArrayList<>(Arrays.asList(VolumeCheckResult.values())); + list.add(null); + return list; + } + private static List provideTestData() { + List volumeCheckResults = volumeCheckResults(); List values = new ArrayList<>(); for (ContainerLayoutVersion layout : ContainerLayoutVersion.values()) { - for (VolumeCheckResult result : VolumeCheckResult.values()) { + for (VolumeCheckResult result : volumeCheckResults) { values.add(Arguments.of(result, layout)); } - values.add(Arguments.of(null, layout)); } return values; } @@ -119,23 +121,18 @@ private static List provideTestData() { /** * Test {@link StorageVolumeChecker#checkVolume} propagates the * check to the delegate checker. - * - * @throws Exception */ @ParameterizedTest - @MethodSource("provideTestData") - public void testCheckOneVolume( - VolumeCheckResult checkResult, ContainerLayoutVersion layout, - TestInfo testInfo) throws Exception { - initTest(checkResult, layout); - LOG.info("Executing {}", testInfo.getTestMethod()); + @MethodSource("volumeCheckResults") + public void testCheckOneVolume(VolumeCheckResult checkResult) throws Exception { + initTest(checkResult); final HddsVolume volume = makeVolumes(1, expectedVolumeHealth).get(0); final StorageVolumeChecker checker = new StorageVolumeChecker(new OzoneConfiguration(), new FakeTimer(), ""); checker.setDelegateChecker(new DummyChecker()); final AtomicLong numCallbackInvocations = new AtomicLong(0); - /** + /* * Request a check and ensure it triggered {@link HddsVolume#check}. */ boolean result = @@ -165,15 +162,11 @@ public void testCheckOneVolume( /** * Test {@link StorageVolumeChecker#checkAllVolumes} propagates * checks for all volumes to the delegate checker. - * - * @throws Exception */ @ParameterizedTest - @MethodSource("provideTestData") - public void testCheckAllVolumes(VolumeCheckResult checkResult, - ContainerLayoutVersion layout, TestInfo testInfo) throws Exception { - initTest(checkResult, layout); - LOG.info("Executing {}", testInfo.getTestMethod()); + @MethodSource("volumeCheckResults") + public void testCheckAllVolumes(VolumeCheckResult checkResult) throws Exception { + initTest(checkResult); final List volumes = makeVolumes( NUM_VOLUMES, expectedVolumeHealth); @@ -203,15 +196,12 @@ public void testCheckAllVolumes(VolumeCheckResult checkResult, /** * Test {@link StorageVolumeChecker#checkAllVolumes} propagates * checks for all volumes to the delegate checker. - * - * @throws Exception */ @ParameterizedTest @MethodSource("provideTestData") public void testVolumeDeletion(VolumeCheckResult checkResult, - ContainerLayoutVersion layout, TestInfo testInfo) throws Exception { - initTest(checkResult, layout); - LOG.info("Executing {}", testInfo.getTestMethod()); + ContainerLayoutVersion layout) throws Exception { + initTest(checkResult); DatanodeConfiguration dnConf = conf.getObject(DatanodeConfiguration.class); @@ -278,7 +268,7 @@ public Optional> schedule( return Optional.of( Futures.immediateFuture(target.check(context))); } catch (Exception e) { - LOG.info("check routine threw exception {}", e); + LOG.info("check routine threw exception", e); return Optional.of(Futures.immediateFailedFuture(e)); } } diff --git a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java index fe3b6d9d4a30..d3142ebd96ae 100644 --- a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java +++ b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestHddsServerUtils.java @@ -40,15 +40,11 @@ import org.apache.hadoop.net.NetUtils; import org.apache.hadoop.test.PathUtils; import org.junit.jupiter.api.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * Unit tests for {@link HddsServerUtil}. */ public class TestHddsServerUtils { - private static final Logger LOG = LoggerFactory.getLogger( - TestHddsServerUtils.class); /** * Test getting OZONE_SCM_DATANODE_ADDRESS_KEY with port. diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java index 255b9c5b4b91..2401e62bcd10 100644 --- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java +++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestGrpcOzoneManagerServer.java @@ -22,15 +22,11 @@ import org.apache.hadoop.hdds.conf.OzoneConfiguration; import org.apache.hadoop.ozone.protocolPB.OzoneManagerProtocolServerSideTranslatorPB; import org.junit.jupiter.api.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * Tests for GrpcOzoneManagerServer. */ public class TestGrpcOzoneManagerServer { - private static final Logger LOG = - LoggerFactory.getLogger(TestGrpcOzoneManagerServer.class); private OzoneManager ozoneManager; private OzoneManagerProtocolServerSideTranslatorPB omServerProtocol; private GrpcOzoneManagerServer server; diff --git a/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java b/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java index 33f3be12b873..269aed6616bc 100644 --- a/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java +++ b/hadoop-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/protocolPB/TestGrpcOmTransport.java @@ -33,16 +33,12 @@ import org.apache.hadoop.security.UserGroupInformation; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; /** * Tests for GrpcOmTransport. */ public class TestGrpcOmTransport { - private static final Logger LOG = - LoggerFactory.getLogger(TestGrpcOmTransport.class); private static OzoneConfiguration conf; @BeforeAll From d2370524259d6ac0c5b93272be2eb948c7121b2c Mon Sep 17 00:00:00 2001 From: Chia-Chuan Yu Date: Wed, 30 Apr 2025 14:41:58 +0800 Subject: [PATCH 24/26] Checkout from master --- .../apache/hadoop/hdds/utils/db/RDBStore.java | 10 +++++----- .../parser/ContainerDatanodeDatabase.java | 17 ++++++++-------- .../ozone/containerlog/parser/DBConsts.java | 20 +++++++++---------- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RDBStore.java b/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RDBStore.java index d6168aee5413..491f8ff54192 100644 --- a/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RDBStore.java +++ b/hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/utils/db/RDBStore.java @@ -243,7 +243,7 @@ public void close() throws IOException { @Override public void move(K key, Table source, - Table dest) throws IOException { + Table dest) throws IOException { try (BatchOperation batchOperation = initBatchOperation()) { V value = source.get(key); @@ -255,14 +255,14 @@ public void move(K key, Table source, @Override public void move(K key, V value, Table source, - Table dest) throws IOException { + Table dest) throws IOException { move(key, key, value, source, dest); } @Override public void move(K sourceKey, K destKey, V value, - Table source, - Table dest) throws IOException { + Table source, + Table dest) throws IOException { try (BatchOperation batchOperation = initBatchOperation()) { dest.putWithBatch(batchOperation, destKey, value); source.deleteWithBatch(batchOperation, sourceKey); @@ -372,7 +372,7 @@ public DBUpdatesWrapper getUpdatesSince(long sequenceNumber, long limitCount) long cumulativeDBUpdateLogBatchSize = 0L; DBUpdatesWrapper dbUpdatesWrapper = new DBUpdatesWrapper(); try (ManagedTransactionLogIterator logIterator = - db.getUpdatesSince(sequenceNumber)) { + db.getUpdatesSince(sequenceNumber)) { // If Recon's sequence number is out-of-date and the iterator is invalid, // throw SNNFE and let Recon fall back to full snapshot. diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/containerlog/parser/ContainerDatanodeDatabase.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/containerlog/parser/ContainerDatanodeDatabase.java index f07b20701949..9dcf3fb71872 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/containerlog/parser/ContainerDatanodeDatabase.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/containerlog/parser/ContainerDatanodeDatabase.java @@ -34,9 +34,9 @@ * Provides methods for table creation, log data insertion, and index setup. */ public class ContainerDatanodeDatabase { - + private static String databasePath; - + public static void setDatabasePath(String dbPath) { if (databasePath == null) { databasePath = dbPath; @@ -47,7 +47,7 @@ private static Connection getConnection() throws Exception { if (databasePath == null) { throw new IllegalStateException("Database path not set"); } - + Class.forName(DBConsts.DRIVER); SQLiteConfig config = new SQLiteConfig(); @@ -99,14 +99,14 @@ private void createContainerLogTable() throws SQLException { * * @param transitionList List of container log entries to insert into the table. */ - + public synchronized void insertContainerDatanodeData(List transitionList) throws SQLException { String insertSQL = DBConsts.INSERT_DATANODE_CONTAINER_LOG; long containerId = 0; String datanodeId = null; - + try (Connection connection = getConnection(); PreparedStatement preparedStatement = connection.prepareStatement(insertSQL)) { @@ -165,9 +165,9 @@ public void insertLatestContainerLogData() throws SQLException { PreparedStatement selectStmt = connection.prepareStatement(selectSQL); ResultSet resultSet = selectStmt.executeQuery(); PreparedStatement insertStmt = connection.prepareStatement(insertSQL)) { - + int count = 0; - + while (resultSet.next()) { String datanodeId = resultSet.getString("datanode_id"); long containerId = resultSet.getLong("container_id"); @@ -273,7 +273,7 @@ public void listContainersByState(String state, Integer limit) throws SQLExcepti writer.printf("%-25s | %-35s | %-15d | %-15d | %-40s | %-12d%n", timestamp, datanodeId, containerId, latestBcsid, errorMessage, indexValue); } - + if (count == 0) { writer.printf("No containers found for state: %s%n", state); } else { @@ -288,3 +288,4 @@ public void listContainersByState(String state, Integer limit) throws SQLExcepti } } } + diff --git a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/containerlog/parser/DBConsts.java b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/containerlog/parser/DBConsts.java index 48c6150608c7..5cef4a335d94 100644 --- a/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/containerlog/parser/DBConsts.java +++ b/hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/containerlog/parser/DBConsts.java @@ -21,7 +21,7 @@ * Constants used for ContainerDatanodeDatabase. */ public final class DBConsts { - + public static final String DEFAULT_DB_FILENAME = "container_datanode.db"; public static final String DRIVER = "org.sqlite.JDBC"; public static final String CONNECTION_PREFIX = "jdbc:sqlite:"; @@ -29,32 +29,32 @@ public final class DBConsts { public static final int BATCH_SIZE = 2500; public static final String DATANODE_CONTAINER_LOG_TABLE_NAME = "DatanodeContainerLogTable"; public static final String CONTAINER_LOG_TABLE_NAME = "ContainerLogTable"; - public static final String CREATE_DATANODE_CONTAINER_LOG_TABLE = + public static final String CREATE_DATANODE_CONTAINER_LOG_TABLE = "CREATE TABLE IF NOT EXISTS DatanodeContainerLogTable (datanode_id TEXT NOT NULL, " + "container_id INTEGER NOT NULL, timestamp TEXT NOT NULL, container_state TEXT, bcsid INTEGER, " + "error_message TEXT, log_level TEXT NOT NULL," + " index_value INTEGER);"; - public static final String CREATE_CONTAINER_LOG_TABLE = + public static final String CREATE_CONTAINER_LOG_TABLE = "CREATE TABLE IF NOT EXISTS ContainerLogTable (datanode_id TEXT NOT NULL, container_id INTEGER NOT NULL," + " latest_state TEXT, latest_bcsid INTEGER, PRIMARY KEY (datanode_id, container_id));"; - public static final String CREATE_DATANODE_CONTAINER_INDEX = + public static final String CREATE_DATANODE_CONTAINER_INDEX = "CREATE INDEX IF NOT EXISTS idx_datanode_container ON DatanodeContainerLogTable (datanode_id," + " container_id, timestamp);"; - public static final String INSERT_DATANODE_CONTAINER_LOG = + public static final String INSERT_DATANODE_CONTAINER_LOG = "INSERT INTO DatanodeContainerLogTable (datanode_id, container_id, timestamp, container_state, bcsid," + " error_message, log_level, index_value) VALUES (?, ?, ?, ?, ?, ?, ?, ?);"; - public static final String INSERT_CONTAINER_LOG = + public static final String INSERT_CONTAINER_LOG = "INSERT OR REPLACE INTO ContainerLogTable (datanode_id, container_id, latest_state," + " latest_bcsid) VALUES (?, ?, ?, ?);"; - public static final String SELECT_LATEST_CONTAINER_LOG = + public static final String SELECT_LATEST_CONTAINER_LOG = "SELECT a.datanode_id, a.container_id, a.container_state, a.bcsid, a.timestamp FROM DatanodeContainerLogTable" + " AS a JOIN (SELECT datanode_id, container_id, MAX(timestamp) as timestamp FROM DatanodeContainerLogTable" + " GROUP BY datanode_id, container_id) as b ON a.datanode_id = b.datanode_id AND " + "a.container_id = b.container_id AND a.timestamp=b.timestamp;"; public static final String DROP_TABLE = "DROP TABLE IF EXISTS {table_name};"; - public static final String CREATE_INDEX_LATEST_STATE = + public static final String CREATE_INDEX_LATEST_STATE = "CREATE INDEX IF NOT EXISTS idx_container_log_state ON ContainerLogTable(latest_state);"; - public static final String SELECT_LATEST_CONTAINER_LOGS_BY_STATE = + public static final String SELECT_LATEST_CONTAINER_LOGS_BY_STATE = "SELECT cl.datanode_id, cl.container_id, cl.latest_state, cl.latest_bcsid, dcl.error_message, dcl.index_value," + " dcl.timestamp FROM ContainerLogTable cl LEFT JOIN DatanodeContainerLogTable dcl ON" + " cl.datanode_id = dcl.datanode_id AND cl.container_id = dcl.container_id AND cl.latest_bcsid = dcl.bcsid " + @@ -63,7 +63,7 @@ public final class DBConsts { "WHERE sub_dcl.datanode_id = cl.datanode_id AND" + " sub_dcl.container_id = cl.container_id AND sub_dcl.bcsid = cl.latest_bcsid" + " AND sub_dcl.container_state = cl.latest_state)"; - + private DBConsts() { //Never constructed } From 24e799157a008b56e9bcee8797f897fcacdb703f Mon Sep 17 00:00:00 2001 From: Chia-Chuan Yu Date: Wed, 30 Apr 2025 18:33:56 +0800 Subject: [PATCH 25/26] Restored indent --- .../hadoop/ozone/om/TestOmMetadataManager.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmMetadataManager.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmMetadataManager.java index d6bcd2463278..ada42fba9b57 100644 --- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmMetadataManager.java +++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmMetadataManager.java @@ -720,10 +720,10 @@ public void testGetExpiredOpenKeys(BucketLayout bucketLayout) final String volumeName = UUID.randomUUID().toString(); // Add volume, bucket, key entries to DB. OMRequestTestUtils.addVolumeAndBucketToDB(volumeName, bucketName, - omMetadataManager, BucketLayout.FILE_SYSTEM_OPTIMIZED); + omMetadataManager, BucketLayout.FILE_SYSTEM_OPTIMIZED); final long volumeId = omMetadataManager.getVolumeId(volumeName); final long bucketId = omMetadataManager.getBucketId(volumeName, - bucketName); + bucketName); final int numExpiredOpenKeys = 4; final int numUnexpiredOpenKeys = 1; final long clientID = 1000L; @@ -990,7 +990,7 @@ private List getMultipartKeyNames( } private void addKeysToOM(String volumeName, String bucketName, - String keyName, int i) throws Exception { + String keyName, int i) throws Exception { if (i % 2 == 0) { OMRequestTestUtils.addKeyToTable(false, volumeName, bucketName, keyName, @@ -1105,7 +1105,7 @@ private static Stream listSnapshotWithInvalidPathCases() { @Test public void testListSnapshotDoesNotListOtherBucketSnapshots() - throws Exception { + throws Exception { String vol1 = "vol1"; String bucket1 = "bucket1"; String bucket2 = "bucket2"; @@ -1118,12 +1118,12 @@ public void testListSnapshotDoesNotListOtherBucketSnapshots() for (int i = 1; i <= 2; i++) { OMRequestTestUtils.addSnapshotToTable(vol1, bucket1, - snapshotName1 + i, omMetadataManager); + snapshotName1 + i, omMetadataManager); } for (int i = 1; i <= 5; i++) { OMRequestTestUtils.addSnapshotToTable(vol1, bucket2, - snapshotName2 + i, omMetadataManager); + snapshotName2 + i, omMetadataManager); } //Test listing snapshots only lists snapshots of specified bucket @@ -1160,8 +1160,8 @@ public void testGetMultipartUploadKeys() throws Exception { // Create multipart key info OmKeyInfo keyInfo = OMRequestTestUtils.createOmKeyInfo( - volumeName, bucketName, key, - RatisReplicationConfig.getInstance(ONE)) + volumeName, bucketName, key, + RatisReplicationConfig.getInstance(ONE)) .build(); OmMultipartKeyInfo multipartKeyInfo = OMRequestTestUtils From be55d522230b9e3a8e7b8bc8672baa0c6b878914 Mon Sep 17 00:00:00 2001 From: Chia-Chuan Yu Date: Wed, 30 Apr 2025 18:35:18 +0800 Subject: [PATCH 26/26] Restored indent --- .../ozone/container/common/volume/TestStorageVolumeChecker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java index 1c90c6128016..4fc1b19fa6aa 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/volume/TestStorageVolumeChecker.java @@ -200,7 +200,7 @@ public void testCheckAllVolumes(VolumeCheckResult checkResult) throws Exception @ParameterizedTest @MethodSource("provideTestData") public void testVolumeDeletion(VolumeCheckResult checkResult, - ContainerLayoutVersion layout) throws Exception { + ContainerLayoutVersion layout) throws Exception { initTest(checkResult); DatanodeConfiguration dnConf =