Package com.hazelcast.spi

Examples of com.hazelcast.spi.ExecutionService.submit()


    @Override
    public void loadKeys(List<Data> keys, boolean replaceExistingValues) {
        setLoaded(false);
        final NodeEngine nodeEngine = mapServiceContext.getNodeEngine();
        ExecutionService executionService = nodeEngine.getExecutionService();
        executionService.submit("hz:map-loadAllKeys", new LoadAllKeysTask(keys, replaceExistingValues));
    }

    @Override
    public void loadAllKeys() {
        if (isLoaded()) {
View Full Code Here


            final AtomicInteger checkIfMapLoaded = new AtomicInteger(chunks.size());
            ExecutionService executionService = nodeEngine.getExecutionService();
            Map<Data, Object> chunkedKeys;
            while ((chunkedKeys = chunks.poll()) != null) {
                final Callback<Throwable> callback = createCallbackForThrowable();
                executionService.submit("hz:map-load", new MapLoadAllTask(chunkedKeys, checkIfMapLoaded, callback));
            }
        } catch (Throwable t) {
            throw ExceptionUtil.rethrow(t);
        }
    }
View Full Code Here

        NodeEngine nodeEngine = hz.node.nodeEngine;
        ExecutionService es = nodeEngine.getExecutionService();

        final CountDownLatch latch1 = new CountDownLatch(1);
        final CountDownLatch latch2 = new CountDownLatch(1);
        Future future = es.submit("default", new Callable<String>() {
            @Override
            public String call() {
                try {
                    latch1.await(30, TimeUnit.SECONDS);
                    return "success";
View Full Code Here

        NodeEngine nodeEngine = hz.node.nodeEngine;
        ExecutionService es = nodeEngine.getExecutionService();

        final CountDownLatch latch1 = new CountDownLatch(1);
        final CountDownLatch latch2 = new CountDownLatch(2);
        Future future = es.submit("default", new Callable<String>() {
            @Override
            public String call() {
                try {
                    latch1.await(30, TimeUnit.SECONDS);
                    return "success";
View Full Code Here

        NodeEngine nodeEngine = hz.node.nodeEngine;
        ExecutionService es = nodeEngine.getExecutionService();

        final CountDownLatch latch1 = new CountDownLatch(1);
        final CountDownLatch latch2 = new CountDownLatch(1);
        Future future = es.submit("default", new Callable<String>() {
            @Override
            public String call() {
                try {
                    return "success";
                } finally {
View Full Code Here

        NodeEngine nodeEngine = hz.node.nodeEngine;
        ExecutionService es = nodeEngine.getExecutionService();

        final CountDownLatch latch1 = new CountDownLatch(1);
        final CountDownLatch latch2 = new CountDownLatch(2);
        Future future = es.submit("default", new Callable<String>() {
            @Override
            public String call() {
                try {
                    return "success";
                } finally {
View Full Code Here

    }

    protected void submitLoadAllTask(final OperationFactory operationFactory, final CompletionListener completionListener) {
        final LoadAllTask loadAllTask = new LoadAllTask(operationFactory, completionListener);
        final ExecutionService executionService = nodeEngine.getExecutionService();
        final CompletableFutureTask<?> future = (CompletableFutureTask<?>) executionService
                .submit("loadAll-" + nameWithPrefix, loadAllTask);
        loadAllTasks.add(future);
        future.andThen(new ExecutionCallback() {
            @Override
            public void onResponse(Object response) {
View Full Code Here

    @Override
    public void loadKeys(List<Data> keys, boolean replaceExistingValues) {
        setLoaded(false);
        final NodeEngine nodeEngine = mapServiceContext.getNodeEngine();
        ExecutionService executionService = nodeEngine.getExecutionService();
        executionService.submit(ExecutionService.MAP_LOAD_ALL_KEYS_EXECUTOR, new LoadAllKeysTask(keys, replaceExistingValues));
    }

    @Override
    public void loadAllKeys() {
        if (isLoaded()) {
View Full Code Here

            ExecutionService executionService = nodeEngine.getExecutionService();
            Map<Data, Object> chunkedKeys;
            while ((chunkedKeys = chunks.poll()) != null) {
                final Callback<Throwable> callback = createCallbackForThrowable();
                MapLoadAllTask task = new MapLoadAllTask(chunkedKeys, checkIfMapLoaded, callback);
                executionService.submit(ExecutionService.MAP_LOADER_EXECUTOR, task);
            }
        } catch (Throwable t) {
            throw ExceptionUtil.rethrow(t);
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.