Package org.apache.accumulo.core.client

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


  public static TemporaryFolder folder = new TemporaryFolder();
  private MiniAccumuloCluster accumulo;
  private String secret = "secret";
 
  Connector getConnector() throws AccumuloException, AccumuloSecurityException {
    ZooKeeperInstance zki = new ZooKeeperInstance(accumulo.getInstanceName(), accumulo.getZooKeepers());
    return zki.getConnector("root", new PasswordToken(secret));
  }
View Full Code Here


  private ChunkInputStream cis;
  Scanner scanner;
 
  public FileDataQuery(String instanceName, String zooKeepers, String user, AuthenticationToken token, String tableName, Authorizations auths) throws AccumuloException,
      AccumuloSecurityException, TableNotFoundException {
    ZooKeeperInstance instance = new ZooKeeperInstance(instanceName, zooKeepers);
    conn = instance.getConnector(user, token);
    lastRefs = new ArrayList<Entry<Key,Value>>();
    cis = new ChunkInputStream();
    scanner = conn.createScanner(tableName, auths);
  }
View Full Code Here

  }

  @Test
  public void testOfflineTableWithoutCache() throws Exception {

    ZooKeeperInstance instance = new ZooKeeperInstance(cluster.getInstanceName(), cluster.getZooKeepers());
    Connector connector = instance.getConnector("root", password);

    BatchWriterConfig config = new BatchWriterConfig();

    TCredentials creds = CredentialHelper.create("root", password, instance.getInstanceID());
    MultiTableBatchWriter mtbw = new MultiTableBatchWriterImpl(instance, creds, config, 0, TimeUnit.SECONDS);
    boolean mutationsRejected = false;

    try {
      final String table1 = "testOfflineTableWithoutCache_table1", table2 = "testOfflineTableWithoutCache_table2";
View Full Code Here

public class MetadataBatchScanTest {
 
  public static void main(String[] args) throws Exception {
   
    final Connector connector = new ZooKeeperInstance("acu14", "localhost")
        .getConnector(SecurityConstants.SYSTEM_PRINCIPAL, SecurityConstants.getSystemToken());
   
    TreeSet<Long> splits = new TreeSet<Long>();
    Random r = new Random(42);
   
View Full Code Here

  public static Instance getInstance(Class<?> implementingClass, Configuration conf) {
    String instanceType = conf.get(enumToConfKey(implementingClass, InstanceOpts.TYPE), "");
    if ("MockInstance".equals(instanceType))
      return new MockInstance(conf.get(enumToConfKey(implementingClass, InstanceOpts.NAME)));
    else if ("ZooKeeperInstance".equals(instanceType)) {
      return new ZooKeeperInstance(conf.get(enumToConfKey(implementingClass, InstanceOpts.NAME)), conf.get(enumToConfKey(implementingClass,
          InstanceOpts.ZOO_KEEPERS)));
    } else if (instanceType.isEmpty())
      throw new IllegalStateException("Instance has not been configured for " + implementingClass.getSimpleName());
    else
      throw new IllegalStateException("Unrecognized instance type " + instanceType);
View Full Code Here

   
    if (null == zooKeepers) {
      return null;
    }
   
    return new ZooKeeperInstance(getInstanceName(), getZooKeepers());
  }
View Full Code Here

  }
 
  protected static Instance getInstance(Configuration conf) {
    if (conf.getBoolean(MOCK, false))
      return new MockInstance(conf.get(INSTANCE_NAME));
    return new ZooKeeperInstance(conf.get(INSTANCE_NAME), conf.get(ZOOKEEPERS));
  }
View Full Code Here

    String pass = args[3];
    String dataTable = args[4];
    ColumnVisibility colvis = new ColumnVisibility(args[5]);
    int chunkSize = Integer.parseInt(args[6]);

    Connector conn = new ZooKeeperInstance(instance, zooKeepers).getConnector(user, pass.getBytes());
    if (!conn.tableOperations().exists(dataTable)) {
      conn.tableOperations().create(dataTable);
      conn.tableOperations().attachIterator(dataTable, new IteratorSetting(1, ChunkCombiner.class));
    }
    BatchWriter bw = conn.createBatchWriter(dataTable, 50000000, 300000l, 4);
View Full Code Here

 
  /**
   * @return The Accumulo instance.
   */
  protected static Instance getInstance(Configuration conf) {
    return new ZooKeeperInstance(conf.get(INSTANCE_NAME), conf.get(ZOOKEEPERS));
  }
View Full Code Here

      System.err.println("Usage: " + FindOfflineTablets.class.getName() + " <instance> <zookeepers>");
      System.exit(1);
    }
    String instance = args[0];
    String keepers = args[1];
    Instance zooInst = new ZooKeeperInstance(instance, keepers);
    MetaDataTableScanner rootScanner = new MetaDataTableScanner(zooInst, SecurityConstants.getSystemCredentials(),
        Constants.ROOT_TABLET_EXTENT.toMetadataRange());
    MetaDataTableScanner metaScanner = new MetaDataTableScanner(zooInst, SecurityConstants.getSystemCredentials(), Constants.NON_ROOT_METADATA_KEYSPACE);
    @SuppressWarnings("unchecked")
    Iterator<TabletLocationState> scanner = (Iterator<TabletLocationState>) new IteratorChain(rootScanner, metaScanner);
View Full Code Here

TOP

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

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.