Translator translate = Translator.getInstance(); String text = translate.translate("Hello!", Language.ENGLISH, Language.ROMANIAN); System.out.println(text); // "Bună ziua!"
@Override public Connector getConnector(String principal, AuthenticationToken token) throws AccumuloException, AccumuloSecurityException { return new ConnectorImpl( new ClientContext(this, new Credentials(principal, token), clientConf)); }
@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 void clearLocatorCache(String tableName) throws TableNotFoundException { checkArgument(tableName != null, "tableName is null"); TabletLocator tabLocator = TabletLocator.getLocator(context, Tables.getTableId(context.getInstance(), tableName)); tabLocator.invalidateCache(); }
@Override public void invalidateCache(KeyExtent failedExtent) { syncLocator().invalidateCache(failedExtent); }
@Override public String whoami() { return context.getCredentials().getPrincipal(); }
@Override public Map<String,String> namespaceIdMap() { return Namespaces.getNameToIdMap(context.getInstance()); }
@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); }
/** * Add mutations that previously failed back into the mix */ private synchronized void addFailedMutations(MutationSet failedMutations) throws Exception { mutations.addAll(failedMutations); if (mutations.getMemoryUsed() >= maxMem / 2 || closed || flushing) { startProcessing(); } }
public TTransport getTransport(HostAndPort location, long milliseconds, ClientContext context) throws TTransportException { return getTransport(new ThriftTransportKey(location, milliseconds, context)); }
@Override public synchronized Iterator<Entry<Key,Value>> iterator() { return new ScannerIterator(context, tableId, authorizations, range, size, getTimeOut(), this, isolated, readaheadThreshold); }
@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 ConditionalWriter createConditionalWriter(String tableName, ConditionalWriterConfig config) throws TableNotFoundException { return new ConditionalWriterImpl(context, getTableId(tableName), config); }
public static Map<String,String> getNameToIdMap(Instance instance) { return getTableMap(instance).getNameToIdMap(); }
private TabletLocation lookupTabletLocationAndCheckLock(ClientContext context, Text row, boolean retry, LockCheckerSession lcSession) throws AccumuloException, AccumuloSecurityException, TableNotFoundException { lookupTabletLocation(context, row, retry, lcSession); return lcSession.checkLock(locateTabletInCache(row)); }
@Override public Connector getConnector(String principal, AuthenticationToken token) throws AccumuloException, AccumuloSecurityException { return new ConnectorImpl(new ClientContext(this, new Credentials(principal, token), site)); }
@Override public void invalidateCache() { syncLocator().invalidateCache(); }
@Override public void invalidateCache(Instance instance, String server) { syncLocator().invalidateCache(instance, server); } }
@Override public void invalidateCache(Collection<KeyExtent> keySet) { syncLocator().invalidateCache(keySet); }