Package voldemort.server.protocol.admin

Examples of voldemort.server.protocol.admin.AsyncOperationService


     */
    public static boolean waitForAsyncOperationOnServer(VoldemortServer server,
                                                        String asyncOperationPattern,
                                                        long timeoutMs) {
        long endTimeMs = System.currentTimeMillis() + timeoutMs;
        AsyncOperationService service = server.getAsyncRunner();
        List<Integer> matchingOperationIds = null;
        // wait till the atleast one matching operation shows up
        while(System.currentTimeMillis() < endTimeMs) {
            matchingOperationIds = service.getMatchingAsyncOperationList(asyncOperationPattern,
                                                                         true);
            if(matchingOperationIds.size() > 0) {
                break;
            }
        }
        // now wait for those operations to complete
        while(System.currentTimeMillis() < endTimeMs) {
            List<Integer> completedOps = new ArrayList<Integer>(matchingOperationIds.size());
            for(Integer op: matchingOperationIds) {
                if(service.isComplete(op)) {
                    completedOps.add(op);
                }
            }
            matchingOperationIds.removeAll(completedOps);
            if(matchingOperationIds.size() == 0) {
View Full Code Here


        List<VoldemortService> services = new ArrayList<VoldemortService>();
        SchedulerService scheduler = new SchedulerService(voldemortConfig.getSchedulerThreads(),
                                                          SystemTime.INSTANCE,
                                                          voldemortConfig.canInterruptService());
        storageService = new StorageService(storeRepository, metadata, scheduler, voldemortConfig);
        asyncService = new AsyncOperationService(scheduler, ASYNC_REQUEST_CACHE_SIZE);
        jmxService = null;

        services.add(storageService);
        services.add(scheduler);
        services.add(asyncService);
View Full Code Here

TOP

Related Classes of voldemort.server.protocol.admin.AsyncOperationService

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.