Description
MiniAccumuloClusterControl has a few areas that could be cleaned up
The following null check on tabletServerProcesses is unnecessary.
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;
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.
List<Process> tabletServerProcesses = Collections.synchronizedList(new ArrayList<Process>());