You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "Josh Elser (JIRA)" <ji...@apache.org> on 2015/05/31 20:12:17 UTC
[jira] [Created] (ACCUMULO-3875) Unnecessary synchronization and
conditionals in MiniAccumuloClusterControl
Josh Elser created ACCUMULO-3875:
------------------------------------
Summary: Unnecessary synchronization and conditionals in MiniAccumuloClusterControl
Key: ACCUMULO-3875
URL: https://issues.apache.org/jira/browse/ACCUMULO-3875
Project: Accumulo
Issue Type: Bug
Components: mini
Affects Versions: 1.7.0
Reporter: Josh Elser
Assignee: Josh Elser
Fix For: 1.6.3, 1.7.1, 1.8.0
MiniAccumuloClusterControl has a few areas that could be cleaned up
The following null check on {{tabletServerProcesses}} is unnecessary.
{code}
case TABLET_SERVER:
if (tabletServerProcesses != null) {
synchronized (tabletServerProcesses) {
try {
for (Process tserver : tabletServerProcesses) {
try {
cluster.stopProcessWithTimeout(tserver, 30, TimeUnit.SECONDS);
} catch (ExecutionException e) {
log.warn("TabletServer did not fully stop after 30 seconds", e);
} catch (TimeoutException e) {
log.warn("TabletServer did not fully stop after 30 seconds", e);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
} finally {
tabletServerProcesses.clear();
}
}
}
break;
{code}
{{tabletServerProcesses}} should probably be {{final}} and likely does not need to be a {{synchronizedList}} because the data structure is used for synchronization before each access anyways.
{code}
List<Process> tabletServerProcesses = Collections.synchronizedList(new ArrayList<Process>());
{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)