public CommitLogArchiver(String archiveCommand, String restoreCommand, String restoreDirectories, long restorePointInTime, TimeUnit precision) { this.archiveCommand = archiveCommand; this.restoreCommand = restoreCommand; this.restoreDirectories = restoreDirectories; this.restorePointInTime = restorePointInTime; this.precision = precision; executor = !Strings.isNullOrEmpty(archiveCommand) ? new JMXEnabledThreadPoolExecutor("CommitLogArchiver") : null; }
protected void beforeExecute(Thread t, Runnable r) { // can't set this in Thread factory, so we do it redundantly here isCompactionManager.set(true); super.beforeExecute(t, r); }
public int getCoreThreads() { return getCorePoolSize(); }
@Override public synchronized List<Runnable> shutdownNow() { // synchronized, because there is no way to access super.mainLock, which would be // the preferred way to make this threadsafe if (!isShutdown()) { unregisterMBean(); } return super.shutdownNow(); }
public PendingRangeCalculatorService() { executor.setRejectedExecutionHandler(new RejectedExecutionHandler() { public void rejectedExecution(Runnable r, ThreadPoolExecutor e) { PendingRangeCalculatorService.instance.finishUpdate(); } } ); }
public void update() { updateJobs.incrementAndGet(); executor.submit(new PendingRangeTask()); }
public void setCoreThreads(int number) { setCorePoolSize(number); }
public int getMaximumThreads() { return getMaximumPoolSize(); }
public void setMaximumThreads(int number) { setMaximumPoolSize(number); }
@Override public synchronized void shutdown() { // synchronized, because there is no way to access super.mainLock, which would be // the preferred way to make this threadsafe if (!isShutdown()) { unregisterMBean(); } super.shutdown(); }
public PendingRangeCalculatorService() { executor.setRejectedExecutionHandler(new RejectedExecutionHandler() { public void rejectedExecution(Runnable r, ThreadPoolExecutor e) { PendingRangeCalculatorService.instance.finishUpdate(); } } ); }
public void update() { updateJobs.incrementAndGet(); executor.submit(new PendingRangeTask()); }
public void setCoreThreads(int number) { setCorePoolSize(number); }
public int getMaximumThreads() { return getMaximumPoolSize(); }
public void setMaximumThreads(int number) { setMaximumPoolSize(number); }
@Override public synchronized void shutdown() { // synchronized, because there is no way to access super.mainLock, which would be // the preferred way to make this threadsafe if (!isShutdown()) { unregisterMBean(); } super.shutdown(); }
public CommitLogArchiver(String archiveCommand, String restoreCommand, String restoreDirectories, long restorePointInTime, TimeUnit precision) { this.archiveCommand = archiveCommand; this.restoreCommand = restoreCommand; this.restoreDirectories = restoreDirectories; this.restorePointInTime = restorePointInTime; this.precision = precision; executor = !Strings.isNullOrEmpty(archiveCommand) ? new JMXEnabledThreadPoolExecutor("CommitLogArchiver") : null; }
public PendingRangeCalculatorService() { executor.setRejectedExecutionHandler(new RejectedExecutionHandler() { public void rejectedExecution(Runnable r, ThreadPoolExecutor e) { PendingRangeCalculatorService.instance.finishUpdate(); } } ); }
protected void beforeExecute(Thread t, Runnable r) { // can't set this in Thread factory, so we do it redundantly here isCompactionManager.set(true); super.beforeExecute(t, r); }
public void update() { updateJobs.incrementAndGet(); executor.submit(new PendingRangeTask()); }