@Override
public TabletLocations lookupTablet(Credentials credentials, TabletLocation src, Text row, Text stopRow, TabletLocator parent)
throws AccumuloSecurityException, AccumuloException {
try {
OpTimer opTimer = null;
if (log.isTraceEnabled())
opTimer = new OpTimer(log, Level.TRACE).start("Looking up in " + src.tablet_extent.getTableId() + " row=" + TextUtil.truncate(row) + " extent="
+ src.tablet_extent + " tserver=" + src.tablet_location);
Range range = new Range(row, true, stopRow, true);
TreeMap<Key,Value> encodedResults = new TreeMap<Key,Value>();
TreeMap<Key,Value> results = new TreeMap<Key,Value>();
// Use the whole row iterator so that a partial mutations is not read. The code that extracts locations for tablets does a sanity check to ensure there is
// only one location. Reading a partial mutation could make it appear there are multiple locations when there are not.
List<IterInfo> serverSideIteratorList = new ArrayList<IterInfo>();
serverSideIteratorList.add(new IterInfo(10000, WholeRowIterator.class.getName(), "WRI"));
Map<String,Map<String,String>> serverSideIteratorOptions = Collections.emptyMap();
boolean more = ThriftScanner.getBatchFromServer(instance, credentials, range, src.tablet_extent, src.tablet_location, encodedResults, locCols,
serverSideIteratorList, serverSideIteratorOptions, Constants.SCAN_BATCH_SIZE, Authorizations.EMPTY, false, ServerConfigurationUtil.getConfiguration(instance));
decodeRows(encodedResults, results);
if (more && results.size() == 1) {
range = new Range(results.lastKey().followingKey(PartialKey.ROW_COLFAM_COLQUAL_COLVIS_TIME), true, new Key(stopRow).followingKey(PartialKey.ROW), false);
encodedResults.clear();
more = ThriftScanner.getBatchFromServer(instance, credentials, range, src.tablet_extent, src.tablet_location, encodedResults, locCols,
serverSideIteratorList, serverSideIteratorOptions, Constants.SCAN_BATCH_SIZE, Authorizations.EMPTY, false, ServerConfigurationUtil.getConfiguration(instance));
decodeRows(encodedResults, results);
}
if (opTimer != null)
opTimer.stop("Got " + results.size() + " results from " + src.tablet_extent + " in %DURATION%");
//if (log.isTraceEnabled()) log.trace("results "+results);
return MetadataLocationObtainer.getMetadataLocationEntries(results);