Skip to content

Commit

Permalink
When the bookie is not available, change RackawareEnsemblePlacementPo…
Browse files Browse the repository at this point in the history
…licyImpl defaultRack from `/default-region/default-rack` to `/default-rack`
  • Loading branch information
horizonzy committed Jun 18, 2024
1 parent 15a5b49 commit 0353ab3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ public RackawareEnsemblePlacementPolicyImpl withDefaultRack(String rack) {
return this;
}

@Override
public String getDefaultRack() {
return defaultRack;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -824,12 +824,17 @@ protected String resolveNetworkLocation(BookieId addr) {
if (null != historyBookie) {
return historyBookie.getNetworkLocation();
}
String defaultRack = getDefaultRack();
LOG.error("Cannot resolve bookieId {} to a network address, resolving as {}. {}", addr,
NetworkTopology.DEFAULT_REGION_AND_RACK, err.getMessage());
return NetworkTopology.DEFAULT_REGION_AND_RACK;
defaultRack, err.getMessage());
return defaultRack;
}
}

protected String getDefaultRack() {
return NetworkTopology.DEFAULT_REGION_AND_RACK;
}

protected Set<Node> convertBookiesToNodes(Collection<BookieId> bookies) {
Set<Node> nodes = new HashSet<Node>();
for (BookieId addr : bookies) {
Expand Down

0 comments on commit 0353ab3

Please sign in to comment.