/** {@inheritDoc} */ @Override public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount) throws IOException { LOG.trace("incrementColumnValue(byte[], byte[], byte[], long)"); try ( Scope scope = TRACER.spanBuilder("BigtableTable.incrementColumnValue").startScopedSpan()) { Increment incr = new Increment(row); incr.addColumn(family, qualifier, amount); Result result = increment(incr); Cell cell = result.getColumnLatestCell(family, qualifier); if (cell == null) { LOG.error("Failed to find a incremented value in result of increment"); throw new IOException( makeGenericExceptionMessage( "increment", options.getProjectId(), tableName.getQualifierAsString(), row)); } return Bytes.toLong(CellUtil.cloneValue(cell)); } }
/** {@inheritDoc} */ @Override public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount) throws IOException { LOG.trace("incrementColumnValue(byte[], byte[], byte[], long)"); try ( Scope scope = TRACER.spanBuilder("BigtableTable.incrementColumnValue").startScopedSpan()) { Increment incr = new Increment(row); incr.addColumn(family, qualifier, amount); Result result = increment(incr); Cell cell = result.getColumnLatestCell(family, qualifier); if (cell == null) { LOG.error("Failed to find a incremented value in result of increment"); throw new IOException( makeGenericExceptionMessage( "increment", options.getProjectId(), tableName.getQualifierAsString(), row)); } return Bytes.toLong(CellUtil.cloneValue(cell)); } }