public SyncingTabletLocator(final ClientContext context, final Table.ID tableId) { this(() -> TabletLocator.getLocator(context, tableId)); }
@Override public void clearLocatorCache(String tableName) throws TableNotFoundException { checkArgument(tableName != null, "tableName is null"); TabletLocator tabLocator = TabletLocator.getLocator(context, Tables.getTableId(context, tableName)); tabLocator.invalidateCache(); }
TabletLocation tabLoc = TabletLocator.getLocator(context, tableId).locateTablet(context, new Text(m.getRow()), false, true); } catch (NotServingTabletException e) { log.trace("Not serving tablet, server = {}", parsedLocation); TabletLocator.getLocator(context, tableId).invalidateCache(tabLoc.tablet_extent); } catch (ConstraintViolationException cve) { log.error("error sending update to {}", parsedLocation, cve); TabletLocator.getLocator(context, tableId).invalidateCache(tabLoc.tablet_extent); throw cve; } catch (TException e) { log.error("error sending update to {}", parsedLocation, e); TabletLocator.getLocator(context, tableId).invalidateCache(tabLoc.tablet_extent);
Map<String,Map<KeyExtent,List<Range>>> binnedRanges = new HashMap<>(); Table.ID tableId = Tables.getTableId(context, tableName); TabletLocator tl = TabletLocator.getLocator(context, tableId);
public static synchronized TabletLocator getLocator(ClientContext context, Table.ID tableId) { Preconditions.checkState(enabled, "The Accumulo singleton that that tracks tablet locations is " + "disabled. This is likely caused by all AccumuloClients being closed or garbage collected" + "."); LocatorKey key = new LocatorKey(context.getInstanceID(), tableId); TabletLocator tl = locators.get(key); if (tl == null) { MetadataLocationObtainer mlo = new MetadataLocationObtainer(); if (RootTable.ID.equals(tableId)) { tl = new RootTabletLocator(new ZookeeperLockChecker(context)); } else if (MetadataTable.ID.equals(tableId)) { tl = new TabletLocatorImpl(MetadataTable.ID, getLocator(context, RootTable.ID), mlo, new ZookeeperLockChecker(context)); } else { tl = new TabletLocatorImpl(tableId, getLocator(context, MetadataTable.ID), mlo, new ZookeeperLockChecker(context)); } locators.put(key, tl); } return tl; }
final TabletLocator locator = TabletLocator.getLocator(context, Table.ID.of(tableId));
tl = TabletLocator.getLocator(client, tableId);
tl = TabletLocator.getLocator(client, tableId);
TabletLocator locator = TabletLocator.getLocator(context, tableId);
loc = TabletLocator.getLocator(context, scanState.tableId).locateTablet(context, scanState.startRow, scanState.skipStartRow, false); lastError = error; TabletLocator.getLocator(context, scanState.tableId).invalidateCache(loc.tablet_extent); loc = null; TabletLocator.getLocator(context, scanState.tableId).invalidateCache(context, loc.tablet_location); error = "Scan failed, thrift error " + e.getClass().getName() + " " + e.getMessage()
private void addSplits(String tableName, SortedSet<Text> partitionKeys, Table.ID tableId) throws AccumuloException, AccumuloSecurityException, TableNotFoundException, AccumuloServerException { TabletLocator tabLocator = TabletLocator.getLocator(context, tableId);
/** * Initializes an Accumulo {@link TabletLocator} based on the configuration. * * @param implementingClass * the class whose name will be used as a prefix for the property configuration key * @param conf * the Hadoop configuration object to configure * @param tableId * The table id for which to initialize the {@link TabletLocator} * @return an Accumulo tablet locator * @since 1.6.0 */ public static TabletLocator getTabletLocator(Class<?> implementingClass, Configuration conf, Table.ID tableId) { try (AccumuloClient client = createClient(implementingClass, conf)) { return TabletLocator.getLocator((ClientContext) client, tableId); } }