This repository has been archived by the owner on Jan 10, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #115 from dmitrypekar/multi-dc-basic
multi-dc-basic
- Loading branch information
Showing
12 changed files
with
185 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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
49 changes: 49 additions & 0 deletions
49
...re/mesos/frameworks/cassandra/scheduler/PersistedCassandraFrameworkConfigurationTest.java
This file contains 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,49 @@ | ||
package io.mesosphere.mesos.frameworks.cassandra.scheduler; | ||
|
||
import io.mesosphere.mesos.frameworks.cassandra.CassandraFrameworkProtos; | ||
import org.apache.mesos.state.InMemoryState; | ||
import org.junit.Test; | ||
|
||
import static io.mesosphere.mesos.frameworks.cassandra.CassandraFrameworkProtos.CassandraConfigRole; | ||
import static io.mesosphere.mesos.frameworks.cassandra.CassandraFrameworkProtos.CassandraFrameworkConfiguration; | ||
import static junit.framework.Assert.assertEquals; | ||
|
||
public class PersistedCassandraFrameworkConfigurationTest { | ||
@Test | ||
public void testGetDefaultRackDc() { | ||
InMemoryState state = new InMemoryState(); | ||
|
||
PersistedCassandraFrameworkConfiguration config = new PersistedCassandraFrameworkConfiguration( | ||
state, | ||
"name", | ||
60, | ||
30, | ||
"2.1", | ||
0.5, | ||
1024, | ||
1024, | ||
512, | ||
1, | ||
1, | ||
"role", | ||
"", | ||
false, | ||
true, | ||
"RACK1", | ||
"DC1" | ||
); | ||
|
||
CassandraFrameworkProtos.RackDc rackDc = config.getDefaultRackDc(); | ||
assertEquals("RACK1", rackDc.getRack()); | ||
assertEquals("DC1", 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()); | ||
} | ||
} |
This file contains 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 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