Package org.apache.accumulo.core.client

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


  /**
   * @deprecated since 1.5.0; Use {@link #setBatchWriterOptions(Job, BatchWriterConfig)} instead.
   */
  @Deprecated
  public static void setMaxMutationBufferSize(Configuration conf, long numberOfBytes) {
    BatchWriterConfig bwConfig = OutputConfigurator.getBatchWriterOptions(CLASS, conf);
    bwConfig.setMaxMemory(numberOfBytes);
    OutputConfigurator.setBatchWriterOptions(CLASS, conf, bwConfig);
  }
View Full Code Here


  /**
   * @deprecated since 1.5.0; Use {@link #setBatchWriterOptions(Job, BatchWriterConfig)} instead.
   */
  @Deprecated
  public static void setMaxLatency(Configuration conf, int numberOfMilliseconds) {
    BatchWriterConfig bwConfig = OutputConfigurator.getBatchWriterOptions(CLASS, conf);
    bwConfig.setMaxLatency(numberOfMilliseconds, TimeUnit.MILLISECONDS);
    OutputConfigurator.setBatchWriterOptions(CLASS, conf, bwConfig);
  }
View Full Code Here

  /**
   * @deprecated since 1.5.0; Use {@link #setBatchWriterOptions(Job, BatchWriterConfig)} instead.
   */
  @Deprecated
  public static void setMaxWriteThreads(Configuration conf, int numberOfThreads) {
    BatchWriterConfig bwConfig = OutputConfigurator.getBatchWriterOptions(CLASS, conf);
    bwConfig.setMaxWriteThreads(numberOfThreads);
    OutputConfigurator.setBatchWriterOptions(CLASS, conf, bwConfig);
  }
View Full Code Here

    }
    return bwpe;
  }
 
  private BatchWriterPlusException getWriter(ByteBuffer login, String tableName, WriterOptions opts) throws Exception {
    BatchWriterConfig cfg = new BatchWriterConfig();
    if (opts != null) {
      if (opts.maxMemory != 0)
        cfg.setMaxMemory(opts.maxMemory);
      if (opts.threads != 0)
        cfg.setMaxWriteThreads(opts.threads);
      if (opts.timeoutMs != 0)
        cfg.setTimeout(opts.timeoutMs, TimeUnit.MILLISECONDS);
      if (opts.latencyMs != 0)
        cfg.setMaxLatency(opts.latencyMs, TimeUnit.MILLISECONDS);
    }
    BatchWriterPlusException result = new BatchWriterPlusException();
    result.writer = getConnector(login).createBatchWriter(tableName, cfg);
    return result;
  }
View Full Code Here

 
  @Parameter(names="--batchTimeout", converter=TimeConverter.class, description="timeout used to fail a batch write")
  public Long batchTimeout = BWDEFAULTS.getTimeout(TimeUnit.MILLISECONDS);
 
  public BatchWriterConfig getBatchWriterConfig() {
    BatchWriterConfig config = new BatchWriterConfig();
    config.setMaxWriteThreads(this.batchThreads);
    config.setMaxLatency(this.batchLatency, TimeUnit.MILLISECONDS);
    config.setMaxMemory(this.batchMemory);
    config.setTimeout(this.batchTimeout, TimeUnit.MILLISECONDS);
    return config;
  }
View Full Code Here

  private void test2() throws Exception {
    basicTest(PRE_SPLIT_TABLE_NAME, NUM_PRE_SPLITS);
  }
 
  private void basicTest(String table, int expectedSplits) throws Exception {
    BatchWriter bw = getConnector().createBatchWriter(table, new BatchWriterConfig());
   
    Random r = new Random();
    byte rowData[] = new byte[ROW_SIZE];
   
    r.setSeed(SEED);
View Full Code Here

  @Override
  public void run() throws Exception {

    getConnector().tableOperations().create("test");

    BatchWriter bw = getConnector().createBatchWriter("test", new BatchWriterConfig());

    Mutation m1 = new Mutation("r1");
    m1.put("cf1", "cq1", 1, "5");

    bw.addMutation(m1);
View Full Code Here

    List<String> tableNames = (List<String>) state.get("tables");
   
    String tableName = tableNames.get(rand.nextInt(tableNames.size()));
   
    try {
      BatchWriter bw = conn.createBatchWriter(tableName, new BatchWriterConfig());
      try {
        int numRows = rand.nextInt(100000);
        for (int i = 0; i < numRows; i++) {
          Mutation m = new Mutation(String.format("%016x", (rand.nextLong() & 0x7fffffffffffffffl)));
          long val = (rand.nextLong() & 0x7fffffffffffffffl);
View Full Code Here

  }
 
  @Override
  public void run() throws Exception {
   
    BatchWriter bw = getConnector().createBatchWriter("foo", new BatchWriterConfig());
   
    for (int i = 0; i < 1000; i++) {
      Mutation m = new Mutation(new Text(String.format("%06d", i)));
      m.put(new Text("cf1"), new Text("cq1"), new Value(Integer.toString(1000 - i).getBytes(Constants.UTF8)));
      m.put(new Text("cf1"), new Text("cq2"), new Value(Integer.toString(i - 1000).getBytes(Constants.UTF8)));
View Full Code Here

   
    // Logger logger = Logger.getLogger(Constants.CORE_PACKAGE_NAME);
   
    int numRows = 1 << 18;
   
    BatchWriter bw = getConnector().createBatchWriter("bss", new BatchWriterConfig());
   
    for (int i = 0; i < numRows; i++) {
      Mutation m = new Mutation(new Text(String.format("%09x", i)));
      m.put(new Text("cf1"), new Text("cq1"), new Value(String.format("%016x", numRows - i).getBytes(Constants.UTF8)));
      bw.addMutation(m);
View Full Code Here

TOP

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

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.