@Override public TabletLocation locateTablet(ClientContext context, Text row, boolean skipRow, boolean retry) throws AccumuloException, AccumuloSecurityException, TableNotFoundException { return syncLocator().locateTablet(context, row, skipRow, retry); }
@Override public <T extends Mutation> void binMutations(ClientContext context, List<T> mutations, Map<String,TabletServerMutations<T>> binnedMutations, List<T> failures) throws AccumuloException, AccumuloSecurityException, TableNotFoundException { try { super.binMutations(context, mutations, binnedMutations, failures); if (failures.size() == mutations.size()) failed(); else succeeded(); } catch (AccumuloException ae) { failed(); throw ae; } }
@Override public List<Range> binRanges(ClientContext context, List<Range> ranges, Map<String,Map<KeyExtent,List<Range>>> binnedRanges) throws AccumuloException, AccumuloSecurityException, TableNotFoundException { try { List<Range> ret = super.binRanges(context, ranges, binnedRanges); if (ranges.size() == ret.size()) failed(); else succeeded(); return ret; } catch (AccumuloException ae) { failed(); throw ae; } } }
@Override public TabletLocation locateTablet(ClientContext context, Text row, boolean skipRow, boolean retry) throws AccumuloException, AccumuloSecurityException, TableNotFoundException { try { TabletLocation ret = super.locateTablet(context, row, skipRow, retry); if (ret == null) failed(); else succeeded(); return ret; } catch (AccumuloException ae) { failed(); throw ae; } }
ConditionalWriterImpl(ClientContext context, Table.ID tableId, ConditionalWriterConfig config) { this.context = context; this.auths = config.getAuthorizations(); this.ve = new VisibilityEvaluator(config.getAuthorizations()); this.threadPool = new ScheduledThreadPoolExecutor(config.getMaxWriteThreads(), new NamingThreadFactory(this.getClass().getSimpleName())); this.locator = new SyncingTabletLocator(context, tableId); this.serverQueues = new HashMap<>(); this.tableId = tableId; this.timeout = config.getTimeout(TimeUnit.MILLISECONDS); this.durability = config.getDurability(); this.classLoaderContext = config.getClassLoaderContext(); Runnable failureHandler = () -> { List<QCMutation> mutations = new ArrayList<>(); failedMutations.drainTo(mutations); if (mutations.size() > 0) queue(mutations); }; failureHandler = new LoggingRunnable(log, failureHandler); threadPool.scheduleAtFixedRate(failureHandler, 250, 250, TimeUnit.MILLISECONDS); }
@Override public <T extends Mutation> void binMutations(ClientContext context, List<T> mutations, Map<String,TabletServerMutations<T>> binnedMutations, List<T> failures) throws AccumuloException, AccumuloSecurityException, TableNotFoundException { syncLocator().binMutations(context, mutations, binnedMutations, failures); }
@Override public void invalidateCache(ClientContext context, String server) { syncLocator().invalidateCache(context, server); } }
@Override public List<Range> binRanges(ClientContext context, List<Range> ranges, Map<String,Map<KeyExtent,List<Range>>> binnedRanges) throws AccumuloException, AccumuloSecurityException, TableNotFoundException { return syncLocator().binRanges(context, ranges, binnedRanges); }
@Override public void invalidateCache() { syncLocator().invalidateCache(); }
@Override public void invalidateCache(KeyExtent failedExtent) { syncLocator().invalidateCache(failedExtent); }
@Override public void invalidateCache(Collection<KeyExtent> keySet) { syncLocator().invalidateCache(keySet); }