Package org.apache.accumulo.core.client

Examples of org.apache.accumulo.core.client.Connector.tableOperations()


   
    Connector c = opts.getConnector();
   
    if(opts.clear_table && c.tableOperations().exists(opts.getTableName())) {
      try {
      c.tableOperations().delete(opts.getTableName());
      } catch(TableNotFoundException e) {
        System.err.println("Couldn't delete the table because it doesn't exist any more.");
      }
    }
   
View Full Code Here


      } catch(TableNotFoundException e) {
        System.err.println("Couldn't delete the table because it doesn't exist any more.");
      }
    }
   
    if(!c.tableOperations().exists(opts.getTableName())) {
      try {
        c.tableOperations().create(opts.getTableName());
      } catch (TableExistsException e) {
        System.err.println("Couldn't create table ourselves, but that's ok. Continuing.");
      }
View Full Code Here

      }
    }
   
    if(!c.tableOperations().exists(opts.getTableName())) {
      try {
        c.tableOperations().create(opts.getTableName());
      } catch (TableExistsException e) {
        System.err.println("Couldn't create table ourselves, but that's ok. Continuing.");
      }
    }
View Full Code Here

   
    PrintStream out = new PrintStream(new BufferedOutputStream(fs.create(new Path(workDir + "/splits.txt"))), false, Constants.UTF8.name());
   
    Connector conn = state.getConnector();
   
    Collection<Text> splits = conn.tableOperations().listSplits(tableName, maxSplits);
    for (Text split : splits)
      out.println(new String(Base64.encodeBase64(TextUtil.getBytes(split)), Constants.UTF8));
   
    out.close();
   
View Full Code Here

   
    LoopControl scanning_condition = opts.continuous ? new ContinuousLoopControl() :
                                                       new IterativeLoopControl(opts.scan_iterations);
   
    while(scanning_condition.keepScanning()) {
      Range range = pickRange(connector.tableOperations(), opts.getTableName(),
          tablet_index_generator);
      scanner.setRange(range);
      if (opts.batch_size > 0) {
        scanner.setBatchSize(opts.batch_size);
      }
View Full Code Here

  static void createIndexTable(Logger log, State state, String suffix, Random rand) throws Exception {
    Connector conn = state.getConnector();
    String name = (String) state.get("indexTableName") + suffix;
    int numPartitions = (Integer) state.get("numPartitions");
    boolean enableCache = (Boolean) state.get("cacheIndex");
    conn.tableOperations().create(name);
    conn.tableOperations().addSplits(name, genSplits(numPartitions, rand.nextInt(numPartitions) + 1, "%06x"));
   
    if (enableCache) {
      conn.tableOperations().setProperty(name, Property.TABLE_INDEXCACHE_ENABLED.getKey(), "true");
      conn.tableOperations().setProperty(name, Property.TABLE_BLOCKCACHE_ENABLED.getKey(), "true");
View Full Code Here

    Connector conn = state.getConnector();
    String name = (String) state.get("indexTableName") + suffix;
    int numPartitions = (Integer) state.get("numPartitions");
    boolean enableCache = (Boolean) state.get("cacheIndex");
    conn.tableOperations().create(name);
    conn.tableOperations().addSplits(name, genSplits(numPartitions, rand.nextInt(numPartitions) + 1, "%06x"));
   
    if (enableCache) {
      conn.tableOperations().setProperty(name, Property.TABLE_INDEXCACHE_ENABLED.getKey(), "true");
      conn.tableOperations().setProperty(name, Property.TABLE_BLOCKCACHE_ENABLED.getKey(), "true");
     
View Full Code Here

    boolean enableCache = (Boolean) state.get("cacheIndex");
    conn.tableOperations().create(name);
    conn.tableOperations().addSplits(name, genSplits(numPartitions, rand.nextInt(numPartitions) + 1, "%06x"));
   
    if (enableCache) {
      conn.tableOperations().setProperty(name, Property.TABLE_INDEXCACHE_ENABLED.getKey(), "true");
      conn.tableOperations().setProperty(name, Property.TABLE_BLOCKCACHE_ENABLED.getKey(), "true");
     
      log.info("Enabled caching for table " + name);
    }
  }
View Full Code Here

    conn.tableOperations().create(name);
    conn.tableOperations().addSplits(name, genSplits(numPartitions, rand.nextInt(numPartitions) + 1, "%06x"));
   
    if (enableCache) {
      conn.tableOperations().setProperty(name, Property.TABLE_INDEXCACHE_ENABLED.getKey(), "true");
      conn.tableOperations().setProperty(name, Property.TABLE_BLOCKCACHE_ENABLED.getKey(), "true");
     
      log.info("Enabled caching for table " + name);
    }
  }
 
View Full Code Here

    Connector conn = state.getConnector();
   
    createIndexTable(this.log, state, "", rand);
   
    String docTableName = (String) state.get("docTableName");
    conn.tableOperations().create(docTableName);
    conn.tableOperations().addSplits(docTableName, genSplits(0xff, rand.nextInt(32) + 1, "%02x"));
   
    if (rand.nextDouble() < .5) {
      conn.tableOperations().setProperty((String) state.get("docTableName"), Property.TABLE_BLOOM_ENABLED.getKey(), "true");
      log.info("Enabled bloom filters for table " + (String) state.get("docTableName"));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.