Skip to content

Commit

Permalink
code cleanup and adjust logging
Browse files Browse the repository at this point in the history
  • Loading branch information
popduke committed Aug 8, 2024
1 parent 70f4d0d commit daecdb6
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public final void start() {
inProcServer.start();
interProcServer.start();
serverRegisters.forEach((serviceName, serverRegister) -> {
log.info("Start server register for service: {}", serviceName);
log.debug("Start server register for service: {}", serviceName);
serverRegister.start(id, (InetSocketAddress) interProcServer.getListenSockets().get(0), emptySet(),
serviceMetadata.get(serviceName));
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public String getServiceAuthority() {

@Override
public void start(Listener listener) {
log.info("Starting TrafficGovernorNameResolver for service[{}]", serviceUniqueName);
log.debug("Starting TrafficGovernorNameResolver for service[{}]", serviceUniqueName);
disposable.add(Observable.combineLatest(trafficDirector.trafficDirective(),
trafficDirector.serverList(), (td, sl) -> {
log.debug("Service[{}] landscape update:td={}, sl={}", serviceUniqueName, td, sl);
Expand All @@ -59,7 +59,7 @@ public void start(Listener listener) {

@Override
public void shutdown() {
log.info("Start to shutdown trafficGovernor nameResolver, service={}", serviceUniqueName);
log.debug("Shutting down trafficGovernor nameResolver, service={}", serviceUniqueName);
disposable.dispose();
trafficDirector.destroy();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void start() {

public void stop() {
if (status.compareAndSet(Status.STARTED, Status.STOPPING)) {
log.info("Stopping dist worker");
log.info("Stopping DistWorker");
jobRunner.awaitDone();
rangeBalanceController.stop();
storeServer().stop();
Expand All @@ -90,7 +90,7 @@ public void stop() {
log.debug("Stopping Job Executor");
MoreExecutors.shutdownAndAwaitTermination(jobScheduler, 5, TimeUnit.SECONDS);
}
log.info("Dist worker stopped");
log.info("DistWorker stopped");
status.compareAndSet(Status.STOPPING, Status.STOPPED);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ abstract class AbstractInboxServerBuilder<T extends AbstractInboxServerBuilder<T
IDistClient distClient;
IRetainClient retainClient;
IBaseKVStoreClient inboxStoreClient;
ScheduledExecutorService bgTaskExecutor;

AbstractInboxServerBuilder() {
}
Expand Down Expand Up @@ -71,11 +70,6 @@ public T inboxStoreClient(IBaseKVStoreClient inboxStoreClient) {
return thisT();
}

public T bgTaskExecutor(ScheduledExecutorService bgTaskExecutor) {
this.bgTaskExecutor = bgTaskExecutor;
return thisT();
}

@SuppressWarnings("unchecked")
private T thisT() {
return (T) this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void start() {

public void stop() {
if (status.compareAndSet(Status.STARTED, Status.STOPPING)) {
log.info("Shutting down inbox store");
log.info("Stopping InboxStore");
jobRunner.awaitDone();
if (gcJob != null && !gcJob.isDone()) {
gcJob.join();
Expand All @@ -112,7 +112,7 @@ public void stop() {
log.debug("Shutting down job executor");
MoreExecutors.shutdownAndAwaitTermination(jobScheduler, 5, TimeUnit.SECONDS);
}
log.info("Inbox store shutdown");
log.info("InboxStore stopped");
status.compareAndSet(Status.STOPPING, Status.STOPPED);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void start() {

public void stop() {
if (status.compareAndSet(Status.STARTED, Status.STOPPING)) {
log.info("Stopping retain store");
log.info("Stopping RetainStore");
jobRunner.awaitDone();
if (gcJob != null && !gcJob.isDone()) {
gcJob.join();
Expand All @@ -107,7 +107,7 @@ public void stop() {
log.debug("Shutting down job executor");
MoreExecutors.shutdownAndAwaitTermination(jobScheduler, 5, TimeUnit.SECONDS);
}
log.info("Retain store shutdown");
log.info("RetainStore shutdown");
status.compareAndSet(Status.STOPPING, Status.STOPPED);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ protected void init(StandaloneConfig config) {
.distClient(distClient)
.retainClient(retainClient)
.inboxStoreClient(inboxStoreClient)
.bgTaskExecutor(bgTaskExecutor)
.build();
distWorkerClient = IBaseKVStoreClient.newBuilder()
.clusterId(IDistWorker.CLUSTER_NAME)
Expand Down

0 comments on commit daecdb6

Please sign in to comment.