Package voldemort.store.nonblockingstore

Examples of voldemort.store.nonblockingstore.NonblockingStore


            if (logger.isTraceEnabled())
                logger.trace("Submitting " + pipeline.getOperation().getSimpleName()
                             + " request on node " + node.getId());

            NonblockingStore store = nonblockingStores.get(node.getId());
            store.submitGetAllRequest(keys, transforms, callback, timeoutMs);
        }

        try {
            latch.await(timeoutMs, TimeUnit.MILLISECONDS);
        } catch (InterruptedException e) {
View Full Code Here


                    if(logger.isDebugEnabled())
                        logger.debug("Doing read repair on node " + v.getNodeId() + " for key '"
                                     + ByteUtils.toHexString(v.getKey().get()) + "' with version "
                                     + v.getVersion() + ".");

                    NonblockingStore store = nonblockingStores.get(v.getNodeId());
                    store.submitPutRequest(v.getKey(), v.getVersioned(), null, null, timeoutMs);
                } catch(VoldemortApplicationException e) {
                    if(logger.isDebugEnabled())
                        logger.debug("Read repair cancelled due to application level exception on node "
                                     + v.getNodeId()
                                     + " for key '"
View Full Code Here

            if(logger.isTraceEnabled())
                logger.info("Submitting " + pipeline.getOperation().getSimpleName()
                            + " request on node " + node.getId());

            NonblockingStore store = nonblockingStores.get(node.getId());
            store.submitDeleteRequest(key, version, callback, timeoutMs);
        }

        try {
            long ellapsedNs = System.nanoTime() - beginTime;
            long remainingNs = (timeoutMs * Time.NS_PER_MS) - ellapsedNs;
View Full Code Here

            if(logger.isTraceEnabled())
                logger.trace("Submitting " + pipeline.getOperation().getSimpleName()
                             + " request on node " + node.getId() + " for key " + key);

            NonblockingStore store = nonblockingStores.get(node.getId());
            store.submitPutRequest(key, versionedCopy, transforms, callback, timeoutMs);
        }

        try {
            boolean preferredSatisfied = false;
            while(true) {
View Full Code Here

            if (logger.isTraceEnabled())
                logger.trace("Submitting " + pipeline.getOperation().getSimpleName()
                             + " request on node " + node.getId() + " for key " + key);

            NonblockingStore store = nonblockingStores.get(node.getId());

            if (pipeline.getOperation() == Operation.GET)
                store.submitGetRequest(key, transforms, callback, timeoutMs);
            else if (pipeline.getOperation() == Operation.GET_VERSIONS)
                store.submitGetVersionsRequest(key, callback, timeoutMs);
            else
                throw new IllegalStateException(getClass().getName()
                                                + " does not support pipeline operation "
                                                + pipeline.getOperation());
        }
View Full Code Here

                                                                      node,
                                                                      localNode);
                this.storeRepository.addNodeStore(node.getId(), store);
                nodeStores.put(node.getId(), store);

                NonblockingStore nonblockingStore = routedStoreFactory.toNonblockingStore(store);
                nonblockingStores.put(node.getId(), nonblockingStore);
            }

            Store<ByteArray, byte[], byte[]> store = routedStoreFactory.create(cluster,
                                                                               def,
View Full Code Here

            return;
        }
        final Node node = nodeToHostHint;
        int nodeId = node.getId();

        NonblockingStore nonblockingStore = nonblockingSlopStores.get(nodeId);
        Utils.notNull(nonblockingStore);

        final Long startNs = System.nanoTime();
        NonblockingStoreCallback callback = new NonblockingStoreCallback() {

            @Override
            public void requestComplete(Object result, long requestTime) {
                Slop slop = null;
                boolean loggerDebugEnabled = logger.isDebugEnabled();
                if(loggerDebugEnabled) {
                    slop = slopSerializer.toObject(slopVersioned.getValue());
                }
                Response<ByteArray, Object> response = new Response<ByteArray, Object>(node,
                                                                                       slopKey,
                                                                                       result,
                                                                                       requestTime);
                if(response.getValue() instanceof Exception
                   && !(response.getValue() instanceof ObsoleteVersionException)) {
                    if(!failedNodes.contains(node))
                        failedNodes.add(node);
                    if(response.getValue() instanceof UnreachableStoreException) {
                        UnreachableStoreException use = (UnreachableStoreException) response.getValue();

                        if(loggerDebugEnabled) {
                            logger.debug("Write of key " + slop.getKey() + " for "
                                         + slop.getNodeId() + " to node " + node
                                         + " failed due to unreachable: " + use.getMessage());
                        }

                        failureDetector.recordException(node, (System.nanoTime() - startNs)
                                                              / Time.NS_PER_MS, use);
                    }
                    sendOneAsyncHint(slopKey, slopVersioned, nodesToTry);
                }

                if(loggerDebugEnabled)
                    logger.debug("Slop write of key " + slop.getKey() + " for node "
                                 + slop.getNodeId() + " to node " + node + " succeeded in "
                                 + (System.nanoTime() - startNs) + " ns");

                failureDetector.recordSuccess(node, (System.nanoTime() - startNs) / Time.NS_PER_MS);

            }
        };
        nonblockingStore.submitPutRequest(slopKey, slopVersioned, null, callback, timeoutMs);
    }
View Full Code Here

                                                              node.getHost(),
                                                              getPort(node),
                                                              this.requestFormatType);
            clientMapping.put(node.getId(), store);

            NonblockingStore nonblockingStore = routedStoreFactory.toNonblockingStore(store);
            nonblockingStores.put(node.getId(), nonblockingStore);

            if(slopStores != null) {
                Store<ByteArray, byte[], byte[]> rawSlopStore = getStore("slop",
                                                                         node.getHost(),
View Full Code Here

TOP

Related Classes of voldemort.store.nonblockingstore.NonblockingStore

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.