@Override public void updateResolvedTimestamp(PTable table, long resolvedTimestamp) throws SQLException { metaData.put(table.getKey(), tableRefFactory.makePTableRef(table, this.timeKeeper.getCurrentTime(), resolvedTimestamp)); }
metaData.put(parentTable.getKey(), tableRefFactory.makePTableRef(parentTable, this.timeKeeper.getCurrentTime(), parentTableRef.getResolvedTimeStamp())); break;
/** * Used when the cache is growing past its max size to clone in a single pass. * Removes least recently used tables to get size of cache below its max size by * the overage amount. */ public PMetaDataCache cloneMinusOverage(long overage) { assert(overage > 0); int nToRemove = Math.max(MIN_REMOVAL_SIZE, (int)Math.ceil((currentByteSize-maxByteSize) / ((double)currentByteSize / size())) + 1); MinMaxPriorityQueue<PTableRef> toRemove = BUILDER.expectedSize(nToRemove).create(); PMetaDataCache newCache = new PMetaDataCache(this.size(), this.maxByteSize, this.timeKeeper, this.tableRefFactory); long toRemoveBytes = 0; // Add to new cache, but track references to remove when done // to bring cache at least overage amount below it's max size. for (PTableRef tableRef : this.tables.values()) { newCache.put(tableRef.getTable().getKey(), tableRefFactory.makePTableRef(tableRef)); toRemove.add(tableRef); toRemoveBytes += tableRef.getEstimatedSize(); while (toRemoveBytes - toRemove.peekLast().getEstimatedSize() >= overage) { PTableRef removedRef = toRemove.removeLast(); toRemoveBytes -= removedRef.getEstimatedSize(); } } for (PTableRef toRemoveRef : toRemove) { newCache.remove(toRemoveRef.getTable().getKey()); } return newCache; }
.build(); tables.put(table.getKey(), tableRefFactory.makePTableRef(table, this.timeKeeper.getCurrentTime(), resolvedTime));
@Override public void updateResolvedTimestamp(PTable table, long resolvedTimestamp) throws SQLException { metaData.put(table.getKey(), tableRefFactory.makePTableRef(table, this.timeKeeper.getCurrentTime(), resolvedTimestamp)); }
@Override public void updateResolvedTimestamp(PTable table, long resolvedTimestamp) throws SQLException { metaData.put(table.getKey(), tableRefFactory.makePTableRef(table, this.timeKeeper.getCurrentTime(), resolvedTimestamp)); }
tableTimeStamp == HConstants.LATEST_TIMESTAMP ? parentTableRef.getTable().getTimeStamp() : tableTimeStamp, newIndexes); metaData.put(parentTable.getKey(), tableRefFactory.makePTableRef(parentTable, this.timeKeeper.getCurrentTime(), parentTableRef.getResolvedTimeStamp())); break;
metaData.put(parentTable.getKey(), tableRefFactory.makePTableRef(parentTable, this.timeKeeper.getCurrentTime(), parentTableRef.getResolvedTimeStamp())); break;
/** * Used when the cache is growing past its max size to clone in a single pass. * Removes least recently used tables to get size of cache below its max size by * the overage amount. */ public PMetaDataCache cloneMinusOverage(long overage) { assert(overage > 0); int nToRemove = Math.max(MIN_REMOVAL_SIZE, (int)Math.ceil((currentByteSize-maxByteSize) / ((double)currentByteSize / size())) + 1); MinMaxPriorityQueue<PTableRef> toRemove = BUILDER.expectedSize(nToRemove).create(); PMetaDataCache newCache = new PMetaDataCache(this.size(), this.maxByteSize, this.timeKeeper, this.tableRefFactory); long toRemoveBytes = 0; // Add to new cache, but track references to remove when done // to bring cache at least overage amount below it's max size. for (PTableRef tableRef : this.tables.values()) { newCache.put(tableRef.getTable().getKey(), tableRefFactory.makePTableRef(tableRef)); toRemove.add(tableRef); toRemoveBytes += tableRef.getEstimatedSize(); while (toRemoveBytes - toRemove.peekLast().getEstimatedSize() >= overage) { PTableRef removedRef = toRemove.removeLast(); toRemoveBytes -= removedRef.getEstimatedSize(); } } for (PTableRef toRemoveRef : toRemove) { newCache.remove(toRemoveRef.getTable().getKey()); } return newCache; }
/** * Used when the cache is growing past its max size to clone in a single pass. * Removes least recently used tables to get size of cache below its max size by * the overage amount. */ public PMetaDataCache cloneMinusOverage(long overage) { assert(overage > 0); int nToRemove = Math.max(MIN_REMOVAL_SIZE, (int)Math.ceil((currentByteSize-maxByteSize) / ((double)currentByteSize / size())) + 1); MinMaxPriorityQueue<PTableRef> toRemove = BUILDER.expectedSize(nToRemove).create(); PMetaDataCache newCache = new PMetaDataCache(this.size(), this.maxByteSize, this.timeKeeper, this.tableRefFactory); long toRemoveBytes = 0; // Add to new cache, but track references to remove when done // to bring cache at least overage amount below it's max size. for (PTableRef tableRef : this.tables.values()) { newCache.put(tableRef.getTable().getKey(), tableRefFactory.makePTableRef(tableRef)); toRemove.add(tableRef); toRemoveBytes += tableRef.getEstimatedSize(); while (toRemoveBytes - toRemove.peekLast().getEstimatedSize() >= overage) { PTableRef removedRef = toRemove.removeLast(); toRemoveBytes -= removedRef.getEstimatedSize(); } } for (PTableRef toRemoveRef : toRemove) { newCache.remove(toRemoveRef.getTable().getKey()); } return newCache; }
tables.put(table.getKey(), tableRefFactory.makePTableRef(table, this.timeKeeper.getCurrentTime(), resolvedTime));
.build(); tables.put(table.getKey(), tableRefFactory.makePTableRef(table, this.timeKeeper.getCurrentTime(), resolvedTime));