Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Actually invoke the BadKeyOrphanReader. Also committing a bunch of

TODOs for later cleanup.
  • Loading branch information...
commit 1d115daca3e27bffd307186e384576e5b9af8bf0 1 parent f573b53
Jay Wylie jayjwylie authored
3  src/java/voldemort/client/protocol/admin/AdminClient.java
View
@@ -1606,6 +1606,9 @@ private void initiateFetchRequest(DataOutputStream outputStream,
return fetchEntries(nodeId, storeName, partitionList, filter, fetchMasterEntries, 0);
}
+ // TODO: The use of "Pair" in the return for a fundamental type is
+ // awkward. We should have a core KeyValue type that effectively wraps
+ // up a ByteArray and a Versioned<byte[]>.
/**
* Fetch key/value tuples belonging to this map of replica type to
* partition list
25 src/java/voldemort/utils/ConsistencyFix.java
View
@@ -46,6 +46,9 @@
import voldemort.versioning.VectorClock;
import voldemort.versioning.Versioned;
+// TODO: Move to new directory voldemort/tools. Also move ConsistencyCheck,
+// Rebalance, and possibly other tools (shells and so on). This would reduce the
+// amount of different stuff in the utils directory.
public class ConsistencyFix {
private static final Logger logger = Logger.getLogger(ConsistencyFix.class);
@@ -135,6 +138,10 @@ public String execute(int parallelism,
ExecutorService badKeyWriterService;
ExecutorService consistencyFixWorkers;
+ // TODO: Add ThreadFactory usage to ExecutorService usage so that
+ // threads have sane names. Figure out if any parameters currently
+ // passed from object-to-object could be given directly to factories.
+
// Create BadKeyWriter thread
BlockingQueue<BadKeyResult> badKeyQOut = new ArrayBlockingQueue<BadKeyResult>(parallelism * 10);
badKeyWriterService = Executors.newSingleThreadExecutor();
@@ -155,11 +162,19 @@ public String execute(int parallelism,
// Create BadKeyReader thread
CountDownLatch allBadKeysReadLatch = new CountDownLatch(1);
badKeyReaderService = Executors.newSingleThreadExecutor();
- badKeyReaderService.submit(new BadKeyReader(allBadKeysReadLatch,
- badKeyFileIn,
- this,
- consistencyFixWorkers,
- badKeyQOut));
+ if(!orphanFormat) {
+ badKeyReaderService.submit(new BadKeyReader(allBadKeysReadLatch,
+ badKeyFileIn,
+ this,
+ consistencyFixWorkers,
+ badKeyQOut));
+ } else {
+ badKeyReaderService.submit(new BadKeyOrphanReader(allBadKeysReadLatch,
+ badKeyFileIn,
+ this,
+ consistencyFixWorkers,
+ badKeyQOut));
+ }
logger.info("Created badKeyReader.");
try {
1  src/java/voldemort/utils/ConsistencyFixCLI.java
View
@@ -38,6 +38,7 @@ public static void printUsage(String errMessage) {
private static class Options {
public final static int defaultParallelism = 8;
+ // TODO: change name to progressPeriodMs (or S, as case may be)
public final static long defaultProgressBar = 1000;
public final static long defaultPerServerIOPSLimit = 100;
Please sign in to comment.
Something went wrong with that request. Please try again.