Skip to content

Conversation

@apotheque
Copy link

Pipeline and container filtering based on datacenter binding.

apotheque added a commit to apotheque/ozone that referenced this pull request Mar 15, 2025
@Cyrill Cyrill changed the title HDDS-10000 UD-635. Added datacenter info to datanodes, buckets and containers HDDS-10000. UD-635. Added datacenter info to datanodes, buckets and containers Mar 18, 2025
* @return Builder for PipelineRequestInformation
*/
public Builder setDatacenters(Set<String> datacenters) {
this.datacenters = datacenters;

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.

Comment on lines 4358 to 4359
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,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

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;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mark it Nullable

ReplicationConfig replicationConfig,
String owner, ExcludeList excludeList,
String clientMachine
String clientMachine, String datacenters

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mark it Nullable

AllocatedBlock allocateBlock(long size, ReplicationConfig replicationConfig,
String owner,
ExcludeList excludeList) throws IOException, TimeoutException;
ExcludeList excludeList, String datacenters) throws IOException, TimeoutException;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mark it Nullable

public AllocatedBlock allocateBlock(final long size,
ReplicationConfig replicationConfig,
String owner, ExcludeList excludeList)
String owner, ExcludeList excludeList, String datacenters)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mark it Nullable


public ContainerInfo getContainer(final long size,
ReplicationConfig repConfig, String owner, ExcludeList excludeList)
ReplicationConfig repConfig, String owner, ExcludeList excludeList, String datacenters)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mark as Nullable

*/
ContainerInfo getContainer(long size, T repConfig,
String owner, ExcludeList excludeList)
String owner, ExcludeList excludeList, String datacenters)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mark as Nullable

optional hadoop.hdds.ECReplicationConfig ecReplicationConfig = 8;

optional string client = 9;
optional string datacenters = 10;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why pass it as a string and not as repeatable?

}

if (datacenters != null && !datacenters.isEmpty()) {
bb.addMetadata(OzoneConsts.DATACENTERS, datacenters);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the value should be basically validated

<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,
Copy link
Owner

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

@Cyrill Cyrill merged commit ade3f33 into Cyrill:ozone-1.4 Mar 20, 2025
37 checks passed
Cyrill pushed a commit that referenced this pull request Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants