Skip to content
This repository has been archived by the owner on Jan 10, 2019. It is now read-only.

Commit

Permalink
Update default value for dc and rack.
Browse files Browse the repository at this point in the history
Update default value for dc and rack to match the old default value that was set by the executor.
  • Loading branch information
BenWhitehead committed Aug 8, 2015
1 parent e8fac0a commit 654ff37
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,10 @@ message ClusterJobKeyspaceStatus {
*/
message RackDc {
/** Rack identifier */
optional string rack = 1 [default = "RACK0"];
optional string rack = 1 [default = "RAC1"];

/** DataCenter identifier */
optional string dc = 2 [default = "DC0"];
optional string dc = 2 [default = "DC1"];
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ public void testGetDefaultRackDc() {
"",
false,
true,
"RACK1",
"DC1",
"RACK5",
"DC5",
Lists.<CassandraFrameworkProtos.ExternalDc>newArrayList()
);

CassandraFrameworkProtos.RackDc rackDc = config.getDefaultRackDc();
assertEquals("RACK1", rackDc.getRack());
assertEquals("DC1", rackDc.getDc());
assertEquals("RACK5", rackDc.getRack());
assertEquals("DC5", rackDc.getDc());

// backward compatibility: if rackDc is not defined - use defaults
CassandraFrameworkConfiguration.Builder builder = CassandraFrameworkConfiguration.newBuilder(config.get());
builder.setDefaultConfigRole(CassandraConfigRole.newBuilder(builder.getDefaultConfigRole()).clearRackDc());
config.setValue(builder.build());

rackDc = config.getDefaultRackDc();
assertEquals("RACK0", rackDc.getRack());
assertEquals("DC0", rackDc.getDc());
assertEquals("RAC1", rackDc.getRack());
assertEquals("DC1", rackDc.getDc());
}
}

0 comments on commit 654ff37

Please sign in to comment.