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

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


    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


  @Rule
  public TemporaryFolder folder = new TemporaryFolder(new File(System.getProperty("user.dir") + "/target"));

  @BeforeClass
  public static void setup() throws Exception {
    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

    if (null == instanceName) {
      return null;
    }

    if (isMockInstance()) {
      return new MockInstance(getInstanceName());
    }

    if (null == zooKeepers) {
      return null;
    }
View Full Code Here

  @Test
  public void testMap() throws Exception {
    final String INSTANCE_NAME = PREFIX + "_mapreduce_instance";
    final String TEST_TABLE_1 = PREFIX + "_mapreduce_table_1";

    MockInstance mockInstance = new MockInstance(INSTANCE_NAME);
    Connector c = mockInstance.getConnector("root", new PasswordToken(""));
    c.tableOperations().create(TEST_TABLE_1);
    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)));
      m.put(new Text(), new Text(), new Value(String.format("%09x", i).getBytes()));
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

  @Test
  public void testPartialInputSplitDelegationToConfiguration() throws Exception {
    String user = "testPartialInputSplitUser";
    PasswordToken password = new PasswordToken("");

    MockInstance mockInstance = new MockInstance("testPartialInputSplitDelegationToConfiguration");
    Connector c = mockInstance.getConnector(user, password);
    c.tableOperations().create("testtable");
    BatchWriter bw = c.createBatchWriter("testtable", new BatchWriterConfig());
    for (int i = 0; i < 100; i++) {
      Mutation m = new Mutation(new Text(String.format("%09x", i + 1)));
      m.put(new Text(), new Text(), new Value(String.format("%09x", i).getBytes()));
View Full Code Here

  @Test
  public void testPartialFailedInputSplitDelegationToConfiguration() throws Exception {
    String user = "testPartialFailedInputSplit";
    PasswordToken password = new PasswordToken("");

    MockInstance mockInstance = new MockInstance("testPartialFailedInputSplitDelegationToConfiguration");
    Connector c = mockInstance.getConnector(user, password);
    c.tableOperations().create("testtable");
    BatchWriter bw = c.createBatchWriter("testtable", new BatchWriterConfig());
    for (int i = 0; i < 100; i++) {
      Mutation m = new Mutation(new Text(String.format("%09x", i + 1)));
      m.put(new Text(), new Text(), new Value(String.format("%09x", i).getBytes()));
View Full Code Here

   */
  protected void setInstance(ShellOptionsJC options) {
    // should only be one set of instance options set
    instance = null;
    if (options.isFake()) {
      instance = new MockInstance("fake");
    } else {
      String instanceName, hosts;
      if (options.isHdfsZooInstance()) {
        instanceName = hosts = null;
      } else if (options.getZooKeeperInstance().size() > 0) {
View Full Code Here

    return keyValues;
  }

  @Test
  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());

    for (Mutation m : createMutations()) {
View Full Code Here

   
  }

  @Test
  public void testChainedRowFilters() throws Exception {
    MockInstance instance = new MockInstance("rft1");
    Connector conn = instance.getConnector("", new PasswordToken(""));

    conn.tableOperations().create("chained_row_filters");
    BatchWriter bw = conn.createBatchWriter("chained_row_filters", new BatchWriterConfig());
    for (Mutation m : createMutations()) {
      bw.addMutation(m);
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.