public V get(SnapshotBase tx, K key) {

    byte[] k = serializer.serialize(key);

    int hash = Hashing.murmur3_32().hashBytes(k).asInt();
    String bucketId = genBucketId(Math.abs(hash % numBuckets), numBuckets);

    BytesBuilder rowBuilder = Bytes.builder();
    rowBuilder.append(updatePrefix).append(bucketId).append(':').append(k);

    Iterator<RowColumnValue> iter =
        tx.scanner().over(Span.prefix(rowBuilder.toBytes())).build().iterator();

    Iterator<V> ui;

    if (iter.hasNext()) {
      ui = Iterators.transform(iter, rcv -> deserVal(rcv.getValue()));
    } else {
      ui = Collections.<V>emptyList().iterator();
    }

    rowBuilder.setLength(0);
    rowBuilder.append(dataPrefix).append(bucketId).append(':').append(k);

    Bytes dataRow = rowBuilder.toBytes();

    Bytes cv = tx.get(dataRow, DATA_COLUMN);

    if (!ui.hasNext()) {
      if (cv == null) {
        return null;
      } else {
        return deserVal(cv);
      }
    }

    return combiner.combine(key, concat(ui, cv)).orElse(null);
  }
public V get ( SnapshotBase tx , K key ) { byte [ ] k = serializer . serialize ( key ) ; int hash = Hashing . murmur3_32 ( ) . hashBytes ( k ) . asInt ( ) ; String bucketId = genBucketId ( Math . abs ( hash % numBuckets ) , numBuckets ) ; BytesBuilder rowBuilder = Bytes . builder ( ) ; rowBuilder . append ( updatePrefix ) . append ( bucketId ) . append ( ':' ) . append ( k ) ; Iterator < RowColumnValue > iter = tx . scanner ( ) . over ( Span . prefix ( rowBuilder . toBytes ( ) ) ) . build ( ) . iterator ( ) ; Iterator < V > ui ; if ( iter . hasNext ( ) ) { ui = Iterators . transform ( iter , rcv -> deserVal ( rcv . getValue ( ) ) ) ; } else { ui = Collections . < V > emptyList ( ) . iterator ( ) ; } rowBuilder . setLength ( 0 ) ; rowBuilder . append ( dataPrefix ) . append ( bucketId ) . append ( ':' ) . append ( k ) ; Bytes dataRow = rowBuilder . toBytes ( ) ; Bytes cv = tx . get ( dataRow , DATA_COLUMN ) ; if ( ! ui . hasNext ( ) ) { if ( cv == null ) { return null ; } else { return deserVal ( cv ) ; } } return combiner . combine ( key , concat ( ui , cv ) ) . orElse ( null ) ; }
This method will retrieve the current value for key and any outstanding updates and combine
them using the configured {@link Combiner}. The result from the combiner is returned.