consensus-bizur/src/main/java/com/mboysan/consensus/BizurRun.java
/*----------------------------------------------------------------------------------
     * Algorithm 5: Key-Value API
     * ----------------------------------------------------------------------------------*/
Algorithm 5: Key-Value API
Algorithm 5 : Key - Value API
String apiGet(String key) throws BizurException {
        Objects.requireNonNull(key);
        int index = hashKey(key);
        Bucket bucket = getBucket(index).lock();
        try {
            synchronized (bizurState) {
                read(bucket);
                return bucket.getOp(key);
            }
        } finally {
            bucket.unlock();
        }
    }
String apiGet ( String key ) throws BizurException { Objects . requireNonNull ( key ) ; int index = hashKey ( key ) ; Bucket bucket = getBucket ( index ) . lock ( ) ; try { synchronized ( bizurState ) { read ( bucket ) ; return bucket . getOp ( key ) ; } } finally { bucket . unlock ( ) ; } }
Algorithm 5: Key-Value API
Algorithm 5 : Key - Value API