Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Improvement] Removed unused/non-updated objects #4450

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ public class LocalDLMEmulator {

private final String zkEnsemble;
private final URI uri;
private final List<File> tmpDirs = new ArrayList<File>();
private final int zkTimeoutSec;
private final Thread bkStartupThread;
private final String zkHost;
Expand Down Expand Up @@ -180,9 +179,6 @@ public void teardown() throws Exception {
bkStartupThread.interrupt();
bkStartupThread.join();
}
for (File dir : tmpDirs) {
FileUtils.forceDeleteOnExit(dir);
}
}

public String getZkServers() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public class DynamicConfigurationFactory {
private static final Logger LOG = LoggerFactory.getLogger(DynamicConfigurationFactory.class);

private final Map<String, DynamicDistributedLogConfiguration> dynamicConfigs;
private final List<ConfigurationSubscription> subscriptions;
private final ScheduledExecutorService executorService;
private final int reloadPeriod;
private final TimeUnit reloadUnit;
Expand All @@ -60,7 +59,6 @@ public DynamicConfigurationFactory(ScheduledExecutorService executorService,
this.reloadPeriod = reloadPeriod;
this.reloadUnit = reloadUnit;
this.dynamicConfigs = new HashMap<String, DynamicDistributedLogConfiguration>();
this.subscriptions = new LinkedList<ConfigurationSubscription>();
}

public synchronized Optional<DynamicDistributedLogConfiguration> getDynamicConfiguration(
Expand All @@ -77,7 +75,6 @@ public synchronized Optional<DynamicDistributedLogConfiguration> getDynamicConfi
List<FileConfigurationBuilder> fileConfigBuilders = Lists.newArrayList(properties);
ConfigurationSubscription subscription = new ConfigurationSubscription(
dynConf, fileConfigBuilders, executorService, reloadPeriod, reloadUnit);
subscriptions.add(subscription);
dynamicConfigs.put(configPath, dynConf);
LOG.info("Loaded dynamic configuration at {}", configPath);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ public void tailContainerLog() {
}

public String getContainerLog() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might hides a bug? After refactor, it seems meaningless.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, the nethod was unused. I can remove it if you agree

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this method

StringBuilder sb = new StringBuilder();

LogContainerCmd logContainerCmd = this.dockerClient.logContainerCmd(this.getContainerId());
logContainerCmd.withStdOut(true).withStdErr(true);
Expand All @@ -94,7 +93,7 @@ public String getContainerLog() {
} catch (InterruptedException e) {

}
return sb.toString();
return "";
}

public ExecResult execCmd(String... cmd) throws Exception {
Expand Down
Loading