@Test public void testTableStats() throws IOException, BlurException, TException { _thriftCache.clear(); assertEquals(0, _thriftCache.getMisses()); assertEquals(0, _thriftCache.getHits()); TableStats tableStats1 = _thriftCacheServer.tableStats(_table); assertEquals(1, _thriftCache.getMisses()); assertEquals(0, _thriftCache.getHits()); TableStats tableStats2 = _thriftCacheServer.tableStats(_table); assertEquals(1, _thriftCache.getMisses()); assertEquals(1, _thriftCache.getHits()); assertFalse(tableStats1 == tableStats2); assertEquals(tableStats1, tableStats2); }
@Override public TableStats tableStats(String table) throws BlurException, TException { ThriftCacheKey<TableStats> key = _thriftCache.getKey(table, getShards(table), null, TableStats.class); Lock lock = getOrCreateLock(key); try { lock.lock(); TableStats results = _thriftCache.get(key, TableStats.class); if (results != null) { return results; } return _thriftCache.put(key, super.tableStats(table)); } finally { lock.unlock(); } }
ThriftCacheServer extends FilteredBlurServer { @Override public TableStats tableStats(String table) throws BlurException, TException { ThriftCacheKey<TableStats> key = _thriftCache.getKey(table, getShards(table), null, TableStats.class); Lock lock = getOrCreateLock(key); try { lock.lock(); TableStats results = _thriftCache.get(key, TableStats.class); if (results != null) { return results; } return _thriftCache.put(key, super.tableStats(table)); } finally { lock.unlock(); } } }
ThriftCacheServer extends FilteredBlurServer { @Override public TableStats tableStats(String table) throws BlurException, TException { ThriftCacheKey<TableStats> key = _thriftCache.getKey(table, getShards(table), null, TableStats.class); Lock lock = getOrCreateLock(key); try { lock.lock(); TableStats results = _thriftCache.get(key, TableStats.class); if (results != null) { return results; } return _thriftCache.put(key, super.tableStats(table)); } finally { lock.unlock(); } } ThriftCacheServer(BlurConfiguration configuration, Iface iface, IndexServer indexServer,
      ThriftCache thriftCache); }
ThriftCacheServer extends FilteredBlurServer { @Override public TableStats tableStats(String table) throws BlurException, TException { ThriftCacheKey<TableStats> key = _thriftCache.getKey(table, getShards(table), null, TableStats.class); Lock lock = getOrCreateLock(key); try { lock.lock(); TableStats results = _thriftCache.get(key, TableStats.class); if (results != null) { return results; } return _thriftCache.put(key, super.tableStats(table)); } finally { lock.unlock(); } } ThriftCacheServer(BlurConfiguration configuration, Iface iface, IndexServer indexServer,
      ThriftCache thriftCache); @Override void loadIndex(String table, List<String> externalIndexPaths); @Override TableStats tableStats(String table); @Override BlurResults query(String table, BlurQuery blurQuery); @Override FetchResult fetchRow(String table, Selector selector); @Override List<FetchResult> fetchRowBatch(String table, List<Selector> selectors); }
ThriftCacheServer extends FilteredBlurServer { @Override public TableStats tableStats(String table) throws BlurException, TException { ThriftCacheKey<TableStats> key = _thriftCache.getKey(table, getShards(table), null, TableStats.class); Lock lock = getOrCreateLock(key); try { lock.lock(); TableStats results = _thriftCache.get(key, TableStats.class); if (results != null) { return results; } return _thriftCache.put(key, super.tableStats(table)); } finally { lock.unlock(); } } ThriftCacheServer(BlurConfiguration configuration, Iface iface, IndexServer indexServer,
      ThriftCache thriftCache); @Override void loadIndex(String table, List<String> externalIndexPaths); @Override TableStats tableStats(String table); @Override BlurResults query(String table, BlurQuery blurQuery); @Override FetchResult fetchRow(String table, Selector selector); @Override List<FetchResult> fetchRowBatch(String table, List<Selector> selectors);  }