Skip to content

Commit

Permalink
address checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhee17 committed Apr 15, 2021
1 parent 92888f3 commit 94d6a17
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ public CentralDogma build() throws UnknownHostException {

final EventLoopGroup executor = clientFactory().eventLoopGroup();
final int maxRetriesOnReplicationLag = maxNumRetriesOnReplicationLag();
final CentralDogma dogma = new LegacyCentralDogma(executor, builder.build(AsyncIface.class), meterRegistry());
final CentralDogma dogma = new LegacyCentralDogma(executor, builder.build(AsyncIface.class),
meterRegistry());
if (maxRetriesOnReplicationLag <= 0) {
return dogma;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ protected AbstractCentralDogma(ScheduledExecutorService executor) {
*
* @param executor the {@link ScheduledExecutorService} which will be used for scheduling the tasks
* related with automatic retries.
* @param meterRegistry the {@link MeterRegistry} which collects metrics for this {@link CentralDogma} instance.
* @param meterRegistry the {@link MeterRegistry} which collects metrics for
* this {@link CentralDogma} instance.
*/
protected AbstractCentralDogma(ScheduledExecutorService executor, MeterRegistry meterRegistry) {
this.executor = requireNonNull(executor, "executor");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,9 @@ protected long retryIntervalOnReplicationLagMillis() {
return retryIntervalOnReplicationLagMillis;
}

/**
* Sets the {@link MeterRegistry} used to collect metrics.
*/
public final B meterRegistry(MeterRegistry meterRegistry) {
this.meterRegistry = requireNonNull(meterRegistry, "meterRegistry");
return self();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,10 @@ protected AbstractWatcher(CentralDogma client, ScheduledExecutorService executor
this.pathPattern = requireNonNull(pathPattern, "pathPattern");

final Iterable<Tag> tags = ImmutableList.of(
Tag.of("project", projectName), Tag.of("repository", repositoryName), Tag.of("path", pathPattern));
revisionGauge = client.meterRegistry().gauge("centraldogma.client.watcher.revision", tags, new AtomicLong());
Tag.of("project", projectName), Tag.of("repository", repositoryName),
Tag.of("path", pathPattern));
revisionGauge = client.meterRegistry().gauge("centraldogma.client.watcher.revision",
tags, new AtomicLong());

updateListeners = new CopyOnWriteArrayList<>();
state = new AtomicReference<>(State.INIT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ protected boolean removeEldestEntry(Map.Entry<RepoId, Revision> eldest) {

public ReplicationLagTolerantCentralDogma(ScheduledExecutorService executor, CentralDogma delegate,
int maxRetries, long retryIntervalMillis,
Supplier<?> currentReplicaHintSupplier, MeterRegistry meterRegistry) {
Supplier<?> currentReplicaHintSupplier,
MeterRegistry meterRegistry) {
super(executor, meterRegistry);

requireNonNull(delegate, "delegate");
Expand Down

0 comments on commit 94d6a17

Please sign in to comment.