@Override public Object generate(TableGeneratorDiscriptor discriptor, ClientBase client, String dataType) { try { HTableInterface hTable = ((HBaseDataHandler) ((HBaseClient) client).handler).gethTable(discriptor .getSchema()); Long latestCount = hTable.incrementColumnValue(discriptor.getPkColumnValue().getBytes(), discriptor .getTable().getBytes(), discriptor.getValueColumnName().getBytes(), 1); if (latestCount == 1) { return (long) discriptor.getInitialValue(); } else if (discriptor.getAllocationSize() == 1) { return latestCount + discriptor.getInitialValue(); } else { return (latestCount - 1) * discriptor.getAllocationSize() + discriptor.getInitialValue(); } } catch (IOException ioex) { log.error("Error while generating id for entity, Caused by: .", ioex); throw new KunderaException(ioex); } } }
@Override public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount) throws IOException { return table.incrementColumnValue(row, family, qualifier, amount); }
@Override 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 runWith(HTableInterface hTable) throws IOException { return hTable.incrementColumnValue(row, cf, qual, amount); } });
@Override public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount, Durability durability) throws IOException { if (allowNonTransactional) { return hTable.incrementColumnValue(row, family, qualifier, amount, durability); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount) throws IOException { if (allowNonTransactional) { return hTable.incrementColumnValue(row, family, qualifier, amount); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount, boolean writeToWAL) throws IOException { if (allowNonTransactional) { return hTable.incrementColumnValue(row, family, qualifier, amount, writeToWAL); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount, Durability durability) throws IOException { if (allowNonTransactional) { return hTable.incrementColumnValue(row, family, qualifier, amount, durability); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount, Durability durability) throws IOException { if (allowNonTransactional) { return hTable.incrementColumnValue(row, family, qualifier, amount, durability); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount, boolean writeToWAL) throws IOException { if (allowNonTransactional) { return hTable.incrementColumnValue(row, family, qualifier, amount, writeToWAL); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount, Durability durability) throws IOException { if (allowNonTransactional) { return hTable.incrementColumnValue(row, family, qualifier, amount, durability); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount) throws IOException { if (allowNonTransactional) { return hTable.incrementColumnValue(row, family, qualifier, amount); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount, Durability durability) throws IOException { if (allowNonTransactional) { return hTable.incrementColumnValue(row, family, qualifier, amount, durability); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount, boolean writeToWAL) throws IOException { if (allowNonTransactional) { return hTable.incrementColumnValue(row, family, qualifier, amount, writeToWAL); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount) throws IOException { if (allowNonTransactional) { return hTable.incrementColumnValue(row, family, qualifier, amount); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount, boolean writeToWAL) throws IOException { if (allowNonTransactional) { return hTable.incrementColumnValue(row, family, qualifier, amount, writeToWAL); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount, boolean writeToWAL) throws IOException { if (allowNonTransactional) { return hTable.incrementColumnValue(row, family, qualifier, amount, writeToWAL); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount) throws IOException { if (allowNonTransactional) { return hTable.incrementColumnValue(row, family, qualifier, amount); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount) throws IOException { if (allowNonTransactional) { return hTable.incrementColumnValue(row, family, qualifier, amount); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }
@Override public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount) throws IOException { if (allowNonTransactional) { return hTable.incrementColumnValue(row, family, qualifier, amount); } else { throw new UnsupportedOperationException("Operation is not supported transactionally"); } }