static final Address MEMBER_1_ADDRESS = AddressFromURIString.parse("akka.tcp://cluster-test@127.0.0.1:2558");
private IntegrationTestKit kit;
- private DistributedDataStore configDataStore;
- private DistributedDataStore operDataStore;
+ private AbstractDataStore configDataStore;
+ private AbstractDataStore operDataStore;
private DatastoreContext.Builder datastoreContextBuilder;
private boolean cleanedUp;
* callers to cleanup instances on test completion.
* @return a Builder instance
*/
- public static Builder builder(List<MemberNode> members) {
+ public static Builder builder(final List<MemberNode> members) {
return new Builder(members);
}
}
- public DistributedDataStore configDataStore() {
+ public AbstractDataStore configDataStore() {
return configDataStore;
}
- public DistributedDataStore operDataStore() {
+ public AbstractDataStore operDataStore() {
return operDataStore;
}
return datastoreContextBuilder;
}
- public void waitForMembersUp(String... otherMembers) {
+ public void waitForMembersUp(final String... otherMembers) {
kit.waitForMembersUp(otherMembers);
}
- public void waitForMemberDown(String member) {
+ public void waitForMemberDown(final String member) {
Stopwatch sw = Stopwatch.createStarted();
while (sw.elapsed(TimeUnit.SECONDS) <= 10) {
CurrentClusterState state = Cluster.get(kit.getSystem()).state();
}
}
- public static void verifyRaftState(DistributedDataStore datastore, String shardName, RaftStateVerifier verifier)
- throws Exception {
+ public static void verifyRaftState(final AbstractDataStore datastore, final String shardName,
+ final RaftStateVerifier verifier) throws Exception {
ActorContext actorContext = datastore.getActorContext();
Future<ActorRef> future = actorContext.findLocalShardAsync(shardName);
throw lastError;
}
- public static void verifyRaftPeersPresent(DistributedDataStore datastore, final String shardName,
- String... peerMemberNames) throws Exception {
+ public static void verifyRaftPeersPresent(final AbstractDataStore datastore, final String shardName,
+ final String... peerMemberNames) throws Exception {
final Set<String> peerIds = Sets.newHashSet();
for (String p: peerMemberNames) {
peerIds.add(ShardIdentifier.create(shardName, MemberName.forName(p),
raftState.getPeerAddresses().keySet()));
}
- public static void verifyNoShardPresent(DistributedDataStore datastore, String shardName) {
+ public static void verifyNoShardPresent(final AbstractDataStore datastore, final String shardName) {
Stopwatch sw = Stopwatch.createStarted();
while (sw.elapsed(TimeUnit.SECONDS) <= 5) {
Optional<ActorRef> shardReply = datastore.getActorContext().findLocalShard(shardName);
private DatastoreContext.Builder datastoreContextBuilder = DatastoreContext.newBuilder()
.shardHeartbeatIntervalInMillis(300).shardElectionTimeoutFactor(30);
- Builder(List<MemberNode> members) {
+ Builder(final List<MemberNode> members) {
this.members = members;
}
*
* @return this Builder
*/
- public Builder moduleShardsConfig(String newModuleShardsConfig) {
+ public Builder moduleShardsConfig(final String newModuleShardsConfig) {
this.moduleShardsConfig = newModuleShardsConfig;
return this;
}
*
* @return this Builder
*/
- public Builder akkaConfig(String newAkkaConfig) {
+ public Builder akkaConfig(final String newAkkaConfig) {
this.akkaConfig = newAkkaConfig;
return this;
}
*
* @return this Builder
*/
- public Builder testName(String newTestName) {
+ public Builder testName(final String newTestName) {
this.testName = newTestName;
return this;
}
*
* @return this Builder
*/
- public Builder waitForShardLeader(String... shardNames) {
+ public Builder waitForShardLeader(final String... shardNames) {
this.waitForshardLeader = shardNames;
return this;
}
*
* @return this Builder
*/
- public Builder createOperDatastore(boolean value) {
+ public Builder createOperDatastore(final boolean value) {
this.createOperDatastore = value;
return this;
}
*
* @return this Builder
*/
- public Builder schemaContext(SchemaContext newSchemaContext) {
+ public Builder schemaContext(final SchemaContext newSchemaContext) {
this.schemaContext = newSchemaContext;
return this;
}
*
* @return this Builder
*/
- public Builder datastoreContextBuilder(DatastoreContext.Builder builder) {
+ public Builder datastoreContextBuilder(final DatastoreContext.Builder builder) {
datastoreContextBuilder = builder;
return this;
}