Package org.apache.accumulo.core.client.mock

Examples of org.apache.accumulo.core.client.mock.MockInstance


  }
 
  private void test1(String[] metadata, String[] deletes, int expectedInitial, int expected) throws Exception {
    TCredentials auth = CredentialHelper.create("root", new PasswordToken(new byte[0]), "instance");
   
    Instance instance = new MockInstance();
    FileSystem fs = FileSystem.getLocal(CachedConfiguration.getInstance());
   
    load(instance, metadata, deletes);
   
    SimpleGarbageCollector gc = new SimpleGarbageCollector();
View Full Code Here


  synchronized public Instance getInstance() {
    if (cachedInstance != null)
      return cachedInstance;
   
    if (mock)
      return cachedInstance = new MockInstance(instance);
    if (instance == null) {
      return cachedInstance = HdfsZooInstance.getInstance();
    }
    return cachedInstance = new ZooKeeperInstance(this.instance, this.zookeepers);
  }
View Full Code Here

  synchronized public Instance getInstance() {
    if (cachedInstance != null)
      return cachedInstance;
   
    if (mock)
      return cachedInstance = new MockInstance(instance);
    if (instance == null) {
      return cachedInstance = HdfsZooInstance.getInstance();
    }
    return cachedInstance = new ZooKeeperInstance(this.instance, this.zookeepers);
  }
View Full Code Here

  }

  @Override
  public Instance getInstance() {
    if (mock)
      return new MockInstance(instance);
    if (instance == null) {
      return HdfsZooInstance.getInstance();
    }
    return new ZooKeeperInstance(this.instance, this.zookeepers);
  }
View Full Code Here

      return ToolRunner.run(CachedConfiguration.getInstance(), new CIFTester(), args);
    }
  }
 
  public void test() throws Exception {
    MockInstance instance = new MockInstance("instance1");
    Connector conn = instance.getConnector("root", new PasswordToken(""));
    conn.tableOperations().create("test");
    BatchWriter bw = conn.createBatchWriter("test", new BatchWriterConfig());
   
    for (Entry<Key,Value> e : data) {
      Key k = e.getKey();
View Full Code Here

    assertNull(e1);
    assertNull(e2);
  }
 
  public void testErrorOnNextWithoutClose() throws Exception {
    MockInstance instance = new MockInstance("instance2");
    Connector conn = instance.getConnector("root", new PasswordToken(""));
    conn.tableOperations().create("test");
    BatchWriter bw = conn.createBatchWriter("test", new BatchWriterConfig());
   
    for (Entry<Key,Value> e : data) {
      Key k = e.getKey();
View Full Code Here

    assertNull(e2);
    assertNotNull(e3);
  }
 
  public void testInfoWithoutChunks() throws Exception {
    MockInstance instance = new MockInstance("instance3");
    Connector conn = instance.getConnector("root", new PasswordToken(""));
    conn.tableOperations().create("test");
    BatchWriter bw = conn.createBatchWriter("test", new BatchWriterConfig());
    for (Entry<Key,Value> e : baddata) {
      Key k = e.getKey();
      Mutation m = new Mutation(k.getRow());
View Full Code Here

 
  synchronized public Instance getInstance() {
    if (cachedInstance != null)
      return cachedInstance;
    if (mock)
      return cachedInstance = new MockInstance(instance);
    if (siteFile != null) {
      AccumuloConfiguration config = new AccumuloConfiguration() {
        Configuration xml = new Configuration();
        {
          xml.addResource(new Path(siteFile));
View Full Code Here

      e.printStackTrace();
    }
  }
 
  public void test() throws Exception {
    Scanner scanner = new MockInstance("counttest").getConnector("root", new PasswordToken("")).createScanner("dirlisttable", new Authorizations());
    scanner.fetchColumn(new Text("dir"), new Text("counts"));
    assertFalse(scanner.iterator().hasNext());
   
    Opts opts = new Opts();
    ScannerOpts scanOpts = new ScannerOpts();
View Full Code Here

   
    assertFalse(pi.hasNext());
  }
 
  public void testWithAccumulo() throws AccumuloException, AccumuloSecurityException, TableExistsException, TableNotFoundException, IOException {
    Connector conn = new MockInstance().getConnector("root", new PasswordToken(""));
    conn.tableOperations().create("test");
    BatchWriter bw = conn.createBatchWriter("test", new BatchWriterConfig());
   
    for (Entry<Key,Value> e : data) {
      Key k = e.getKey();
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.client.mock.MockInstance

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.