/** * Creates a {@link org.apache.accumulo.core.dataImpl.thrift.TMutation} object containing this * Mutation's data. * * Note that this method will move the Mutation into a "serialized" state that will prevent users * from adding more data via Mutation#put(). * * @return a thrift form of this Mutation */ public TMutation toThrift() { return toThrift(true); }
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); } }
entry.getValue().get(0).toThrift(), DurabilityImpl.toThrift(durability)); } catch (NotServingTabletException e) { allFailures.addAll(entry.getKey().getTableId(), entry.getValue()); while (size < MUTATION_BATCH_SIZE && iter.hasNext()) { Mutation mutation = iter.next(); updates.add(mutation.toThrift()); size += mutation.numBytes();
/** * Creates a {@link org.apache.accumulo.core.data.thrift.TMutation} object containing this * Mutation's data. * * Note that this method will move the Mutation into a "serialized" state that will prevent users * from adding more data via Mutation#put(). * * @return a thrift form of this Mutation */ public TMutation toThrift() { return toThrift(true); }
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); } }
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); } } }
entry.getValue().get(0).toThrift(), DurabilityImpl.toThrift(durability)); } catch (NotServingTabletException e) { allFailures.addAll(entry.getKey().getTableId(), entry.getValue()); while (size < MUTATION_BATCH_SIZE && iter.hasNext()) { Mutation mutation = iter.next(); updates.add(mutation.toThrift()); size += mutation.numBytes();