Package voldemort.utils.ConsistencyFix

Examples of voldemort.utils.ConsistencyFix.BadKeyReader


        ExecutorService badKeyReaderService = Executors.newSingleThreadExecutor();
        CountDownLatch allBadKeysReadLatch = new CountDownLatch(1);

        // Submit file of bad keys to (appropriate) BadKeyReader
        BadKeyReader bkr = null;
        if(orphan) {
            bkr = new BadKeyOrphanReader(allBadKeysReadLatch,
                                         fileName,
                                         consistencyFix,
                                         consistencyFixWorkers,
                                         badKeyQOut);
        } else {
            bkr = new BadKeyReader(allBadKeysReadLatch,
                                   fileName,
                                   consistencyFix,
                                   consistencyFixWorkers,
                                   badKeyQOut);
        }
        badKeyReaderService.submit(bkr);

        // Wait for file to be processed.
        try {
            allBadKeysReadLatch.await();

            badKeyReaderService.shutdown();
            consistencyFixWorkers.shutdown();
        } catch(InterruptedException e) {
            e.printStackTrace();
            fail("Unexpected exception");
        }
        consistencyFix.close();

        // Make sure everything worked as expected.
        assertFalse(bkr.hasException());
        assertEquals(0, badKeyQOut.size());
    }
View Full Code Here

TOP

Related Classes of voldemort.utils.ConsistencyFix.BadKeyReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.