-
Notifications
You must be signed in to change notification settings - Fork 2
HDDS-10000. UD-635. Added datacenter info to datanodes, buckets and containers #2
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
Changes from 16 commits
4378de2
7215507
3ea5149
2bc501c
430de38
62d086d
47177aa
2c99129
80dc31a
a5e71d7
2dc4267
8f11ddd
a135bec
faec0bc
a52ba77
6afdba7
7e78726
d7d8cf2
6378878
eb48107
578c7c7
fd13563
960ecb6
6ea6503
60d37de
2c2ada1
f351fbe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -4349,4 +4349,15 @@ | |||||||
| A key of the cache entry is a pair of bucket and the requested key path. | ||||||||
| </description> | ||||||||
| </property> | ||||||||
|
|
||||||||
| <property> | ||||||||
| <name>ozone.scm.dc.datanode.mapping</name> | ||||||||
| <value></value> | ||||||||
| <tag>SCM</tag> | ||||||||
| <description> | ||||||||
| This setting maps each DataNode to its data center using a comma-separated list of | ||||||||
| hostname:ratis_port=*dc_name* pairs. It enables Ozone to associate DataNodes with specific data centers, | ||||||||
|
||||||||
| This setting maps each DataNode to its data center using a comma-separated list of | |
| hostname:ratis_port=*dc_name* pairs. It enables Ozone to associate DataNodes with specific data centers, | |
| This property defines a mapping that associates each DataNode with its corresponding data center. The mapping is specified as a comma-separated list of pairs in the format `hostname:ratis_port=dc_name`. By establishing this association, Ozone can identify which data center a DataNode belongs to, enabling more efficient storage management and data placement across data centers. |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ratis port is different each time. It's not feasible to keep it in settings
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,7 +87,7 @@ default List<AllocatedBlock> allocateBlock(long size, int numBlocks, | |
| ReplicationConfig replicationConfig, String owner, | ||
| ExcludeList excludeList) throws IOException { | ||
| return allocateBlock(size, numBlocks, replicationConfig, owner, | ||
| excludeList, null); | ||
| excludeList, null, null); | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -109,7 +109,7 @@ default List<AllocatedBlock> allocateBlock(long size, int numBlocks, | |
| */ | ||
| List<AllocatedBlock> allocateBlock(long size, int numBlocks, | ||
| ReplicationConfig replicationConfig, String owner, | ||
| ExcludeList excludeList, String clientMachine) throws IOException; | ||
| ExcludeList excludeList, String clientMachine, String datacenters) throws IOException; | ||
|
||
|
|
||
| /** | ||
| * Delete blocks for a set of object keys. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -153,7 +153,7 @@ public List<AllocatedBlock> allocateBlock( | |
| long size, int num, | ||
| ReplicationConfig replicationConfig, | ||
| String owner, ExcludeList excludeList, | ||
| String clientMachine | ||
| String clientMachine, String datacenters | ||
|
||
| ) throws IOException { | ||
| Preconditions.checkArgument(size > 0, "block size must be greater than 0"); | ||
|
|
||
|
|
@@ -169,6 +169,10 @@ public List<AllocatedBlock> allocateBlock( | |
| requestBuilder.setClient(clientMachine); | ||
| } | ||
|
|
||
| if (StringUtils.isNotEmpty(datacenters)) { | ||
| requestBuilder.setDatacenters(datacenters); | ||
| } | ||
|
|
||
| switch (replicationConfig.getReplicationType()) { | ||
| case STAND_ALONE: | ||
| requestBuilder.setFactor( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would've made a copy of the set here.