public TransactorCache(Environment env) { final FluoConfiguration conf = env.getConfiguration(); timeoutCache = CacheBuilder.newBuilder().maximumSize(FluoConfigurationImpl.getTransactorMaxCacheSize(conf)) .expireAfterAccess( FluoConfigurationImpl.getTransactorCacheTimeout(conf, TimeUnit.MILLISECONDS), TimeUnit.MILLISECONDS) .concurrencyLevel(10).build(); this.env = env; cache = new PathChildrenCache(env.getSharedResources().getCurator(), ZookeeperPath.TRANSACTOR_NODES, true); try { cache.start(StartMode.BUILD_INITIAL_CACHE); status = TcStatus.OPEN; } catch (Exception e) { throw new RuntimeException(e); } }
public TransactorCache(Environment env) { final FluoConfiguration conf = env.getConfiguration(); timeoutCache = CacheBuilder.newBuilder().maximumSize(FluoConfigurationImpl.getTransactorMaxCacheSize(conf)) .expireAfterAccess( FluoConfigurationImpl.getTransactorCacheTimeout(conf, TimeUnit.MILLISECONDS), TimeUnit.MILLISECONDS) .concurrencyLevel(10).build(); this.env = env; cache = new PathChildrenCache(env.getSharedResources().getCurator(), ZookeeperPath.TRANSACTOR_NODES, true); try { cache.start(StartMode.BUILD_INITIAL_CACHE); status = TcStatus.OPEN; } catch (Exception e) { throw new RuntimeException(e); } }