Package org.apache.accumulo.core.client

Examples of org.apache.accumulo.core.client.Instance


    bw.close();
  }
 
  @Test
  public void test() throws Exception {
    Instance instance = new MockInstance();
    Connector connector = instance.getConnector("root", new PasswordToken(""));
    BatchWriter bw = connector.createBatchWriter("!METADATA", new BatchWriterConfig());
   
    // Create a fake METADATA table with these splits
    String splits[] = {"a", "e", "j", "o", "t", "z"};
    // create metadata for a table "t" with the splits above
View Full Code Here


    ball = new byte[b1.length + b2.length + 1];
    System.arraycopy(b1, 0, ball, 0, b1.length);
    ball[b1.length] = (byte) 0;
    System.arraycopy(b2, 0, ball, b1.length + 1, b2.length);

    Instance instance = new MockInstance();
    Connector conn = instance.getConnector("root", new PasswordToken(new byte[0]));

    conn.tableOperations().create(table);
    BatchWriter bw = conn.createBatchWriter(table, new BatchWriterConfig());
    Mutation m = new Mutation(ball);
    m.put(new byte[0], new byte[0], new byte[0]);
View Full Code Here

 
  public static void main(String[] args) throws Exception {
    final Logger log = Logger.getLogger(ZombieTServer.class);
    Random random = new Random(System.currentTimeMillis() % 1000);
    int port = random.nextInt(30000) + 2000;
    Instance instance = HdfsZooInstance.getInstance();
   
    TransactionWatcher watcher = new TransactionWatcher();
    final ThriftClientHandler tch = new ThriftClientHandler(instance, watcher);
    Processor<Iface> processor = new Processor<Iface>(tch);
    ServerPort serverPort = TServerUtils.startTServer(port, processor, "ZombieTServer", "walking dead", 2, 1000, 10*1024*1024);
 
View Full Code Here

 
  @Override
  public void setUp(State state) throws Exception {
   
    Connector conn = state.getConnector();
    Instance instance = state.getInstance();
   
    SortedSet<Text> splits = new TreeSet<Text>();
    for (int i = 1; i < 256; i++) {
      splits.add(new Text(String.format("%04x", i << 8)));
    }
View Full Code Here

    opts.parseArgs(TestIngest.class.getName(), args, bwOpts);
    opts.getInstance().setConfiguration(ServerConfiguration.getSiteConfiguration());

    createTable(opts);
   
    Instance instance = opts.getInstance();
   
    String name = TestIngest.class.getSimpleName();
    DistributedTrace.enable(instance, new ZooReader(instance.getZooKeepers(), instance.getZooKeepersSessionTimeOut()), name, null);
   
    try {
      opts.startTracing(name);
     
      Logger.getLogger(TabletServerBatchWriter.class.getName()).setLevel(Level.TRACE);
View Full Code Here

    Authorizations auths = new Authorizations("foo");
    Collection<Pair<Text,Text>> fetchColumns = Collections.singleton(new Pair<Text,Text>(new Text("foo"), new Text("bar")));
    boolean isolated = true, localIters = true;
    Level level = Level.WARN;

    Instance inst = new MockInstance(instance);
    Connector connector = inst.getConnector(username, password);
    connector.tableOperations().create(table);

    AccumuloInputFormat.setConnectorInfo(job, username, password);
    AccumuloInputFormat.setInputTableName(job, table);
    AccumuloInputFormat.setScanAuthorizations(job, auths);
View Full Code Here

  private Instance instance;
 
  public static void main(String[] args) throws UnknownHostException, IOException {
    SecurityUtil.serverLogin();
   
    Instance instance = HdfsZooInstance.getInstance();
    ServerConfiguration serverConf = new ServerConfiguration(instance);
    final FileSystem fs = FileUtil.getFileSystem(CachedConfiguration.getInstance(), serverConf.getConfiguration());
    Accumulo.init(fs, serverConf, "gc");
    String address = "localhost";
    SimpleGarbageCollector gc = new SimpleGarbageCollector();
View Full Code Here

import org.apache.accumulo.server.zookeeper.ZooReaderWriter;

public class Info {
  public static void main(String[] args) throws Exception {
    ZooReaderWriter zrw = ZooReaderWriter.getInstance();
    Instance instance = HdfsZooInstance.getInstance();
    System.out.println("monitor: " + new String(zrw.getData(ZooUtil.getRoot(instance) + Constants.ZMONITOR_HTTP_ADDR, null), Constants.UTF8));
    System.out.println("masters: " + instance.getMasterLocations());
    System.out.println("zookeepers: " + instance.getZooKeepers());
  }
View Full Code Here

public class MockTableOperationsTest {
 
  @Test
  public void testCreateUseVersions() throws AccumuloException, AccumuloSecurityException, TableExistsException, TableNotFoundException {
    Instance instance = new MockInstance("topstest");
    Connector conn = instance.getConnector("user", new PasswordToken("pass"));
    String t = "tableName1";
   
    {
      conn.tableOperations().create(t, false, TimeType.LOGICAL);
     
View Full Code Here

    s.close();
  }
 
  @Test
  public void testTableNotFound() throws AccumuloException, AccumuloSecurityException, TableExistsException, TableNotFoundException {
    Instance instance = new MockInstance("topstest");
    Connector conn = instance.getConnector("user", new PasswordToken("pass"));
    String t = "tableName";
    try {
      conn.tableOperations().attachIterator(t, null);
      Assert.fail();
    } catch (TableNotFoundException e) {}
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.client.Instance

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.