Package com.nearinfinity.honeycomb.hbase.rowkey

Examples of com.nearinfinity.honeycomb.hbase.rowkey.DataRowKey


            tableIdGen = generator;
        }

        @Override
        public RowKey next() {
            return new DataRowKey(tableIdGen.next(), uuidGen.next());
        }
View Full Code Here


        HBaseOperations.performDelete(hTable, mutationFactory.delete(tableId, row));
    }

    @Override
    public void deleteAllRows() {
        deleteRowsInRange(new DataRowKey(tableId).encode(), new DataRowKey(tableId + 1).encode());
        deleteRowsInRange(
                IndexRowKeyBuilder.newBuilder(tableId, 0).withSortOrder(SortOrder.Ascending).build().encode(),
                IndexRowKeyBuilder.newBuilder(tableId + 1, 0).withSortOrder(SortOrder.Ascending).build().encode());
        deleteRowsInRange(
                IndexRowKeyBuilder.newBuilder(tableId, 0).withSortOrder(SortOrder.Descending).build().encode(),
View Full Code Here

        HBaseOperations.performFlush(hTable);
    }

    @Override
    public Row getRow(UUID uuid) {
        DataRowKey dataRow = new DataRowKey(tableId, uuid);
        Get get = new Get(dataRow.encode());
        Result result = HBaseOperations.performGet(hTable, get);
        if (result.isEmpty()) {
            throw new RowNotFoundException(uuid);
        }
        return Row.deserialize(result.getValue(columnFamily.getBytes(), new byte[0]));
View Full Code Here

        return Row.deserialize(result.getValue(columnFamily.getBytes(), new byte[0]));
    }

    @Override
    public Scanner tableScan() {
        DataRowKey startRow = new DataRowKey(tableId);
        DataRowKey endRow = new DataRowKey(tableId + 1);
        return createScannerForRange(startRow.encode(), endRow.encode());
    }
View Full Code Here

        final byte[] serializedRow = row.serialize();
        final UUID uuid = row.getUUID();
        final ImmutableList.Builder<Put> puts = ImmutableList.builder();

        puts.add(emptyQualifierPut(new DataRowKey(tableId, uuid), serializedRow));
        puts.addAll(insertIndices(tableId, row, indices));

        return puts.build();
    }
View Full Code Here

     * @param row
     * @return The list of delete mutations
     */
    public List<Delete> delete(long tableId, final Row row) {
        List<Delete> deletes = deleteIndices(tableId, row);
        deletes.add(new Delete(new DataRowKey(tableId, row.getUUID()).encode()));
        return deletes;
    }
View Full Code Here

TOP

Related Classes of com.nearinfinity.honeycomb.hbase.rowkey.DataRowKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.