Permalink
Browse files

Fixed issue 205. No longer trying to do proxyGetAll if there are *no*…

… redirecting keys at all.
  • Loading branch information...
afeinberg committed Feb 1, 2010
1 parent e4cd7fe commit cad759a7c03919e841e02c757dedf4a3ee17d72c
Showing with 8 additions and 10 deletions.
  1. +8 −10 src/java/voldemort/store/rebalancing/RedirectingStore.java
@@ -16,6 +16,7 @@
package voldemort.store.rebalancing;
+import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -41,9 +42,6 @@
import voldemort.versioning.Version;
import voldemort.versioning.Versioned;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Iterables;
-
/**
* The RedirectingStore extends {@link DelegatingStore}
* <p>
@@ -120,13 +118,13 @@ private boolean redirectingKey(ByteArray key) {
@Override
public Map<ByteArray, List<Versioned<byte[]>>> getAll(Iterable<ByteArray> keys)
throws VoldemortException {
-
- proxyGetAllAndLocalPut(Iterables.filter(keys, new Predicate<ByteArray>() {
-
- public boolean apply(ByteArray key) {
- return redirectingKey(key);
- }
- }));
+ List<ByteArray> redirectingKeys = new ArrayList<ByteArray>();
+ for (ByteArray key: keys) {
+ if (redirectingKey(key))
+ redirectingKeys.add(key);
+ }
+ if (!redirectingKeys.isEmpty())
+ proxyGetAllAndLocalPut(redirectingKeys);
return getInnerStore().getAll(keys);
}

0 comments on commit cad759a

Please sign in to comment.