All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.thinkaurelius.titan.diskstorage.cassandra.astyanax.locking.AstyanaxLockStatus Maven / Gradle / Ivy

The newest version!
package com.thinkaurelius.titan.diskstorage.cassandra.astyanax.locking;

import java.nio.ByteBuffer;
import java.util.concurrent.TimeUnit;

import com.netflix.astyanax.recipes.locks.ColumnPrefixDistributedRowLock;
import com.thinkaurelius.titan.diskstorage.locking.LockStatus;

public class AstyanaxLockStatus implements LockStatus {
    
    private final long time;
    private final TimeUnit timeUnit;
    private final ColumnPrefixDistributedRowLock lock;
    
    public AstyanaxLockStatus(long time, TimeUnit timeUnit,
            ColumnPrefixDistributedRowLock lock) {
        this.time = time;
        this.timeUnit = timeUnit;
        this.lock = lock;
    }
    
    @Override
    public long getExpirationTimestamp(TimeUnit tu) {
        return tu.convert(time, timeUnit);
    }

    public ColumnPrefixDistributedRowLock getLock() {
        return lock;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy