/** * Do a specific Get on passed <code>columnFamily</code> and column qualifiers. * @param mutation Mutation we are doing this Get for. * @param store Which column family on row (TODO: Go all Gets in one go) * @param coordinates Cells from <code>mutation</code> used as coordinates applied to Get. * @return Return list of Cells found. */ private List<Cell> get(Mutation mutation, HStore store, List<Cell> coordinates, IsolationLevel isolation, TimeRange tr) throws IOException { // Sort the cells so that they match the order that they appear in the Get results. Otherwise, // we won't be able to find the existing values if the cells are not specified in order by the // client since cells are in an array list. // TODO: I don't get why we are sorting. St.Ack 20150107 sort(coordinates, store.getComparator()); Get get = new Get(mutation.getRow()); if (isolation != null) { get.setIsolationLevel(isolation); } for (Cell cell: coordinates) { get.addColumn(store.getColumnFamilyDescriptor().getName(), CellUtil.cloneQualifier(cell)); } // Increments carry time range. If an Increment instance, put it on the Get. if (tr != null) { get.setTimeRange(tr.getMin(), tr.getMax()); } return get(get, false); }
private void assertICV(byte [] row, byte [] familiy, byte[] qualifier, long amount, boolean fast) throws IOException { // run a get and see? Get get = new Get(row); if (fast) get.setIsolationLevel(IsolationLevel.READ_UNCOMMITTED); get.addColumn(familiy, qualifier); Result result = region.get(get); assertEquals(1, result.size()); Cell kv = result.rawCells()[0]; long r = Bytes.toLong(CellUtil.cloneValue(kv)); assertEquals(amount, r); }
.setFilter(new FilterList()) .setId("get") .setIsolationLevel(IsolationLevel.READ_COMMITTED) .setLoadColumnFamiliesOnDemand(false) .setMaxResultsPerColumnFamily(1000)
get.setConsistency(Consistency.TIMELINE); get.setReplicaId(2); get.setIsolationLevel(IsolationLevel.READ_UNCOMMITTED); get.setCheckExistenceOnly(true); get.setTimeRange(3, 4);
.setFilter(new FilterList()) .setId("get") .setIsolationLevel(IsolationLevel.READ_COMMITTED) .setLoadColumnFamiliesOnDemand(false) .setMaxResultsPerColumnFamily(1000)
get.setConsistency(Consistency.TIMELINE); get.setReplicaId(2); get.setIsolationLevel(IsolationLevel.READ_UNCOMMITTED); get.setCheckExistenceOnly(true); get.setTimeRange(3, 4);
/** * Do a specific Get on passed <code>columnFamily</code> and column qualifiers * from <code>incrementCoordinates</code> only. * @param increment * @param columnFamily * @param incrementCoordinates * @return Return the Cells to Increment * @throws IOException */ private List<Cell> getIncrementCurrentValue(final Increment increment, byte [] columnFamily, final List<Cell> increments, final IsolationLevel isolation) throws IOException { Get get = new Get(increment.getRow()); if (isolation != null) get.setIsolationLevel(isolation); for (Cell cell: increments) { get.addColumn(columnFamily, CellUtil.cloneQualifier(cell)); } TimeRange tr = increment.getTimeRange(); if (tr != null) { get.setTimeRange(tr.getMin(), tr.getMax()); } return get(get, false); }
private void assertICV(byte [] row, byte [] familiy, byte[] qualifier, long amount, boolean fast) throws IOException { // run a get and see? Get get = new Get(row); if (fast) get.setIsolationLevel(IsolationLevel.READ_UNCOMMITTED); get.addColumn(familiy, qualifier); Result result = region.get(get); assertEquals(1, result.size()); Cell kv = result.rawCells()[0]; long r = Bytes.toLong(CellUtil.cloneValue(kv)); assertEquals(amount, r); }