Skip to content

Commit

Permalink
Rename AtomicIdGenerator classes for consistency with naming of other…
Browse files Browse the repository at this point in the history
… primitive classes.
  • Loading branch information
kuujo committed Jan 10, 2018
1 parent 1516352 commit dfb2bba
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Expand Up @@ -19,7 +19,7 @@
import io.atomix.primitive.PrimitiveType;
import io.atomix.primitive.service.PrimitiveService;
import io.atomix.core.counter.impl.AtomicCounterService;
import io.atomix.core.generator.impl.DelegatingIdGeneratorBuilder;
import io.atomix.core.generator.impl.DelegatingAtomicIdGeneratorBuilder;

import static com.google.common.base.MoreObjects.toStringHelper;

Expand Down Expand Up @@ -53,7 +53,7 @@ public PrimitiveService newService() {

@Override
public AtomicIdGeneratorBuilder newPrimitiveBuilder(String name, PrimitiveManagementService managementService) {
return new DelegatingIdGeneratorBuilder(name, managementService);
return new DelegatingAtomicIdGeneratorBuilder(name, managementService);
}

@Override
Expand Down
Expand Up @@ -27,7 +27,7 @@
* {@code AsyncAtomicIdGenerator} implementation backed by Atomix
* {@link AsyncAtomicCounter}.
*/
public class DelegatingIdGenerator implements AsyncAtomicIdGenerator {
public class DelegatingAtomicIdGenerator implements AsyncAtomicIdGenerator {

private static final long DEFAULT_BATCH_SIZE = 1000;
private final AsyncAtomicCounter counter;
Expand All @@ -36,11 +36,11 @@ public class DelegatingIdGenerator implements AsyncAtomicIdGenerator {
private long base;
private final AtomicLong delta = new AtomicLong();

public DelegatingIdGenerator(AsyncAtomicCounter counter) {
public DelegatingAtomicIdGenerator(AsyncAtomicCounter counter) {
this(counter, DEFAULT_BATCH_SIZE);
}

DelegatingIdGenerator(AsyncAtomicCounter counter, long batchSize) {
DelegatingAtomicIdGenerator(AsyncAtomicCounter counter, long batchSize) {
this.counter = counter;
this.batchSize = batchSize;
}
Expand Down
Expand Up @@ -28,10 +28,10 @@
/**
* Default implementation of AtomicIdGeneratorBuilder.
*/
public class DelegatingIdGeneratorBuilder extends AtomicIdGeneratorBuilder {
public class DelegatingAtomicIdGeneratorBuilder extends AtomicIdGeneratorBuilder {
private final PrimitiveManagementService managementService;

public DelegatingIdGeneratorBuilder(String name, PrimitiveManagementService managementService) {
public DelegatingAtomicIdGeneratorBuilder(String name, PrimitiveManagementService managementService) {
super(name);
this.managementService = checkNotNull(managementService);
}
Expand All @@ -46,6 +46,6 @@ public CompletableFuture<AtomicIdGenerator> buildAsync() {
.getPrimitiveClient()
.newProxy(name(), primitiveType(), protocol)
.connect()
.thenApply(proxy -> new DelegatingIdGenerator(new AtomicCounterProxy(proxy)).sync());
.thenApply(proxy -> new DelegatingAtomicIdGenerator(new AtomicCounterProxy(proxy)).sync());
}
}
Expand Up @@ -68,7 +68,7 @@ public CompletableFuture<SessionIdService> start() {
.build());
return proxy.connect()
.thenApply(v -> {
idGenerator = new DelegatingIdGenerator(new AtomicCounterProxy(proxy));
idGenerator = new DelegatingAtomicIdGenerator(new AtomicCounterProxy(proxy));
started.set(true);
return this;
});
Expand Down
Expand Up @@ -64,9 +64,9 @@ public void testNextId() throws Throwable {
*/
@Test
public void testNextIdBatchRollover() throws Throwable {
DelegatingIdGenerator idGenerator1 = new DelegatingIdGenerator(
DelegatingAtomicIdGenerator idGenerator1 = new DelegatingAtomicIdGenerator(
atomix().atomicCounterBuilder("testNextIdBatchRollover").build().async(), 2);
DelegatingIdGenerator idGenerator2 = new DelegatingIdGenerator(
DelegatingAtomicIdGenerator idGenerator2 = new DelegatingAtomicIdGenerator(
atomix().atomicCounterBuilder("testNextIdBatchRollover").build().async(), 2);

CompletableFuture<Long> future11 = idGenerator1.nextId();
Expand Down

0 comments on commit dfb2bba

Please sign in to comment.