ACCUMULO-2825 Fix formatting and remove javadoc warnings
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/b7ccde3a Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/b7ccde3a Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/b7ccde3a Branch: refs/heads/ACCUMULO-378 Commit: b7ccde3a2bfaf622779c931fce701e4361b908cd Parents: b2eaf13 Author: Josh Elser <els...@apache.org> Authored: Tue May 20 22:40:43 2014 -0400 Committer: Josh Elser <els...@apache.org> Committed: Tue May 20 22:40:43 2014 -0400 ---------------------------------------------------------------------- .../iterators/user/RowEncodingIterator.java | 70 +++++++++----------- .../core/iterators/user/WholeRowIterator.java | 25 +++---- 2 files changed, 43 insertions(+), 52 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/b7ccde3a/core/src/main/java/org/apache/accumulo/core/iterators/user/RowEncodingIterator.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/iterators/user/RowEncodingIterator.java b/core/src/main/java/org/apache/accumulo/core/iterators/user/RowEncodingIterator.java index f083eb3..6387723 100644 --- a/core/src/main/java/org/apache/accumulo/core/iterators/user/RowEncodingIterator.java +++ b/core/src/main/java/org/apache/accumulo/core/iterators/user/RowEncodingIterator.java @@ -34,65 +34,59 @@ import org.apache.hadoop.io.Text; /** * - * The RowEncodingIterator is designed to provide row-isolation so that queries see mutations as atomic. - * It does so by encapsulating an entire row of key/value pairs into a single key/value pair, which is - * returned through the client as an atomic operation. This is an abstract class, allowing the user to - * implement rowEncoder and rowDecoder such that the columns and values of a given row may be encoded - * in a format best suited to the client. + * The RowEncodingIterator is designed to provide row-isolation so that queries see mutations as atomic. It does so by encapsulating an entire row of key/value + * pairs into a single key/value pair, which is returned through the client as an atomic operation. This is an abstract class, allowing the user to implement + * rowEncoder and rowDecoder such that the columns and values of a given row may be encoded in a format best suited to the client. * * <p> * For an example implementation, see {@link WholeRowIterator}. - * + * * <p> - * One caveat is that when seeking in the WholeRowIterator using a range that starts at a non-inclusive - * first key in a row, (e.g. seek(new Range(new Key(new Text("row")),false,...),...)) this iterator will - * skip to the next row. This is done in order to prevent repeated scanning of the same row when system - * automatically creates ranges of that form, which happens in the case of the client calling - * continueScan, or in the case of the tablet server continuing a scan after swapping out sources. + * One caveat is that when seeking in the WholeRowIterator using a range that starts at a non-inclusive first key in a row, (e.g. seek(new Range(new Key(new + * Text("row")),false,...),...)) this iterator will skip to the next row. This is done in order to prevent repeated scanning of the same row when system + * automatically creates ranges of that form, which happens in the case of the client calling continueScan, or in the case of the tablet server continuing a + * scan after swapping out sources. * * <p> - * To regain the original key/value pairs of the row, call the rowDecoder function on the key/value - * pair that this iterator returned. + * To regain the original key/value pairs of the row, call the rowDecoder function on the key/value pair that this iterator returned. * * @see RowFilter */ public abstract class RowEncodingIterator implements SortedKeyValueIterator<Key,Value> { - + protected SortedKeyValueIterator<Key,Value> sourceIter; private Key topKey = null; private Value topValue = null; // decode a bunch of key value pairs that have been encoded into a single value /** - * Given a value generated by the rowEncoder implementation, recreate the - * original Key, Value pairs. + * Given a value generated by the rowEncoder implementation, recreate the original Key, Value pairs. + * * @param rowKey * @param rowValue - * @return * @throws IOException */ public abstract SortedMap<Key,Value> rowDecoder(Key rowKey, Value rowValue) throws IOException; - + /** - * Take a stream of keys and values. Return values in the same order - * encoded such that all portions of the key (except for the row value) - * and the original value are encoded in some way. + * Take a stream of keys and values. Return values in the same order encoded such that all portions of the key (except for the row value) and the original + * value are encoded in some way. + * * @param keys * @param values - * @return * @throws IOException */ public abstract Value rowEncoder(List<Key> keys, List<Value> values) throws IOException; - + /** * Implement deepCopy. Ensure sourceIter is copied appropriately. */ @Override public abstract SortedKeyValueIterator<Key,Value> deepCopy(IteratorEnvironment env); - + List<Key> keys = new ArrayList<Key>(); List<Value> values = new ArrayList<Value>(); - + private void prepKeys() throws IOException { if (topKey != null) return; @@ -109,11 +103,11 @@ public abstract class RowEncodingIterator implements SortedKeyValueIterator<Key, sourceIter.next(); } } while (!filter(currentRow, keys, values)); - + topKey = new Key(currentRow); topValue = rowEncoder(keys, values); } - + /** * * @param currentRow @@ -127,41 +121,41 @@ public abstract class RowEncodingIterator implements SortedKeyValueIterator<Key, protected boolean filter(Text currentRow, List<Key> keys, List<Value> values) { return true; } - + @Override public Key getTopKey() { return topKey; } - + @Override public Value getTopValue() { return topValue; } - + @Override public boolean hasTop() { return topKey != null; } - + @Override public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException { sourceIter = source; } - + @Override public void next() throws IOException { topKey = null; topValue = null; prepKeys(); } - + @Override public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive) throws IOException { topKey = null; topValue = null; - + Key sk = range.getStartKey(); - + if (sk != null && sk.getColumnFamilyData().length() == 0 && sk.getColumnQualifierData().length() == 0 && sk.getColumnVisibilityData().length() == 0 && sk.getTimestamp() == Long.MAX_VALUE && !range.isStartKeyInclusive()) { // assuming that we are seeking using a key previously returned by this iterator @@ -169,12 +163,12 @@ public abstract class RowEncodingIterator implements SortedKeyValueIterator<Key, Key followingRowKey = sk.followingKey(PartialKey.ROW); if (range.getEndKey() != null && followingRowKey.compareTo(range.getEndKey()) > 0) return; - + range = new Range(sk.followingKey(PartialKey.ROW), true, range.getEndKey(), range.isEndKeyInclusive()); } - + sourceIter.seek(range, columnFamilies, inclusive); prepKeys(); } - + } http://git-wip-us.apache.org/repos/asf/accumulo/blob/b7ccde3a/core/src/main/java/org/apache/accumulo/core/iterators/user/WholeRowIterator.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/accumulo/core/iterators/user/WholeRowIterator.java b/core/src/main/java/org/apache/accumulo/core/iterators/user/WholeRowIterator.java index 060a004..4b7802d 100644 --- a/core/src/main/java/org/apache/accumulo/core/iterators/user/WholeRowIterator.java +++ b/core/src/main/java/org/apache/accumulo/core/iterators/user/WholeRowIterator.java @@ -33,22 +33,19 @@ import org.apache.accumulo.core.iterators.SortedKeyValueIterator; /** * - * The WholeRowIterator is designed to provide row-isolation so that queries see mutations as atomic. - * It does so by encapsulating an entire row of key/value pairs into a single key/value pair, which - * is returned through the client as an atomic operation. + * The WholeRowIterator is designed to provide row-isolation so that queries see mutations as atomic. It does so by encapsulating an entire row of key/value + * pairs into a single key/value pair, which is returned through the client as an atomic operation. * * <p> - * This iterator extends the {@link RowEncodingIterator}, providing implementations for rowEncoder - * and rowDecoder which serializes all column and value information from a given row into a - * single ByteStream in a value. + * This iterator extends the {@link RowEncodingIterator}, providing implementations for rowEncoder and rowDecoder which serializes all column and value + * information from a given row into a single ByteStream in a value. * * <p> - * As with the RowEncodingIterator, when seeking in the WholeRowIterator using a range that starts - * at a non-inclusive first key in a row, this iterator will skip to the next row. + * As with the RowEncodingIterator, when seeking in the WholeRowIterator using a range that starts at a non-inclusive first key in a row, this iterator will + * skip to the next row. * * <p> - * To regain the original key/value pairs of the row, call the decodeRow function on the key/value - * pair that this iterator returned. + * To regain the original key/value pairs of the row, call the decodeRow function on the key/value pair that this iterator returned. * * @see RowFilter */ @@ -58,7 +55,7 @@ public class WholeRowIterator extends RowEncodingIterator { WholeRowIterator(SortedKeyValueIterator<Key,Value> source) { this.sourceIter = source; } - + @Override public SortedKeyValueIterator<Key,Value> deepCopy(IteratorEnvironment env) { if (sourceIter != null) @@ -67,13 +64,13 @@ public class WholeRowIterator extends RowEncodingIterator { } @Override - public SortedMap<Key, Value> rowDecoder(Key rowKey, Value rowValue) throws IOException { - return decodeRow(rowKey, rowValue); + public SortedMap<Key,Value> rowDecoder(Key rowKey, Value rowValue) throws IOException { + return decodeRow(rowKey, rowValue); } @Override public Value rowEncoder(List<Key> keys, List<Value> values) throws IOException { - return encodeRow(keys, values); + return encodeRow(keys, values); } /**