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

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


    m.put("cf", "cq", "v");
    return m;
  }
 
  public void test1() throws Exception {
    MockInstance mi = new MockInstance();
   
    Connector conn = mi.getConnector("root", new PasswordToken(""));
    conn.tableOperations().create("foo");
   
    BatchWriter bw = conn.createBatchWriter("foo", new BatchWriterConfig());
   
    bw.addMutation(nm(new byte[] {0}));
View Full Code Here


    }
   
  }

  public void test1() throws Exception {
    MockInstance instance = new MockInstance("rft1");
    Connector conn = instance.getConnector("", new PasswordToken(""));
   
    conn.tableOperations().create("table1");
    BatchWriter bw = conn.createBatchWriter("table1", new BatchWriterConfig());
   
    Mutation m = new Mutation("0");
View Full Code Here

 
  public ProxyServer(Properties props) {
   
    String useMock = props.getProperty("useMockInstance");
    if (useMock != null && Boolean.parseBoolean(useMock))
      instance = new MockInstance();
    else
      instance = new ZooKeeperInstance(props.getProperty("instance"), props.getProperty("zookeepers"));
   
    try {
      String tokenProp = props.getProperty("tokenClass", PasswordToken.class.getName());
View Full Code Here

 
  @BeforeClass
  public static void setup() throws Exception {
    folder.create();
   
    MockInstance mockInstance = new MockInstance(INSTANCE_NAME);
    Connector c = mockInstance.getConnector("root", new PasswordToken(""));
    c.tableOperations().create(EMPTY_TABLE);
    c.tableOperations().create(TEST_TABLE);
    c.tableOperations().create(BAD_TABLE);
    BatchWriter bw = c.createBatchWriter(TEST_TABLE, new BatchWriterConfig());
    Mutation m = new Mutation("Key");
View Full Code Here

    }
  }
 
  @Test
  public void test() throws Exception {
    final MockInstance instance = new MockInstance(INSTANCE_NAME);
    final Connector conn = instance.getConnector("root", new PasswordToken(""));
    conn.tableOperations().create(TEST_TABLE_1);
    BatchWriter writer = null;
    try {
      writer = conn.createBatchWriter(TEST_TABLE_1, new BatchWriterConfig());
      insertList(writer, row1);
View Full Code Here

 
  @BeforeClass
  public static void setup() throws Exception {
    folder.create();
   
    MockInstance mockInstance = new MockInstance(INSTANCE_NAME);
    Connector c = mockInstance.getConnector("root", new PasswordToken(""));
    c.tableOperations().create(EMPTY_TABLE);
    c.tableOperations().create(TEST_TABLE);
    c.tableOperations().create(BAD_TABLE);
    BatchWriter bw = c.createBatchWriter(TEST_TABLE, new BatchWriterConfig());
    Mutation m = new Mutation("Key");
View Full Code Here

  private Connector connector;
  private Scanner scanner;
 
  @Before
  public void setUpMockAccumulo() throws Exception {
    MockInstance instance = new MockInstance("test");
    connector = instance.getConnector("user", new PasswordToken("password"));
    connector.securityOperations().changeUserAuthorizations("user", authorizations);
   
    if (connector.tableOperations().exists(TABLE_NAME))
      connector.tableOperations().delete(TABLE_NAME);
    connector.tableOperations().create(TABLE_NAME);
View Full Code Here

    checkExpected(expected);
  }
 
  @Test
  public void testDeepCopy() throws Exception {
    MockInstance instance = new MockInstance("test");
    Connector connector = instance.getConnector("user", new PasswordToken("password"));
   
    connector.tableOperations().create("shard_table");
   
    BatchWriter bw = connector.createBatchWriter("shard_table", new BatchWriterConfig());
   
View Full Code Here

    }
  }
 
  @Test
  public void test() throws Exception {
    final MockInstance instance = new MockInstance(INSTANCE_NAME);
    final Connector conn = instance.getConnector("root", new PasswordToken(""));
    conn.tableOperations().create(TEST_TABLE_1);
    BatchWriter writer = null;
    try {
      writer = conn.createBatchWriter(TEST_TABLE_1, new BatchWriterConfig());
      insertList(writer, row1);
View Full Code Here

    myAOF.checkOutputSpecs(job);
  }
 
  @Test
  public void testMR() throws Exception {
    MockInstance mockInstance = new MockInstance(INSTANCE_NAME);
    Connector c = mockInstance.getConnector("root", new PasswordToken(""));
    c.tableOperations().create(TEST_TABLE_1);
    c.tableOperations().create(TEST_TABLE_2);
    BatchWriter bw = c.createBatchWriter(TEST_TABLE_1, new BatchWriterConfig());
    for (int i = 0; i < 100; i++) {
      Mutation m = new Mutation(new Text(String.format("%09x", i + 1)));
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.