Example usage for java.util.concurrent TimeUnit MICROSECONDS

List of usage examples for java.util.concurrent TimeUnit MICROSECONDS

Introduction

In this page you can find the example usage for java.util.concurrent TimeUnit MICROSECONDS.

Prototype

TimeUnit MICROSECONDS

To view the source code for java.util.concurrent TimeUnit MICROSECONDS.

Click Source Link

Document

Time unit representing one thousandth of a millisecond.

Usage

From source file:org.apache.druid.benchmark.GroupByTypeInterfaceBenchmark.java

@Benchmark
@BenchmarkMode(Mode.AverageTime)//from   w ww .j a v  a 2s.c  o  m
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void querySingleQueryableIndexFloatOnly(Blackhole blackhole) {
    QueryRunner<Row> runner = QueryBenchmarkUtil.makeQueryRunner(factory, "qIndex",
            new QueryableIndexSegment("qIndex", queryableIndexes.get(0)));

    List<Row> results = GroupByTypeInterfaceBenchmark.runQuery(factory, runner, floatQuery);

    for (Row result : results) {
        blackhole.consume(result);
    }
}

From source file:io.druid.benchmark.GroupByTypeInterfaceBenchmark.java

@Benchmark
@BenchmarkMode(Mode.AverageTime)// w  ww  . j a va  2 s.  co  m
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void querySingleQueryableIndexFloatOnly(Blackhole blackhole) throws Exception {
    QueryRunner<Row> runner = QueryBenchmarkUtil.makeQueryRunner(factory, "qIndex",
            new QueryableIndexSegment("qIndex", queryableIndexes.get(0)));

    List<Row> results = GroupByTypeInterfaceBenchmark.runQuery(factory, runner, floatQuery);

    for (Row result : results) {
        blackhole.consume(result);
    }
}

From source file:org.apache.druid.benchmark.GroupByTypeInterfaceBenchmark.java

@Benchmark
@BenchmarkMode(Mode.AverageTime)//from  w ww .  j  a v  a 2s .  c  o  m
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void querySingleQueryableIndexNumericOnly(Blackhole blackhole) {
    QueryRunner<Row> runner = QueryBenchmarkUtil.makeQueryRunner(factory, "qIndex",
            new QueryableIndexSegment("qIndex", queryableIndexes.get(0)));

    List<Row> results = GroupByTypeInterfaceBenchmark.runQuery(factory, runner, longFloatQuery);

    for (Row result : results) {
        blackhole.consume(result);
    }
}

From source file:io.druid.benchmark.FilterPartitionBenchmark.java

@Benchmark
@BenchmarkMode(Mode.AverageTime)/*from w  w w . j a  va  2s  .  co  m*/
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void readComplexOrFilterCNF(Blackhole blackhole) throws Exception {
    DimFilter dimFilter1 = new OrDimFilter(
            Arrays.<DimFilter>asList(new SelectorDimFilter("dimSequential", "199", null),
                    new AndDimFilter(Arrays.<DimFilter>asList(
                            new NoBitmapSelectorDimFilter("dimMultivalEnumerated2", "Corundum", null),
                            new SelectorDimFilter("dimMultivalEnumerated", "Bar", null)))));
    DimFilter dimFilter2 = new OrDimFilter(
            Arrays.<DimFilter>asList(new SelectorDimFilter("dimSequential", "299", null),
                    new SelectorDimFilter("dimSequential", "399", null),
                    new AndDimFilter(Arrays.<DimFilter>asList(
                            new NoBitmapSelectorDimFilter("dimMultivalEnumerated2", "Xylophone", null),
                            new SelectorDimFilter("dimMultivalEnumerated", "Foo", null)))));
    DimFilter dimFilter3 = new OrDimFilter(Arrays.<DimFilter>asList(dimFilter1, dimFilter2,
            new AndDimFilter(Arrays.<DimFilter>asList(
                    new NoBitmapSelectorDimFilter("dimMultivalEnumerated2", "Orange", null),
                    new SelectorDimFilter("dimMultivalEnumerated", "World", null)))));

    StorageAdapter sa = new QueryableIndexStorageAdapter(qIndex);
    Sequence<Cursor> cursors = makeCursors(sa, Filters.convertToCNF(dimFilter3.toFilter()));

    Sequence<List<String>> stringListSeq = readCursors(cursors, blackhole);
    List<String> strings = Sequences
            .toList(Sequences.limit(stringListSeq, 1), Lists.<List<String>>newArrayList()).get(0);
    for (String st : strings) {
        blackhole.consume(st);
    }
}

From source file:io.druid.benchmark.GroupByTypeInterfaceBenchmark.java

@Benchmark
@BenchmarkMode(Mode.AverageTime)// www .j a va2 s. c o m
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void querySingleQueryableIndexNumericOnly(Blackhole blackhole) throws Exception {
    QueryRunner<Row> runner = QueryBenchmarkUtil.makeQueryRunner(factory, "qIndex",
            new QueryableIndexSegment("qIndex", queryableIndexes.get(0)));

    List<Row> results = GroupByTypeInterfaceBenchmark.runQuery(factory, runner, longFloatQuery);

    for (Row result : results) {
        blackhole.consume(result);
    }
}

From source file:org.apache.druid.benchmark.GroupByTypeInterfaceBenchmark.java

@Benchmark
@BenchmarkMode(Mode.AverageTime)// w  w  w  .  j a  v a  2s .  c om
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void querySingleQueryableIndexNumericThenString(Blackhole blackhole) {
    QueryRunner<Row> runner = QueryBenchmarkUtil.makeQueryRunner(factory, "qIndex",
            new QueryableIndexSegment("qIndex", queryableIndexes.get(0)));

    List<Row> results = GroupByTypeInterfaceBenchmark.runQuery(factory, runner, longFloatQuery);

    for (Row result : results) {
        blackhole.consume(result);
    }

    runner = QueryBenchmarkUtil.makeQueryRunner(factory, "qIndex",
            new QueryableIndexSegment("qIndex", queryableIndexes.get(0)));

    results = GroupByTypeInterfaceBenchmark.runQuery(factory, runner, stringQuery);

    for (Row result : results) {
        blackhole.consume(result);
    }
}

From source file:org.apache.ode.bpel.engine.BpelEngineImpl.java

public void acquireInstanceLock(final Long iid) {
    // We lock the instance to prevent concurrent transactions and prevent unnecessary rollbacks,
    // Note that we don't want to wait too long here to get our lock, since we are likely holding
    // on to scheduler's locks of various sorts.
    try {//www  .ja va 2 s.com
        _instanceLockManager.lock(iid, 1, TimeUnit.MICROSECONDS);
        _contexts.scheduler.registerSynchronizer(new Scheduler.Synchronizer() {
            public void afterCompletion(boolean success) {
                _instanceLockManager.unlock(iid);
            }

            public void beforeCompletion() {
            }
        });
    } catch (InterruptedException e) {
        // Retry later.
        __log.debug("Thread interrupted, job will be rescheduled");
        throw new Scheduler.JobProcessorException(true);
    } catch (org.apache.ode.bpel.engine.InstanceLockManager.TimeoutException e) {
        __log.debug("Instance " + iid + " is busy, rescheduling job.");
        throw new Scheduler.JobProcessorException(true);
    }
}

From source file:io.druid.benchmark.GroupByTypeInterfaceBenchmark.java

@Benchmark
@BenchmarkMode(Mode.AverageTime)/*from w w  w. j av  a2 s. co  m*/
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void querySingleQueryableIndexNumericThenString(Blackhole blackhole) throws Exception {
    QueryRunner<Row> runner = QueryBenchmarkUtil.makeQueryRunner(factory, "qIndex",
            new QueryableIndexSegment("qIndex", queryableIndexes.get(0)));

    List<Row> results = GroupByTypeInterfaceBenchmark.runQuery(factory, runner, longFloatQuery);

    for (Row result : results) {
        blackhole.consume(result);
    }

    runner = QueryBenchmarkUtil.makeQueryRunner(factory, "qIndex",
            new QueryableIndexSegment("qIndex", queryableIndexes.get(0)));

    results = GroupByTypeInterfaceBenchmark.runQuery(factory, runner, stringQuery);

    for (Row result : results) {
        blackhole.consume(result);
    }
}

From source file:com.twitter.distributedlog.readahead.ReadAheadWorker.java

@Override
public void resumeReadAhead() {
    try {//from  w  ww  .j av  a  2 s  . c o m
        long cacheResumeLatency = resumeStopWatch.stop().elapsed(TimeUnit.MICROSECONDS);
        readAheadCacheResumeStat.registerSuccessfulEvent(cacheResumeLatency);
    } catch (IllegalStateException ise) {
        LOG.error("Encountered illegal state when stopping resume stop watch for {} : ",
                logMetadata.getFullyQualifiedName(), ise);
    }
    submit(this);
}

From source file:org.apache.druid.benchmark.GroupByTypeInterfaceBenchmark.java

@Benchmark
@BenchmarkMode(Mode.AverageTime)//from  w  ww  . j a  va 2 s.co  m
@OutputTimeUnit(TimeUnit.MICROSECONDS)
public void querySingleQueryableIndexLongThenString(Blackhole blackhole) {
    QueryRunner<Row> runner = QueryBenchmarkUtil.makeQueryRunner(factory, "qIndex",
            new QueryableIndexSegment("qIndex", queryableIndexes.get(0)));

    List<Row> results = GroupByTypeInterfaceBenchmark.runQuery(factory, runner, longQuery);

    for (Row result : results) {
        blackhole.consume(result);
    }

    runner = QueryBenchmarkUtil.makeQueryRunner(factory, "qIndex",
            new QueryableIndexSegment("qIndex", queryableIndexes.get(0)));

    results = GroupByTypeInterfaceBenchmark.runQuery(factory, runner, stringQuery);

    for (Row result : results) {
        blackhole.consume(result);
    }
}