Code example for ScheduledThreadPoolExecutor

Methods: shutdownNow

0
    private long rebuildIndexTimeInterval = QueryServicesOptions.DEFAULT_INDEX_FAILURE_HANDLING_REBUILD_INTERVAL;
   
    @Override 
    public void preClose(final ObserverContext<RegionCoprocessorEnvironment> c,
            boolean abortRequested) {
        executor.shutdownNow();
        GlobalCache.getInstance(c.getEnvironment()).getMetaDataCache().invalidateAll();
    } 
     
    @Override 
    public void start(CoprocessorEnvironment env) throws IOException {
        // sleep a little bit to compensate time clock skew when SYSTEM.CATALOG moves  
        // among region servers because we relies on server time of RS which is hosting 
        // SYSTEM.CATALOG 
        long sleepTime = env.getConfiguration().getLong(QueryServices.CLOCK_SKEW_INTERVAL_ATTRIB, 
            QueryServicesOptions.DEFAULT_CLOCK_SKEW_INTERVAL); 
        try { 
            if(sleepTime > 0) {
                Thread.sleep(sleepTime);
            } 
Connect your IDE to all the code out there  Get Codota for Java