public void delete(K row) throws AvroBaseException { delegate.delete(row); }
public Row<T, K> get(K row) throws AvroBaseException { return delegate.get(row); }
public boolean put(K row, T value, long version) throws AvroBaseException { return delegate.put(row, value, version); }
public Iterable<Row<T, K>> scan(K startRow, K stopRow) throws AvroBaseException { return delegate.scan(startRow, stopRow); }
public Row<T, K> mutate(K row, Mutator<T> tMutator) throws AvroBaseException { return delegate.mutate(row, tMutator); }
public K create(T value) throws AvroBaseException { return delegate.create(value); }
public Row<T, K> mutate(K row, Mutator<T> tMutator, Creator<T> tCreator) throws AvroBaseException { return delegate.mutate(row, tMutator, tCreator); }
@Override public K create(T value) throws AvroBaseException { final K row = delegate().create(value); index.index(new Row<T,K>(value, row)); return row; }
@Override public void delete(K row) throws AvroBaseException { delegate().delete(row); for (Index<T,K,?> index : indexes) { index.unindex(row); } }
public void put(K row, T value) throws AvroBaseException { delegate.put(row, value); }
@Override public Row<T, K> apply(K from) { if (from == null) return null; return delegate().get(from); } });
@Override public Iterable<Row<T, byte[]>> scan(byte[] startRow, final byte[] stopRow) throws AvroBaseException { final Iterable<Row<T, byte[]>> scan = delegate().scan(startRow, stopRow); return new Iterable<Row<T, byte[]>>() { @Override
@Override public Row<T, K> mutate(K row, Mutator<T> tMutator, Creator<T> tCreator) throws AvroBaseException { final Row<T, K> newRow = delegate().mutate(row, tMutator, tCreator); indexRow(newRow); return newRow; }
@Override public K create(T value) throws AvroBaseException { final K row = delegate().create(value); indexRow(new Row<T,K>(value, row)); return row; }
/** * Truncate deletes everything after row (or before row). You only want to do this after * you have archived it all. * * @param row */ public void truncate(byte[] row) { final Iterable<Row<T, byte[]>> scan = getScanner(row); for (Row<T, byte[]> tRow : scan) { delegate().delete(tRow.row); } }
@Override public boolean put(K row, T value, long version) throws AvroBaseException { final boolean rv = delegate().put(row, value, version); indexRow(new Row<T,K>(value, row)); return rv; }
@Override public Row<T, K> get(K row) throws AvroBaseException { Shard<T, K> shard = strategy.find(row); try { AvroBase<T, K> ab = shard.avrobase(); return ab.get(row); } finally { strategy.done(shard); } }
@Override public Row<T, K> mutate(K row, Mutator<T> tMutator) throws AvroBaseException { final Row<T, K> newRow = delegate().mutate(row, tMutator); indexRow(newRow); return newRow; }
@Override public void delete(K row) throws AvroBaseException { delegate().delete(row); index.unindex(row); }