/** * @return true if @param key is contained in the row cache */ public boolean containsCachedParition(DecoratedKey key) { return CacheService.instance.rowCache.getCapacity() != 0 && CacheService.instance.rowCache.containsKey(new RowCacheKey(metadata.ksAndCFName, key)); }
/** * @return true if @param key is contained in the row cache */ public boolean containsCachedParition(DecoratedKey key) { return CacheService.instance.rowCache.getCapacity() != 0 && CacheService.instance.rowCache.containsKey(new RowCacheKey(metadata.ksAndCFName, key)); }
public void invalidateCachedPartition(DecoratedKey key) { if (!isRowCacheEnabled()) return; invalidateCachedPartition(new RowCacheKey(metadata.ksAndCFName, key)); }
/** * @return true if @param key is contained in the row cache */ public boolean containsCachedParition(DecoratedKey key) { return CacheService.instance.rowCache.getCapacity() != 0 && CacheService.instance.rowCache.containsKey(new RowCacheKey(metadata.ksAndCFName, key)); }
public void invalidateCachedPartition(DecoratedKey key) { if (!isRowCacheEnabled()) return; invalidateCachedPartition(new RowCacheKey(metadata.ksAndCFName, key)); }
public void invalidateCachedPartition(DecoratedKey key) { if (!isRowCacheEnabled()) return; invalidateCachedPartition(new RowCacheKey(metadata.ksAndCFName, key)); }
public void maybeUpdateRowCache(DecoratedKey key) { if (!isRowCacheEnabled()) return; RowCacheKey cacheKey = new RowCacheKey(metadata.ksAndCFName, key); invalidateCachedRow(cacheKey); }
/** * @return true if @param key is contained in the row cache */ public boolean containsCachedRow(DecoratedKey key) { return CacheService.instance.rowCache.getCapacity() != 0 && CacheService.instance.rowCache.containsKey(new RowCacheKey(metadata.ksAndCFName, key)); }
/** * @return the cached partition for @param key if it is already present in the cache. * Not that this will not readAndCache the parition if it is not present, nor * are these calls counted in cache statistics. * * Note that this WILL cause deserialization of a SerializingCache partition, so if all you * need to know is whether a partition is present or not, use containsCachedParition instead. */ public CachedPartition getRawCachedPartition(DecoratedKey key) { if (!isRowCacheEnabled()) return null; IRowCacheEntry cached = CacheService.instance.rowCache.getInternal(new RowCacheKey(metadata.ksAndCFName, key)); return cached == null || cached instanceof RowCacheSentinel ? null : (CachedPartition)cached; }
/** * @return the cached partition for @param key if it is already present in the cache. * Not that this will not readAndCache the parition if it is not present, nor * are these calls counted in cache statistics. * * Note that this WILL cause deserialization of a SerializingCache partition, so if all you * need to know is whether a partition is present or not, use containsCachedParition instead. */ public CachedPartition getRawCachedPartition(DecoratedKey key) { if (!isRowCacheEnabled()) return null; IRowCacheEntry cached = CacheService.instance.rowCache.getInternal(new RowCacheKey(metadata.ksAndCFName, key)); return cached == null || cached instanceof RowCacheSentinel ? null : (CachedPartition)cached; }
/** * @return the cached partition for @param key if it is already present in the cache. * Not that this will not readAndCache the parition if it is not present, nor * are these calls counted in cache statistics. * * Note that this WILL cause deserialization of a SerializingCache partition, so if all you * need to know is whether a partition is present or not, use containsCachedParition instead. */ public CachedPartition getRawCachedPartition(DecoratedKey key) { if (!isRowCacheEnabled()) return null; IRowCacheEntry cached = CacheService.instance.rowCache.getInternal(new RowCacheKey(metadata.ksAndCFName, key)); return cached == null || cached instanceof RowCacheSentinel ? null : (CachedPartition)cached; }
/** * @return the cached row for @param key if it is already present in the cache. * That is, unlike getThroughCache, it will not readAndCache the row if it is not present, nor * are these calls counted in cache statistics. * * Note that this WILL cause deserialization of a SerializingCache row, so if all you * need to know is whether a row is present or not, use containsCachedRow instead. */ public ColumnFamily getRawCachedRow(DecoratedKey key) { if (!isRowCacheEnabled()) return null; IRowCacheEntry cached = CacheService.instance.rowCache.getInternal(new RowCacheKey(metadata.ksAndCFName, key)); return cached == null || cached instanceof RowCacheSentinel ? null : (ColumnFamily)cached; }
public RowCacheKey deserialize(ByteBuffer buf) { @SuppressWarnings("resource") DataInputBuffer dataInput = new DataInputBuffer(buf, false); String ksName = null; String cfName = null; try { ksName = dataInput.readUTF(); cfName = dataInput.readUTF(); } catch (IOException e) { throw new RuntimeException(e); } byte[] key = new byte[buf.getInt()]; buf.get(key); return new RowCacheKey(Pair.create(ksName, cfName), key); }
public RowCacheKey deserialize(ByteBuffer buf) { @SuppressWarnings("resource") DataInputBuffer dataInput = new DataInputBuffer(buf, false); String ksName = null; String cfName = null; try { ksName = dataInput.readUTF(); cfName = dataInput.readUTF(); } catch (IOException e) { throw new RuntimeException(e); } byte[] key = new byte[buf.getInt()]; buf.get(key); return new RowCacheKey(Pair.create(ksName, cfName), key); }
public RowCacheKey deserialize(ByteBuffer buf) { @SuppressWarnings("resource") DataInputBuffer dataInput = new DataInputBuffer(buf, false); String ksName = null; String cfName = null; try { ksName = dataInput.readUTF(); cfName = dataInput.readUTF(); } catch (IOException e) { throw new RuntimeException(e); } byte[] key = new byte[buf.getInt()]; buf.get(key); return new RowCacheKey(Pair.create(ksName, cfName), key); }
public void invalidateCachedRow(DecoratedKey key) { UUID cfId = Schema.instance.getId(keyspace.getName(), this.name); if (cfId == null) return; // secondary index invalidateCachedRow(new RowCacheKey(metadata.ksAndCFName, key)); }
public Pair<RowCacheKey, IRowCacheEntry> call() throws Exception { DecoratedKey key = cfs.partitioner.decorateKey(buffer); QueryFilter cacheFilter = new QueryFilter(key, cfs.getColumnFamilyName(), cfs.readFilterForCache(), Integer.MIN_VALUE); ColumnFamily data = cfs.getTopLevelColumns(cacheFilter, Integer.MIN_VALUE); return Pair.create(new RowCacheKey(cfs.metadata.ksAndCFName, key), (IRowCacheEntry) data); } });
public Pair<RowCacheKey, IRowCacheEntry> call() throws Exception { DecoratedKey key = cfs.decorateKey(buffer); int nowInSec = FBUtilities.nowInSeconds(); SinglePartitionReadCommand cmd = SinglePartitionReadCommand.fullPartitionRead(cfs.metadata, nowInSec, key); try (ReadExecutionController controller = cmd.executionController(); UnfilteredRowIterator iter = cmd.queryMemtableAndDisk(cfs, controller)) { CachedPartition toCache = CachedBTreePartition.create(DataLimits.cqlLimits(rowsToCache).filter(iter, nowInSec, true), nowInSec); return Pair.create(new RowCacheKey(cfs.metadata.ksAndCFName, key), (IRowCacheEntry)toCache); } } });
public Pair<RowCacheKey, IRowCacheEntry> call() throws Exception { DecoratedKey key = cfs.decorateKey(buffer); int nowInSec = FBUtilities.nowInSeconds(); SinglePartitionReadCommand cmd = SinglePartitionReadCommand.fullPartitionRead(cfs.metadata, nowInSec, key); try (ReadExecutionController controller = cmd.executionController(); UnfilteredRowIterator iter = cmd.queryMemtableAndDisk(cfs, controller)) { CachedPartition toCache = CachedBTreePartition.create(DataLimits.cqlLimits(rowsToCache).filter(iter, nowInSec, true), nowInSec); return Pair.create(new RowCacheKey(cfs.metadata.ksAndCFName, key), (IRowCacheEntry)toCache); } } });
public Pair<RowCacheKey, IRowCacheEntry> call() throws Exception { DecoratedKey key = cfs.decorateKey(buffer); int nowInSec = FBUtilities.nowInSeconds(); SinglePartitionReadCommand cmd = SinglePartitionReadCommand.fullPartitionRead(cfs.metadata, nowInSec, key); try (ReadExecutionController controller = cmd.executionController(); UnfilteredRowIterator iter = cmd.queryMemtableAndDisk(cfs, controller)) { CachedPartition toCache = CachedBTreePartition.create(DataLimits.cqlLimits(rowsToCache).filter(iter, nowInSec, true), nowInSec); return Pair.create(new RowCacheKey(cfs.metadata.ksAndCFName, key), (IRowCacheEntry)toCache); } } });