Source:
public ConnectionQueryServicesImpl(QueryServices services, final Configuration config) throws SQLException { super(services); this.config = config; try { this.connection = HConnectionManager.createConnection(config); } catch (ZooKeeperConnectionException e) { throw new SQLExceptionInfo.Builder(SQLExceptionCodeEnum.CANNOT_CONNECT_TO_ZOOKEEPER) .setRootCause(e).build().buildException(); } if (this.connection.isClosed()) { throw new SQLExceptionInfo.Builder(SQLExceptionCodeEnum.CANNOT_ESTABLISH_CONNECTION).build().buildException(); } this.childServices = new ConcurrentHashMap<ImmutableBytesWritable,ConnectionQueryServices>(INITIAL_CHILD_SERVICES_CAPACITY); int statsUpdateFrequencyMs = this.getConfig().getInt(QueryServices.STATS_UPDATE_FREQ_MS_ATTRIB, QueryServicesOptions.DEFAULT_STATS_UPDATE_FREQ_MS); int maxStatsAgeMs = this.getConfig().getInt(QueryServices.MAX_STATS_AGE_MS_ATTRIB, QueryServicesOptions.DEFAULT_MAX_STATS_AGE_MS); this.statsManager = new StatsManagerImpl(this, statsUpdateFrequencyMs, maxStatsAgeMs); tableRegionCache = CacheBuilder.newBuilder(). expireAfterAccess(this.getConfig().getLong(QueryServices.REGION_BOUNDARY_CACHE_TTL_MS_ATTRIB,QueryServicesOptions.DEFAULT_REGION_BOUNDARY_CACHE_TTL_MS), TimeUnit.MILLISECONDS) .removalListener(new RemovalListener<TableRef, SortedSet<HRegionInfo>>(){ @Override public void onRemoval(RemovalNotification<TableRef, SortedSet<HRegionInfo>> notification) { logger.info("REMOVE: {}", notification.getKey()); } }) .build(new CacheLoader<TableRef,SortedSet<HRegionInfo>>(){ @Override public SortedSet<HRegionInfo> load(TableRef key) throws Exception { logger.info("LOAD: {}", key); return MetaScanner.allTableRegions(config, key.getTableName(), false).navigableKeySet(); } }); }

Target:
public ConnectionQueryServicesImpl(QueryServices services, final Configuration config) throws SQLException { super(services); this.config = config; try { this.connection = HConnectionManager.createConnection(config); } catch (ZooKeeperConnectionException e) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.CANNOT_ESTABLISH_CONNECTION) .setRootCause(e).build().buildException(); } if (this.connection.isClosed()) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.CANNOT_ESTABLISH_CONNECTION).build().buildException(); } this.childServices = new ConcurrentHashMap<ImmutableBytesWritable,ConnectionQueryServices>(INITIAL_CHILD_SERVICES_CAPACITY); int statsUpdateFrequencyMs = this.getConfig().getInt(QueryServices.STATS_UPDATE_FREQ_MS_ATTRIB, QueryServicesOptions.DEFAULT_STATS_UPDATE_FREQ_MS); int maxStatsAgeMs = this.getConfig().getInt(QueryServices.MAX_STATS_AGE_MS_ATTRIB, QueryServicesOptions.DEFAULT_MAX_STATS_AGE_MS); this.statsManager = new StatsManagerImpl(this, statsUpdateFrequencyMs, maxStatsAgeMs); tableRegionCache = CacheBuilder.newBuilder(). expireAfterAccess(this.getConfig().getLong(QueryServices.REGION_BOUNDARY_CACHE_TTL_MS_ATTRIB,QueryServicesOptions.DEFAULT_REGION_BOUNDARY_CACHE_TTL_MS), TimeUnit.MILLISECONDS) .removalListener(new RemovalListener<TableRef, SortedSet<HRegionInfo>>(){ @Override public void onRemoval(RemovalNotification<TableRef, SortedSet<HRegionInfo>> notification) { logger.info("REMOVE: {}", notification.getKey()); } }) .build(new CacheLoader<TableRef,SortedSet<HRegionInfo>>(){ @Override public SortedSet<HRegionInfo> load(TableRef key) throws Exception { logger.info("LOAD: {}", key); return MetaScanner.allTableRegions(config, key.getTableName(), false).navigableKeySet(); } }); }