-
Notifications
You must be signed in to change notification settings - Fork 589
HDDS-9400. Introduce DatanodeID to avoid passing UUID/String object in SCM #5417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
79 commits
Select commit
Hold shift + click to select a range
5b5f10c
HDDS-9400. Introduce DatanodeID to avoid passing UUID/String object i…
nandakumar131 5d6908e
JSON Conversion support added
nandakumar131 ce386ef
Merge branch 'master' into HDDS-9400
nandakumar131 1608faa
HDDS-12130. Improve assertion compatibility with old Hadoop (#7738)
adoroszlai 99c3467
HDDS-12131. NPE in OM when overwriting empty file using multipart upl…
k5342 82d452c
HDDS-12089. Move execute_debug_tests out of testlib.sh (#7744)
adoroszlai c76b039
HDDS-12114. Prevent delete commands running after a long lock wait an…
sodonnel f9a4aa7
HDDS-12081. TestKeyInputStream repeats tests with default container l…
adoroszlai 081fd26
HDDS-12138. Bump assertj-core to 3.27.3 (#7751)
dependabot[bot] 1a2af7f
HDDS-12098. Bump Hugo to 0.141.0 (#7731)
adoroszlai df1690e
HDDS-12122. Add unit test for SnapshotChainRepair (#7741)
peterxcli 696408a
HDDS-11798. Move SafeModeRule names to respective rules (#7742)
nandakumar131 78297ea
HDDS-12115. RM selects replicas to delete non-deterministically if no…
sodonnel 8feb62e
HDDS-11892. Remove config from SCM for disabling Ratis. (#7711)
nandakumar131 93d7db0
HDDS-12135. Set RM default deadline to 12 minutes and datanode offset…
sodonnel 3c28b19
HDDS-12099. Generate kubernetes Robot report in container (#7754)
chiacyu 1315a6a
HDDS-12117. Create endpoint builders for S3G tests (#7753)
peterxcli 2a43909
HDDS-12084. Persist currently selected UI type (new/old) between refr…
devabhishekpal 5e2bbdd
HDDS-11837. Support executing multiple commands in Ozone CLI (#7727)
adoroszlai bdc0e8e
HDDS-12032. Remove DefaultConfigManager from SCM. (#7757)
nandakumar131 5a35e0d
HDDS-12139. Refactor TestSnapshotChainRepair. (#7752)
adoroszlai 57e3759
HDDS-12127. RM should not expire pending deletes, but retry until del…
sodonnel c4346c9
HDDS-12141. Replace direct dependency on hadoop-hdfs-client (#7762)
adoroszlai 9773cc5
HDDS-12140. Replace leftover rebot in k8s/examples/test-all.sh (#7756)
adoroszlai 3327ef2
HDDS-11125. Do not log user-controlled data in HddsConfServlet (#7767)
len548 d55c151
HDDS-12147. Remove server dependencies from hdds-tools (#7771)
adoroszlai 2a46b2c
HDDS-12116. Customizable prefix for shaded protobuf in ozonefs-hadoop…
apotheque 3e7357e
HDDS-12010. Block ozone repair if service is running (#7758)
adoroszlai 82b5d05
HDDS-12155. Create new submodule for ozone shell (#7775)
adoroszlai 3b67c44
HDDS-12162. Log available space of HddsVolume and DbVolume upon Datan…
smengcl e495928
HDDS-12143. Generate list of integration check splits dynamically (#7…
adoroszlai ee2e950
HDDS-12040. `ozone freon cr` fails with NPE in ReplicationSupervisor …
len548 7400016
HDDS-12144. Remove unsupported replication types from config descript…
adoroszlai d8c771c
HDDS-11277. Remove dependency on hadoop-hdfs in Ozone client (#7781)
adoroszlai 0044566
HDDS-12132. Parameterize testUpdateTransactionInfoTable for SCM (#7768)
sarvekshayr 54270c0
HDDS-12085. Add manual refresh button for DU page (#7780)
devabhishekpal 4292fd4
HDDS-12165. Refactor VolumeInfoMetrics to use getCurrentUsage (#7784)
adoroszlai e866507
HDDS-12181. Bump jline to 3.29.0 (#7789)
dependabot[bot] 75c6bb5
HDDS-12176. Trivial dependency cleanup.(#7787)
adoroszlai 8380fad
HDDS-12163. Reduce number of individual getCapacity/getAvailable/getU…
adoroszlai 21b21c1
HDDS-12142. Save logs from build check (#7782)
adoroszlai 51ffefd
HDDS-12073. Don't show Source Bucket and Volume if null in DU metadat…
devabhishekpal 0fa552f
HDDS-11508. Decouple delete batch limits from Ratis request size for …
sadanand48 a05539c
HDDS-12186. Avoid array allocation for table iterator. (#7797)
sadanand48 50869b9
HDDS-12186. (addendum) Avoid array allocation for table iterator (#7799)
adoroszlai f0bc4fa
HDDS-11714. resetDeletedBlockRetryCount with --all may fail and can c…
aryangupta1998 c20e4eb
HDDS-12183. Reuse cluster across safe test classes (#7793)
adoroszlai a94f111
HDDS-12203. Initialize block length before skip (#7809)
oneonestar bf86fe3
HDDS-12202. OpsCreate and OpsAppend metrics not incremented (#7811)
peterxcli 30543e6
HDDS-12200. Fix grammar in OM HA, EC and Snapshot doc (#7806)
sreejasahithi f7deae1
HDDS-12195. Implement skip() in OzoneFSInputStream (#7801)
oneonestar abcf385
HDDS-12212. Fix grammar in decommissioning and observability document…
Gargi-jais11 e7b38b6
HDDS-12112. Fix interval used for Chunk Read/Write Dashboard (#7724)
kerneltime 6d819de
HDDS-11442. Add dashboard for memory consumption metrics (#7198)
len548 4dcec6e
HDDS-12159. Remove redundant seek for rocksDBs (#7794)
Tejaskriya adb1446
HDDS-7003. Make read-replicas tool compatible with EC replication typ…
len548 33f7c65
HDDS-10607. Remove unused config property ozone.block.deleting.contai…
sreejasahithi c5958fe
HDDS-12044. Fix heatmap calendar closing on skipping years/months (#7…
devabhishekpal 10d87cd
HDDS-12221. Remove unused config property ozone.block.deleting.limit.…
Gargi-jais11 0bc2d20
HDDS-12217. Remove reference to FileUtil in hdds-common. (#7818)
adoroszlai 9d39cd8
HDDS-12231. Logging in Container Balancer is too verbose. (#7826)
siddhantsangwan 4fa1d76
HDDS-12033. ScmHAUnfinalizedStateValidationAction can be remove as it…
jojochuang 0b0994b
HDDS-11866. Remove code paths for non-Ratis OM (#7778)
adoroszlai d8b6278
HDDS-12218. Add more to integration test with shared cluster (#7821)
adoroszlai 85d64fd
HDDS-12227. Avoid Clutter in Recon Logs by Reducing Log Level of Cont…
ArafatKhan2198 c229d5c
HDDS-12228. Fix Duplicate Key Violation Condition in FileSizeCountTas…
ArafatKhan2198 5d26991
HDDS-12180. Store snapshot in CachingSpaceUsageSource (#7798)
adoroszlai e0b98a4
HDDS-12230. Improve error message in `ozone sh key put` when file not…
sreejasahithi 92ccfd5
HDDS-12232. Move container from QUASI_CLODED to CLOSED only when SCM …
sodonnel 209a609
HDDS-12149. Do not require dependency-convergence. (#7772)
adoroszlai 46c901d
HDDS-11784. Allow aborting FSO multipart uploads with missing parent …
sokui 7f69eb2
HDDS-12205. Reduce log level in TestHSync (#7838)
chiacyu 3a1672c
HDDS-12287. Bump sqlite-jdbc to 3.49.0.0 (#7839)
dependabot[bot] fc22b97
HDDS-12248. Make allowListAllVolumes reconfigurable in OM (#7837)
adoroszlai d5dab3e
HDDS-12292. Change log level in SCMNodeManager#getNodesByAddress to d…
nandakumar131 5fa5353
Fixed review comments.
nandakumar131 7d84d44
Fixed typo in hdds.proto
nandakumar131 4dd0c39
Merge remote-tracking branch 'upstream' into HDDS-9400
nandakumar131 9536a98
Use StringWithByteString to store UUID String.
nandakumar131 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
121 changes: 121 additions & 0 deletions
121
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/protocol/DatanodeID.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| /* | ||
| * 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. | ||
| */ | ||
|
|
||
| package org.apache.hadoop.hdds.protocol; | ||
|
|
||
| import com.google.protobuf.ByteString; | ||
| import java.util.UUID; | ||
| import java.util.concurrent.ConcurrentHashMap; | ||
| import java.util.concurrent.ConcurrentMap; | ||
| import org.apache.hadoop.hdds.protocol.proto.HddsProtos.DatanodeIDProto; | ||
| import org.apache.hadoop.hdds.protocol.proto.HddsProtos; | ||
| import org.apache.hadoop.ozone.util.StringWithByteString; | ||
|
|
||
| /** | ||
| * DatanodeID is the primary identifier of the Datanode. | ||
| * They are unique for every Datanode in the cluster. | ||
| * <p> | ||
| * This class is immutable and thread safe. | ||
| */ | ||
| public final class DatanodeID implements Comparable<DatanodeID> { | ||
|
|
||
| private static final ConcurrentMap<UUID, DatanodeID> CACHE = new ConcurrentHashMap<>(); | ||
|
|
||
| private final UUID uuid; | ||
| private final StringWithByteString uuidByteString; | ||
|
|
||
| private DatanodeID(final UUID uuid) { | ||
| this.uuid = uuid; | ||
| this.uuidByteString = StringWithByteString.valueOf(uuid.toString()); | ||
| } | ||
|
|
||
| // Mainly used for JSON conversion | ||
| public String getID() { | ||
| return toString(); | ||
| } | ||
|
|
||
| @Override | ||
| public int compareTo(final DatanodeID that) { | ||
| return this.uuid.compareTo(that.uuid); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(final Object obj) { | ||
| return obj instanceof DatanodeID && | ||
| uuid.equals(((DatanodeID) obj).uuid); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return uuid.hashCode(); | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| return uuidByteString.getString(); | ||
| } | ||
|
|
||
| /** | ||
| * This will be removed once the proto structure is refactored | ||
| * to remove deprecated fields. | ||
| */ | ||
| @Deprecated | ||
| public ByteString getByteString() { | ||
| return uuidByteString.getBytes(); | ||
| } | ||
|
|
||
| public DatanodeIDProto toProto() { | ||
| return DatanodeIDProto.newBuilder().setUuid(toProto(uuid)).build(); | ||
| } | ||
|
|
||
| public static DatanodeID fromProto(final DatanodeIDProto proto) { | ||
| return of(fromProto(proto.getUuid())); | ||
| } | ||
|
|
||
| public static DatanodeID fromUuidString(final String id) { | ||
| return of(UUID.fromString(id)); | ||
| } | ||
|
|
||
| public static DatanodeID of(final UUID id) { | ||
| return CACHE.computeIfAbsent(id, DatanodeID::new); | ||
| } | ||
|
|
||
| /** | ||
| * Returns a random DatanodeID. | ||
| */ | ||
| public static DatanodeID randomID() { | ||
| // We don't want to add Random ID to cache. | ||
| return new DatanodeID(UUID.randomUUID()); | ||
| } | ||
|
|
||
| private static UUID fromProto(final HddsProtos.UUID id) { | ||
| return new UUID(id.getMostSigBits(), id.getLeastSigBits()); | ||
| } | ||
|
|
||
| private static HddsProtos.UUID toProto(final UUID id) { | ||
| return HddsProtos.UUID.newBuilder() | ||
| .setMostSigBits(id.getMostSignificantBits()) | ||
| .setLeastSigBits(id.getLeastSignificantBits()) | ||
| .build(); | ||
| } | ||
|
|
||
| // TODO: Remove this in follow-up Jira. (HDDS-12015) | ||
| UUID getUuid() { | ||
| return uuid; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.