cleamup ShardIter#reset method
don't have teh reset method return an instance, as it might confuse usage into thinking it might be a different instance
This commit is contained in:
parent
074b89b7ad
commit
13845e47d6
|
@ -34,9 +34,9 @@ public class PlainShardIterator extends PlainShardsIterator implements ShardIter
|
|||
/**
|
||||
* Creates a {@link PlainShardIterator} instance that iterates over a subset of the given shards
|
||||
* this the a given <code>shardId</code>.
|
||||
*
|
||||
* @param shardId shard id of the group
|
||||
* @param shards shards to iterate
|
||||
*
|
||||
* @param shardId shard id of the group
|
||||
* @param shards shards to iterate
|
||||
*/
|
||||
public PlainShardIterator(ShardId shardId, List<ShardRouting> shards) {
|
||||
super(shards);
|
||||
|
@ -46,22 +46,16 @@ public class PlainShardIterator extends PlainShardsIterator implements ShardIter
|
|||
/**
|
||||
* Creates a {@link PlainShardIterator} instance that iterates over a subset of the given shards
|
||||
* this the a given <code>shardId</code>.
|
||||
*
|
||||
* @param shardId shard id of the group
|
||||
* @param shards shards to iterate
|
||||
* @param index the offset in the shards list to start the iteration from
|
||||
*
|
||||
* @param shardId shard id of the group
|
||||
* @param shards shards to iterate
|
||||
* @param index the offset in the shards list to start the iteration from
|
||||
*/
|
||||
public PlainShardIterator(ShardId shardId, List<ShardRouting> shards, int index) {
|
||||
super(shards, index);
|
||||
this.shardId = shardId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShardIterator reset() {
|
||||
super.reset();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShardId shardId() {
|
||||
return this.shardId;
|
||||
|
|
|
@ -54,9 +54,8 @@ public class PlainShardsIterator implements ShardsIterator {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ShardsIterator reset() {
|
||||
public void reset() {
|
||||
this.counter = this.index;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -34,5 +34,5 @@ public interface ShardIterator extends ShardsIterator {
|
|||
/**
|
||||
* Resets the iterator.
|
||||
*/
|
||||
ShardIterator reset();
|
||||
void reset();
|
||||
}
|
||||
|
|
|
@ -27,16 +27,18 @@ public interface ShardsIterator {
|
|||
/**
|
||||
* Resets the iterator to its initial state.
|
||||
*/
|
||||
ShardsIterator reset();
|
||||
void reset();
|
||||
|
||||
/**
|
||||
* The number of shard routing instances.
|
||||
* @return number of shard routing instances in this iterator
|
||||
*
|
||||
* @return number of shard routing instances in this iterator
|
||||
*/
|
||||
int size();
|
||||
|
||||
/**
|
||||
* The number of active shard routing instances
|
||||
*
|
||||
* @return number of active shard routing instances
|
||||
*/
|
||||
int sizeActive();
|
||||
|
@ -63,6 +65,7 @@ public interface ShardsIterator {
|
|||
|
||||
/**
|
||||
* Return the number of shards remaining in this {@link ShardsIterator}
|
||||
*
|
||||
* @return number of shard remaining
|
||||
*/
|
||||
int remaining();
|
||||
|
|
Loading…
Reference in New Issue