boolean isTargetReplicaSpecified = (get.getReplicaId() >= 0); try { rl = getRegionLocations(true, (isTargetReplicaSpecified ? get.getReplicaId() : RegionReplicaUtil.DEFAULT_REPLICA_ID), cConnection, tableName, get.getRow()); } catch (RetriesExhaustedException | DoNotRetryIOException e) { addCallsForReplica(cs, rl, get.getReplicaId(), get.getReplicaId()); endIndex = 1; } else {
this.setReplicaId(get.getReplicaId()); this.setConsistency(get.getConsistency());
super.setReplicaId(get.getReplicaId());
out.setTargetReplicaId(in.getReplicaId()); out.setCacheBlocks(in.getCacheBlocks()); out.setStoreLimit(in.getMaxResultsPerColumnFamily());
assertEquals(get.getColumnFamilyTimeRange().get(Bytes.toBytes("cf")).getMax(), scan.getColumnFamilyTimeRange().get(Bytes.toBytes("cf")).getMax()); assertEquals(get.getReplicaId(), scan.getReplicaId()); assertEquals(get.getACL(), scan.getACL()); assertEquals(get.getAuthorizations().getLabels(), scan.getAuthorizations().getLabels());
@Test public void testConsistency() throws Exception { byte[] rowName = Bytes.toBytes("testConsistency"); TGet tGet = new TGet(wrap(rowName)); tGet.setConsistency(TConsistency.STRONG); Get get = getFromThrift(tGet); assertEquals(Consistency.STRONG, get.getConsistency()); tGet.setConsistency(TConsistency.TIMELINE); tGet.setTargetReplicaId(1); get = getFromThrift(tGet); assertEquals(Consistency.TIMELINE, get.getConsistency()); assertEquals(1, get.getReplicaId()); TScan tScan = new TScan(); tScan.setConsistency(TConsistency.STRONG); Scan scan = scanFromThrift(tScan); assertEquals(Consistency.STRONG, scan.getConsistency()); tScan.setConsistency(TConsistency.TIMELINE); tScan.setTargetReplicaId(1); scan = scanFromThrift(tScan); assertEquals(Consistency.TIMELINE, scan.getConsistency()); assertEquals(1, scan.getReplicaId()); TResult tResult = new TResult(); assertFalse(tResult.isSetStale()); tResult.setStale(true); assertTrue(tResult.isSetStale()); }
assertTrue(Bytes.equals(get.getACL(), copyGet.getACL())); assertEquals(get.getConsistency(), copyGet.getConsistency()); assertEquals(get.getReplicaId(), copyGet.getReplicaId()); assertEquals(get.getIsolationLevel(), copyGet.getIsolationLevel());
boolean isTargetReplicaSpecified = (get.getReplicaId() >= 0); try { rl = getRegionLocations(true, (isTargetReplicaSpecified ? get.getReplicaId() : RegionReplicaUtil.DEFAULT_REPLICA_ID), cConnection, tableName, get.getRow()); } catch (RetriesExhaustedException | DoNotRetryIOException e) { addCallsForReplica(cs, rl, get.getReplicaId(), get.getReplicaId()); endIndex = 1; } else {
this.setReplicaId(get.getReplicaId()); this.setConsistency(get.getConsistency());
super.setReplicaId(get.getReplicaId());
assertEquals(get.getColumnFamilyTimeRange().get(Bytes.toBytes("cf")).getMax(), scan.getColumnFamilyTimeRange().get(Bytes.toBytes("cf")).getMax()); assertEquals(get.getReplicaId(), scan.getReplicaId()); assertEquals(get.getACL(), scan.getACL()); assertEquals(get.getAuthorizations().getLabels(), scan.getAuthorizations().getLabels());
assertTrue(Bytes.equals(get.getACL(), copyGet.getACL())); assertEquals(get.getConsistency(), copyGet.getConsistency()); assertEquals(get.getReplicaId(), copyGet.getReplicaId()); assertEquals(get.getIsolationLevel(), copyGet.getIsolationLevel());
boolean isTargetReplicaSpecified = (get.getReplicaId() >= 0); RegionLocations rl = getRegionLocations(true, (isTargetReplicaSpecified ? get.getReplicaId() : RegionReplicaUtil.DEFAULT_REPLICA_ID), cConnection, tableName, get.getRow()); ResultBoundedCompletionService<Result> cs = addCallsForReplica(cs, rl, get.getReplicaId(), get.getReplicaId()); } else { addCallsForReplica(cs, rl, 0, 0);
this.setReplicaId(get.getReplicaId()); this.setConsistency(get.getConsistency());
boolean isTargetReplicaSpecified = (get.getReplicaId() >= 0); try { rl = getRegionLocations(true, (isTargetReplicaSpecified ? get.getReplicaId() : RegionReplicaUtil.DEFAULT_REPLICA_ID), cConnection, tableName, get.getRow()); } catch (RetriesExhaustedException | DoNotRetryIOException e) { addCallsForReplica(cs, rl, get.getReplicaId(), get.getReplicaId()); endIndex = 1; } else {
this.setReplicaId(get.getReplicaId()); this.setConsistency(get.getConsistency());