if (cells != null) { for (Cell cell : cells) { rowSizeSum += CellUtil.estimatedSerializedSizeOf(cell);
public static void incrementSizeProgress(ScannerContext sc, List<Cell> cells) { for (Cell cell : cells) { sc.incrementSizeProgress(CellUtil.estimatedSerializedSizeOf(cell), CellUtil.estimatedHeapSizeOf(cell)); } }
int length = (CellUtil.estimatedSerializedSizeOf(kv)) - Bytes.SIZEOF_INT; byte [] family = CellUtil.cloneFamily(kv); byte[] tableAndFamily = join(tableName, Bytes.toString(family));
while ((result = scanner.next()) != null) { for (Cell keyValue : result.rawCells()) { sizeBytes += CellUtil.estimatedSerializedSizeOf(keyValue); if (KeyValue.Type.codeToType(keyValue.getTypeByte()) == KeyValue.Type.Put) {
/** * @param cell * @return Estimate of the <code>cell</code> size in bytes. * @deprecated please use estimatedSerializedSizeOf(Cell) */ @Deprecated public static int estimatedSizeOf(final Cell cell) { return estimatedSerializedSizeOf(cell); }
protected void updateResultsMetrics(Result[] rrs) { if (this.scanMetrics == null || rrs == null || rrs.length == 0) { return; } long resultSize = 0; for (Result rr : rrs) { for (Cell cell : rr.rawCells()) { resultSize += CellUtil.estimatedSerializedSizeOf(cell); } } this.scanMetrics.countOfBytesInResults.addAndGet(resultSize); if (isRegionServerRemote) { this.scanMetrics.countOfBytesInRemoteResults.addAndGet(resultSize); } }
/** * This is an estimate of the heap space occupied by a cell. When the cell is of type * {@link HeapSize} we call {@link HeapSize#heapSize()} so cell can give a correct value. In other * cases we just consider the byte occupied by the cell components ie. row, CF, qualifier, * timestamp, type, value and tags. * @param cell * @return estimate of the heap space */ public static long estimatedHeapSizeOf(final Cell cell) { if (cell instanceof HeapSize) { return ((HeapSize) cell).heapSize(); } // TODO: Add sizing of references that hold the row, family, etc., arrays. return estimatedSerializedSizeOf(cell); }
/** * This is an estimate of the heap space occupied by a cell. When the cell is of type * {@link HeapSize} we call {@link HeapSize#heapSize()} so cell can give a correct value. In other * cases we just consider the bytes occupied by the cell components ie. row, CF, qualifier, * timestamp, type, value and tags. * @param cell * @return estimate of the heap space * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0. * Use {@link RawCell#getTags()} */ @Deprecated public static long estimatedHeapSizeOf(final Cell cell) { if (cell instanceof HeapSize) { return ((HeapSize) cell).heapSize(); } // TODO: Add sizing of references that hold the row, family, etc., arrays. return estimatedSerializedSizeOf(cell); }
/** * This is an estimate of the heap space occupied by a cell. When the cell is of type * {@link HeapSize} we call {@link HeapSize#heapSize()} so cell can give a correct value. In other * cases we just consider the bytes occupied by the cell components ie. row, CF, qualifier, * timestamp, type, value and tags. * @param cell * @return estimate of the heap space * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0. * Use {@link RawCell#getTags()} */ @Deprecated public static long estimatedHeapSizeOf(final Cell cell) { if (cell instanceof HeapSize) { return ((HeapSize) cell).heapSize(); } // TODO: Add sizing of references that hold the row, family, etc., arrays. return estimatedSerializedSizeOf(cell); }
@Override public long append(HTableDescriptor htd, HRegionInfo info, WALKey key, WALEdit edits, boolean inMemstore) { if (!this.listeners.isEmpty()) { final long start = System.nanoTime(); long len = 0; for (Cell cell : edits.getCells()) { len += CellUtil.estimatedSerializedSizeOf(cell); } final long elapsed = (System.nanoTime() - start)/1000000l; for (WALActionsListener listener : this.listeners) { listener.postAppend(len, elapsed); } } return -1; }
public static void incrementSizeProgress(ScannerContext sc, List<Cell> cells) { for (Cell cell : cells) { sc.incrementSizeProgress(CellUtil.estimatedSerializedSizeOf(cell), CellUtil.estimatedHeapSizeOf(cell)); } }
@Override public Result next() throws IOException { values.clear(); scanner.nextRaw(values); if (values.isEmpty()) { //we are done return null; } Result result = Result.create(values); if (this.scanMetrics != null) { long resultSize = 0; for (Cell cell : values) { resultSize += CellUtil.estimatedSerializedSizeOf(cell); } this.scanMetrics.countOfBytesInResults.addAndGet(resultSize); } return result; }
public static void incrementSizeProgress(ScannerContext sc, List<Cell> cells) { for (Cell cell : cells) { sc.incrementSizeProgress(CellUtil.estimatedSerializedSizeOf(cell), CellUtil.estimatedHeapSizeOf(cell)); } }
private long postAppend(final Entry e, final long elapsedTime) { long len = 0; if (!listeners.isEmpty()) { for (Cell cell : e.getEdit().getCells()) { len += CellUtil.estimatedSerializedSizeOf(cell); } for (WALActionsListener listener : listeners) { listener.postAppend(len, elapsedTime); } } return len; }
long totalSize = 0L; for (Cell cell : results) { totalSize += CellUtil.estimatedSerializedSizeOf(cell);
int length = (CellUtil.estimatedSerializedSizeOf(kv)) - Bytes.SIZEOF_INT; byte [] family = CellUtil.cloneFamily(kv); byte[] tableAndFamily = join(tableName, Bytes.toString(family));
int length = (CellUtil.estimatedSerializedSizeOf(kv)) - Bytes.SIZEOF_INT; byte [] family = CellUtil.cloneFamily(kv); byte[] tableAndFamily = join(tableName, Bytes.toString(family));
if (cells != null) { for (Cell cell : cells) { rowSizeSum += CellUtil.estimatedSerializedSizeOf(cell);
Cell c = scanner.peek(); if (c != null) { totalScannersSoughtBytes += CellUtil.estimatedSerializedSizeOf(c);
if (cells != null) { for (Cell cell : cells) { rowSizeSum += CellUtil.estimatedSerializedSizeOf(cell);