Search in sources :

Example 6 with Timer

use of org.janusgraph.diskstorage.util.time.Timer in project janusgraph by JanusGraph.

the class CombinerLock method lock.

@Override
public void lock(Duration timeout) {
    Timer t = times.getTimer().start();
    first.lock(timeout);
    Duration remainingTimeout = timeout.minus(t.elapsed());
    try {
        second.lock(remainingTimeout);
    } catch (RuntimeException e) {
        first.unlock();
        throw e;
    }
}
Also used : Timer(org.janusgraph.diskstorage.util.time.Timer) Duration(java.time.Duration)

Aggregations

Timer (org.janusgraph.diskstorage.util.time.Timer)6 Duration (java.time.Duration)2 JanusGraphManagement (org.janusgraph.core.schema.JanusGraphManagement)2 SchemaStatus (org.janusgraph.core.schema.SchemaStatus)2 Joiner (com.google.common.base.Joiner)1 Preconditions (com.google.common.base.Preconditions)1 Instant (java.time.Instant)1 ArrayList (java.util.ArrayList)1 Collections (java.util.Collections)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Random (java.util.Random)1 PropertyKey (org.janusgraph.core.PropertyKey)1 JanusGraphIndex (org.janusgraph.core.schema.JanusGraphIndex)1 RelationTypeIndex (org.janusgraph.core.schema.RelationTypeIndex)1 org.janusgraph.diskstorage (org.janusgraph.diskstorage)1 Configuration (org.janusgraph.diskstorage.configuration.Configuration)1 KeyColumnValueStore (org.janusgraph.diskstorage.keycolumnvalue.KeyColumnValueStore)1 KeyRange (org.janusgraph.diskstorage.keycolumnvalue.KeyRange)1 KeySliceQuery (org.janusgraph.diskstorage.keycolumnvalue.KeySliceQuery)1