Package org.apache.hedwig.server.persistence

Examples of org.apache.hedwig.server.persistence.PersistRequest


                                                MessageSeqId.newBuilder(msg.getMsgId()).addRemoteComponents(
                                                    RegionSpecificSeqId.newBuilder().setRegion(
                                                        msg.getSrcRegion()).setSeqId(
                                                        msg.getMsgId().getLocalComponent())));
                                        }
                                        pm.persistMessage(new PersistRequest(topic, msg, new Callback<Long>() {
                                            @Override
                                            public void operationFinished(Object ctx, Long resultOfOperation) {
                                                if (LOGGER.isDebugEnabled())
                                                    LOGGER.debug("cross-region recv-fwd succeeded for topic "
                                                                 + topic.toStringUtf8());
View Full Code Here


        }

        Message msgToSerialize = Message.newBuilder(request.getPublishRequest().getMsg()).setSrcRegion(
                                     cfg.getMyRegionByteString()).build();

        PersistRequest persistRequest = new PersistRequest(request.getTopic(), msgToSerialize,
        new Callback<Long>() {
            @Override
            public void operationFailed(Object ctx, PubSubException exception) {
                channel.write(PubSubResponseUtils.getResponseForException(exception, request.getTxnId()));
            }
View Full Code Here

        Message msgToSerialize = Message.newBuilder(request.getPublishRequest().getMsg()).setSrcRegion(
                                     cfg.getMyRegionByteString()).build();

        final long requestTime = MathUtils.now();
        PersistRequest persistRequest = new PersistRequest(request.getTopic(), msgToSerialize,
        new Callback<PubSubProtocol.MessageSeqId>() {
            @Override
            public void operationFailed(Object ctx, PubSubException exception) {
                channel.write(PubSubResponseUtils.getResponseForException(exception, request.getTxnId()));
                pubStats.incrementFailedOps();
View Full Code Here

        MessageSeqId startId = MessageSeqId.newBuilder().setLocalComponent(1).build();

        CountDownLatch l = new CountDownLatch(1);
        Message m = Message.newBuilder().setBody(ByteString.copyFromUtf8(String.valueOf(1))).build();
        TestCallback cb = new TestCallback(l);
        pm.persistMessage(new PersistRequest(topic, m, cb, null));
        assertTrue("Persistence never finished", l.await(10, TimeUnit.SECONDS));

        final CountDownLatch oplatch = new CountDownLatch(3);
        fdm.start();
        fdm.startServingSubscription(topic, subscriber, prefs, startId, dep, filter,
View Full Code Here

            Message m = Message.newBuilder().setBody(ByteString.copyFromUtf8(String.valueOf(i))).build();
            TestCallback cb = new TestCallback(l);
            if (firstCallback == null) {
                firstCallback = cb;
            }
            pm.persistMessage(new PersistRequest(topic, m, cb, null));
        }
        fdm.start();
        assertTrue("Persistence never finished", l.await(10, TimeUnit.SECONDS));
        fdm.startServingSubscription(topic, subscriber, prefs, firstCallback.getId(), dep, filter,
                new Callback<Void>() {
View Full Code Here

                                    MessageSeqId.newBuilder(msg.getMsgId()).addRemoteComponents(
                                        RegionSpecificSeqId.newBuilder().setRegion(
                                            msg.getSrcRegion()).setSeqId(
                                            msg.getMsgId().getLocalComponent())));
                            }
                            pm.persistMessage(new PersistRequest(topic, msg, new Callback<MessageSeqId>() {
                                @Override
                                public void operationFinished(Object ctx, MessageSeqId resultOfOperation) {
                                    if (LOGGER.isDebugEnabled())
                                        LOGGER.debug("[" + myRegion + "] cross-region recv-fwd succeeded for topic "
                                                     + topic.toStringUtf8());
View Full Code Here

                                    MessageSeqId.newBuilder(msg.getMsgId()).addRemoteComponents(
                                        RegionSpecificSeqId.newBuilder().setRegion(
                                            msg.getSrcRegion()).setSeqId(
                                            msg.getMsgId().getLocalComponent())));
                            }
                            pm.persistMessage(new PersistRequest(topic, msg, new Callback<Long>() {
                                @Override
                                public void operationFinished(Object ctx, Long resultOfOperation) {
                                    if (LOGGER.isDebugEnabled())
                                        LOGGER.debug("[" + myRegion.toStringUtf8() + "] cross-region recv-fwd succeeded for topic "
                                                     + topic.toStringUtf8());
View Full Code Here

        Message msgToSerialize = Message.newBuilder(request.getPublishRequest().getMsg()).setSrcRegion(
                                     cfg.getMyRegionByteString()).build();

        final long requestTime = System.currentTimeMillis();
        PersistRequest persistRequest = new PersistRequest(request.getTopic(), msgToSerialize,
        new Callback<Long>() {
            @Override
            public void operationFailed(Object ctx, PubSubException exception) {
                channel.write(PubSubResponseUtils.getResponseForException(exception, request.getTxnId()));
                pubStats.incrementFailedOps();
View Full Code Here

TOP

Related Classes of org.apache.hedwig.server.persistence.PersistRequest

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.