Package org.apache.accumulo.trace.instrument

Examples of org.apache.accumulo.trace.instrument.CountSampler


        log.warn(e, e);
        return;
      }
    }
   
    Sampler sampler = new CountSampler(100);
   
    while (true) {
      if (sampler.next())
        Trace.on("gc");
     
      Span gcSpan = Trace.start("loop");
      tStart = System.currentTimeMillis();
      try {
View Full Code Here


    if (!conn.tableOperations().exists(opts.getTableName())) {
      throw new TableNotFoundException(null, opts.getTableName(), "Consult the README and create the table before starting ingest.");
    }

    BatchWriter bw = conn.createBatchWriter(opts.getTableName(), bwOpts.getBatchWriterConfig());
    bw = Trace.wrapAll(bw, new CountSampler(1024));
   
    Random r = new Random();
   
    byte[] ingestInstanceId = UUID.randomUUID().toString().getBytes(Constants.UTF8);
   
View Full Code Here

public class CountSamplerTest {
 
  @Test
  public void testNext() {
    CountSampler half = new CountSampler(2);
    CountSampler hundred = new CountSampler(100);
    int halfCount = 0;
    int hundredCount = 0;
    for (int i = 0; i < 200; i++) {
      if (half.next())
        halfCount++;
      if (hundred.next())
        hundredCount++;
    }
    Assert.assertEquals(2, hundredCount);
    Assert.assertEquals(100, halfCount);
  }
View Full Code Here

        log.warn(e, e);
        return;
      }
    }
   
    Sampler sampler = new CountSampler(100);
   
    while (true) {
      if (sampler.next())
        Trace.on("gc");
     
      Span gcSpan = Trace.start("loop");
      tStart = System.currentTimeMillis();
      try {
View Full Code Here

      try {
        conn.tableOperations().create(opts.getTableName());
      } catch (TableExistsException tee) {}

    BatchWriter bw = conn.createBatchWriter(opts.getTableName(), bwOpts.getBatchWriterConfig());
    bw = Trace.wrapAll(bw, new CountSampler(1024));
   
    Random r = new Random();
   
    byte[] ingestInstanceId = UUID.randomUUID().toString().getBytes();
   
View Full Code Here

    } catch (InterruptedException e) {
      log.warn(e, e);
      return;
    }

    Sampler sampler = new CountSampler(100);

    while (true) {
      if (sampler.next())
        Trace.on("gc");

      Span gcSpan = Trace.start("loop");
      tStart = System.currentTimeMillis();
      try {
View Full Code Here

        log.warn(e, e);
        return;
      }
    }
   
    Sampler sampler = new CountSampler(100);
   
    while (true) {
      if (sampler.next())
        Trace.on("gc");
     
      Span gcSpan = Trace.start("loop");
      tStart = System.currentTimeMillis();
      try {
View Full Code Here

      try {
        conn.tableOperations().create(opts.getTableName());
      } catch (TableExistsException tee) {}

    BatchWriter bw = conn.createBatchWriter(opts.getTableName(), bwOpts.getBatchWriterConfig());
    bw = Trace.wrapAll(bw, new CountSampler(1024));
   
    Random r = new Random();
   
    byte[] ingestInstanceId = UUID.randomUUID().toString().getBytes(Constants.UTF8);
   
View Full Code Here

    } catch (InterruptedException e) {
      log.warn(e, e);
      return;
    }

    Sampler sampler = new CountSampler(100);

    while (true) {
      if (sampler.next())
        Trace.on("gc");

      Span gcSpan = Trace.start("loop");
      tStart = System.currentTimeMillis();
      try {
View Full Code Here

TOP

Related Classes of org.apache.accumulo.trace.instrument.CountSampler

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.