Clean up some comments and unused code.
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/bd776723 Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/bd776723 Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/bd776723 Branch: refs/heads/release-2.1.1 Commit: bd7767233193ca8c9cde164dee3b1475aefcc440 Parents: bec5093 Author: Michael Russo <[email protected]> Authored: Sun Mar 20 18:44:41 2016 -0700 Committer: Michael Russo <[email protected]> Committed: Sun Mar 20 18:44:41 2016 -0700 ---------------------------------------------------------------------- .../astyanax/MultiRowShardColumnIterator.java | 35 +++----------------- .../impl/shard/impl/ShardsColumnIterator.java | 20 ++--------- 2 files changed, 8 insertions(+), 47 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/usergrid/blob/bd776723/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiRowShardColumnIterator.java ---------------------------------------------------------------------- diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiRowShardColumnIterator.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiRowShardColumnIterator.java index bfc04c4..b13d0f5 100644 --- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiRowShardColumnIterator.java +++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/astyanax/MultiRowShardColumnIterator.java @@ -57,19 +57,14 @@ public class MultiRowShardColumnIterator<R, C, T> implements Iterator<T> { private final Comparator<T> comparator; - private final Collection<R> rowKeys; - private final Keyspace keyspace; private final ConsistencyLevel consistencyLevel; - private T startColumn; - private boolean moreToReturn; - private Iterator<T> currentColumnIterator; private Iterator<SmartShard> currentShardIterator; @@ -78,43 +73,23 @@ public class MultiRowShardColumnIterator<R, C, T> implements Iterator<T> { private SmartShard currentShard; - private List<T> resultsTracking; + private List<T> resultsTracking; // use for de-duping results that are possible during shard transition private int skipSize = 0; // used for determining if we've skipped a whole page during shard transition private boolean ascending = false; - /** - * Remove after finding bug - */ - - - // private int advanceCount; - // - // private final HashMap<T, SeekPosition> seenResults; - - /** - * Complete Remove - */ - - - /** - * Create the iterator - */ - // temporarily use a new constructor for specific searches until we update each caller of this class public MultiRowShardColumnIterator( final Keyspace keyspace, final ColumnFamily<R, C> cf, - final ConsistencyLevel consistencyLevel, final ColumnParser<C, T> columnParser, - final ColumnSearch<T> columnSearch, final Comparator<T> comparator, - final Collection<R> rowKeys, final int pageSize, - final List<SmartShard> rowKeysWithShardEnd, - final boolean ascending) { + final ConsistencyLevel consistencyLevel, final ColumnParser<C, T> columnParser, + final ColumnSearch<T> columnSearch, final Comparator<T> comparator, + final int pageSize, final List<SmartShard> rowKeysWithShardEnd, + final boolean ascending) { this.cf = cf; this.pageSize = pageSize; this.columnParser = columnParser; this.columnSearch = columnSearch; this.comparator = comparator; - this.rowKeys = rowKeys; this.keyspace = keyspace; this.consistencyLevel = consistencyLevel; this.moreToReturn = true; http://git-wip-us.apache.org/repos/asf/usergrid/blob/bd776723/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardsColumnIterator.java ---------------------------------------------------------------------- diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardsColumnIterator.java b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardsColumnIterator.java index e2dd549..0c90103 100644 --- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardsColumnIterator.java +++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/ShardsColumnIterator.java @@ -111,34 +111,20 @@ public class ShardsColumnIterator<R, C, T> implements Iterator<T> { logger.trace("Starting shards column iterator"); } - - /** - * If the edge is present, we need to being seeking from this - */ - final RangeBuilder rangeBuilder = new RangeBuilder().setLimit( pageSize ); - //set the range into the search + // set the range into the search searcher.buildRange( rangeBuilder ); - - /** - * Get our list of slices - */ - final List<ScopedRowKey<R>> rowKeys = searcher.getRowKeys(); - + // get the rows keys and their corresponding 'shardEnd' that we will seek from final List<SmartShard> rowKeysWithShardEnd = searcher.getRowKeysWithShardEnd(); final boolean ascending = searcher.getOrder() == SearchByEdgeType.Order.ASCENDING; - if (logger.isTraceEnabled()) { - logger.trace("Searching with row keys {}", rowKeys); - } - currentColumnIterator = new MultiRowShardColumnIterator<>( keyspace, cf, consistencyLevel, searcher, searcher, - searcher.getComparator(), rowKeys, pageSize, rowKeysWithShardEnd, ascending); + searcher.getComparator(), pageSize, rowKeysWithShardEnd, ascending); }
