@Override public TKeyExtent translate(KeyExtent input) { return input.toThrift(); } }
public TKeyExtent toThrift() { return wrapped.toThrift(); }
@Override public void send(TCredentials auth, String serverName, Iface client) throws TException, ThriftSecurityException { client.reportTabletStatus(Tracer.traceInfo(), auth, serverName, status, extent.toThrift()); } }
@Override public void send(TCredentials credentials, String serverName, MasterClientService.Iface client) throws TException, ThriftSecurityException { TabletSplit split = new TabletSplit(); split.oldTablet = old_extent.toThrift(); split.newTablets = Translator.translate(extents.keySet(), Translators.KET); client.reportSplitExtent(Tracer.traceInfo(), credentials, serverName, split); }
private void convertMutations(TabletServerMutations<QCMutation> mutations, Map<Long,CMK> cmidToCm, MutableLong cmid, Map<TKeyExtent,List<TConditionalMutation>> tmutations, CompressedIterators compressedIters) { for (Entry<KeyExtent,List<QCMutation>> entry : mutations.getMutations().entrySet()) { TKeyExtent tke = entry.getKey().toThrift(); ArrayList<TConditionalMutation> tcondMutaions = new ArrayList<>(); List<QCMutation> condMutations = entry.getValue(); for (QCMutation cm : condMutations) { TMutation tm = cm.toThrift(); List<TCondition> conditions = convertConditions(cm, compressedIters); cmidToCm.put(cmid.longValue(), new CMK(entry.getKey(), cm)); TConditionalMutation tcm = new TConditionalMutation(conditions, tm, cmid.longValue()); cmid.increment(); tcondMutaions.add(tcm); } tmutations.put(tke, tcondMutaions); } }
public void splitTablet(ZooLock lock, KeyExtent extent, Text splitPoint) throws TException, ThriftSecurityException, NotServingTabletException { TabletClientService.Client client = ThriftUtil .getClient(new TabletClientService.Client.Factory(), address, context); try { client.splitTablet(Tracer.traceInfo(), context.rpcCreds(), extent.toThrift(), ByteBuffer.wrap(splitPoint.getBytes(), 0, splitPoint.getLength())); } finally { ThriftUtil.returnClient(client); } }
@Override public List<TabletStats> getTabletStats(TInfo tinfo, TCredentials credentials, String tableId) throws ThriftSecurityException, TException { TreeMap<KeyExtent,Tablet> onlineTabletsCopy; synchronized (onlineTablets) { onlineTabletsCopy = new TreeMap<>(onlineTablets); } List<TabletStats> result = new ArrayList<>(); String text = tableId; KeyExtent start = new KeyExtent(text, new Text(), null); for (Entry<KeyExtent,Tablet> entry : onlineTabletsCopy.tailMap(start).entrySet()) { KeyExtent ke = entry.getKey(); if (ke.getTableId().compareTo(text) == 0) { Tablet tablet = entry.getValue(); TabletStats stats = tablet.getTabletStats(); stats.extent = ke.toThrift(); stats.ingestRate = tablet.ingestRate(); stats.queryRate = tablet.queryRate(); stats.splitCreationTime = tablet.getSplitCreationTime(); stats.numEntries = tablet.getNumEntries(); result.add(stats); } } return result; }
private static void updateServer(ClientContext context, Mutation m, KeyExtent extent, HostAndPort server) throws TException, NotServingTabletException, ConstraintViolationException, AccumuloSecurityException { checkArgument(m != null, "m is null"); checkArgument(extent != null, "extent is null"); checkArgument(server != null, "server is null"); checkArgument(context != null, "context is null"); TabletClientService.Iface client = null; try { client = ThriftUtil.getTServerClient(server, context); client.update(Tracer.traceInfo(), context.rpcCreds(), extent.toThrift(), m.toThrift(), TDurability.DEFAULT); return; } catch (ThriftSecurityException e) { throw new AccumuloSecurityException(e.user, e.code); } finally { ThriftUtil.returnClient((TServiceClient) client); } }
private void loadTablet(TabletClientService.Client client, ZooLock lock, KeyExtent extent) throws TException { client.loadTablet(Tracer.traceInfo(), context.rpcCreds(), lockString(lock), extent.toThrift()); }
public static void main(String[] args) { final Opts opts = new Opts(); opts.parseArgs(WrongTabletTest.class.getName(), args); final HostAndPort location = HostAndPort.fromString(opts.location); final Instance inst = opts.getInstance(); final ServerConfigurationFactory conf = new ServerConfigurationFactory(inst); final ClientContext context = new AccumuloServerContext(conf) { @Override public synchronized Credentials getCredentials() { try { return new Credentials(opts.getPrincipal(), opts.getToken()); } catch (AccumuloSecurityException e) { throw new RuntimeException(e); } } }; try { TabletClientService.Iface client = ThriftUtil.getTServerClient(location, context); Mutation mutation = new Mutation(new Text("row_0003750001")); mutation.putDelete(new Text("colf"), new Text("colq")); client.update(Tracer.traceInfo(), context.rpcCreds(), new KeyExtent("!!", null, new Text("row_0003750000")).toThrift(), mutation.toThrift(), TDurability.DEFAULT); } catch (Exception e) { throw new RuntimeException(e); } } }
batch.put(keyExtent.toThrift(), Collections.singletonList(r.toThrift()));
ct - ss.startTime, ct - ss.lastAccessTime, ScanType.SINGLE, state, ss.extent.toThrift(), Translator.translate(ss.columnSet, Translators.CT), ss.ssiList, ss.ssio, ss.auths.getAuthorizationsBB(), ss.context); mss.threadPoolExtent.toThrift(), Translator.translate(mss.columnSet, Translators.CT), mss.ssiList, mss.ssio, mss.auths.getAuthorizationsBB(), mss.context));
else if (e.getCause() instanceof TooManyFilesException) throw new org.apache.accumulo.core.tabletserver.thrift.TooManyFilesException( scanSession.extent.toThrift()); else if (e.getCause() instanceof SampleNotPresentException) throw new TSampleNotPresentException(scanSession.extent.toThrift()); else if (e.getCause() instanceof IOException) { sleepUninterruptibly(MAX_TIME_TO_WAIT_FOR_SCAN_RESULT_MILLIS, TimeUnit.MILLISECONDS); Tablet tablet = onlineTablets.get(scanSession.extent); if (tablet == null || tablet.isClosed()) throw new NotServingTabletException(scanSession.extent.toThrift()); else throw new NoSuchScanIDException();
public void chop(ZooLock lock, KeyExtent extent) throws TException { TabletClientService.Client client = ThriftUtil .getClient(new TabletClientService.Client.Factory(), address, context); try { client.chop(Tracer.traceInfo(), context.rpcCreds(), lockString(lock), extent.toThrift()); } finally { ThriftUtil.returnClient(client); } }
public void unloadTablet(ZooLock lock, KeyExtent extent, TUnloadTabletGoal goal, long requestTime) throws TException { TabletClientService.Client client = ThriftUtil .getClient(new TabletClientService.Client.Factory(), address, context); try { client.unloadTablet(Tracer.traceInfo(), context.rpcCreds(), lockString(lock), extent.toThrift(), goal, requestTime); } finally { ThriftUtil.returnClient(client); } }
InitialScan isr = client.startScan(tinfo, scanState.context.rpcCreds(), extent.toThrift(), scanState.range.toThrift(), Translator.translate(scanState.columns, Translators.CT), scanState.size, scanState.serverSideIteratorList, scanState.serverSideIteratorOptions,
for (FileRef ref : compactor.getFilesToCompact()) filesToCompact.add(ref.toString()); return new ActiveCompaction(compactor.extent.toThrift(), System.currentTimeMillis() - compactor.getStartTime(), filesToCompact, compactor.getOutputFile(), type, reason, localityGroup, entriesRead, entriesWritten, iiList,
client.splitTablet(Tracer.traceInfo(), context.rpcCreds(), tl.tablet_extent.toThrift(), TextUtil.getByteBuffer(split));