@Override public long incrementColumnValue(final byte [] row, final byte [] family, final byte [] qualifier, final long amount) throws IOException { return incrementColumnValue(row, family, qualifier, amount, Durability.SYNC_WAL); }
@Override public long incrementColumnValue(final byte [] row, final byte [] family, final byte [] qualifier, final long amount) throws IOException { return incrementColumnValue(row, family, qualifier, amount, Durability.SYNC_WAL); }
@Override public long incrementColumnValue(final byte [] row, final byte [] family, final byte [] qualifier, final long amount) throws IOException { return incrementColumnValue(row, family, qualifier, amount, Durability.SYNC_WAL); }
/** * {@inheritDoc} */ @Override public long incrementColumnValue(final byte [] row, final byte [] family, final byte [] qualifier, final long amount) throws IOException { return incrementColumnValue(row, family, qualifier, amount, true); }
public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount, boolean writeToWAL) throws IOException { return table.incrementColumnValue(row, family, qualifier, amount, writeToWAL); }
@Override public Long call() throws IOException { return normalHTable.incrementColumnValue(row, family, qualifier, amount); } });
@Override public Long call() throws IOException { return normalHTable.incrementColumnValue(row, family, qualifier, amount, writeToWAL); } });
/** * {@inheritDoc} */ @Override public long incrementColumnValue(final byte [] row, final byte [] family, final byte [] qualifier, final long amount) throws IOException { return incrementColumnValue(row, family, qualifier, amount, Durability.SYNC_WAL); }
public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount) throws IOException { return table.incrementColumnValue(row, family, qualifier, amount); }
/** * @deprecated As of release 0.96 * (<a href="https://issues.apache.org/jira/browse/HBASE-9508">HBASE-9508</a>). * This will be removed in HBase 2.0.0. * Use {@link #incrementColumnValue(byte[], byte[], byte[], long, Durability)}. */ @Deprecated @Override public long incrementColumnValue(final byte [] row, final byte [] family, final byte [] qualifier, final long amount, final boolean writeToWAL) throws IOException { return incrementColumnValue(row, family, qualifier, amount, writeToWAL? Durability.SYNC_WAL: Durability.SKIP_WAL); }
@Override public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount, boolean writeToWAL) throws IOException { return getTable().incrementColumnValue(row, family, qualifier, amount, writeToWAL); }
@Override public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount) throws IOException { return getTable().incrementColumnValue(row, family, qualifier, amount); }
public static void main(String[] args) throws Exception { Configuration conf = HBaseConfiguration.create(); HTable table = new HTable(conf, "counters"); long current = table.incrementColumnValue(Bytes.toBytes("20110705"), Bytes.toBytes("daily"), Bytes.toBytes("hits"), 1L); System.out.println("current = " + current); } }
protected long atomicIncrement(ByteBuffer tableName, ByteBuffer row, byte [] family, byte [] qualifier, long amount) throws IOError, IllegalArgument, TException { HTable table; try { table = getTable(tableName); return table.incrementColumnValue( getBytes(row), family, qualifier, amount); } catch (IOException e) { LOG.warn(e.getMessage(), e); throw new IOError(e.getMessage()); } }
connector.getTable().incrementColumnValue(inc.getRow(), e.getKey(), c.getKey(), c.getValue(), conf.isWriteToWAL()); } catch (IOException ex) {
@Override public Integer call() throws Exception { int failures = 0; Set<FullyQualifiedRow> keys = countersMap.keySet(); for (FullyQualifiedRow row : keys) { Long counter = countersMap.remove(row); if (counter == null) { continue; } try { HTable table = handler.getTable(row.getTable()); if (failures > 2) { throw new IOException("Auto-Fail rest of ICVs"); } table.incrementColumnValue(row.getRowKey(), row.getFamily(), row.getQualifier(), counter); } catch (IOException e) { // log failure of increment failures++; LOG.error("FAILED_ICV: " + Bytes.toString(row.getTable()) + ", " + Bytes.toStringBinary(row.getRowKey()) + ", " + Bytes.toStringBinary(row.getFamily()) + ", " + Bytes.toStringBinary(row.getQualifier()) + ", " + counter); } } return failures; } };