Examples of ByteString


Examples of com.google.protobuf.ByteString

        }
    }

    @Test
    public void testAttachToSubscriptionFailure() throws Exception {
        ByteString topic = getTopic(0);
        subscriber.asyncSubscribe(topic, localSubscriberId, CreateOrAttach.ATTACH, new TestCallback(queue), null);
        assertFalse(queue.take());
    }
View Full Code Here

Examples of com.google.protobuf.ByteString

            UmbrellaHandler.sendErrorResponseToMalformedRequest(channel, request.getTxnId(),
                    "Missing stop delivery request data");
            return;
        }

        final ByteString topic = request.getTopic();
        final ByteString subscriberId = request.getStartDeliveryRequest().getSubscriberId();

        synchronized (tracker) {
            try {
                tracker.checkChannelMatches(topic, subscriberId, channel);
            } catch (PubSubException e) {
View Full Code Here

Examples of com.google.protobuf.ByteString

            UmbrellaHandler.sendErrorResponseToMalformedRequest(channel, request.getTxnId(),
                    "Missing start delivery request data");
            return;
        }

        final ByteString topic = request.getTopic();
        final ByteString subscriberId = request.getStartDeliveryRequest().getSubscriberId();

        synchronized (tracker) {
            // try {
            // tracker.checkChannelMatches(topic, subscriberId, channel);
            // } catch (PubSubException e) {
View Full Code Here

Examples of com.google.protobuf.ByteString

        List<Thread> scannerThreads = new LinkedList<Thread>();
        Thread thread;
        Semaphore latch = new Semaphore(1);

        for (int i = 0; i < NUM_TOPICS_TO_TEST; i++) {
            ByteString topic = getTopicName(i);

            if (persistenceManager instanceof TopicOwnershipChangeListener) {

                TopicOwnershipChangeListener tocl = (TopicOwnershipChangeListener) persistenceManager;
View Full Code Here

Examples of com.google.protobuf.ByteString

        assertTrue(consumeQueue.take());
    }

    @Test
    public void testAsyncSubscribeAndUnsubscribe() throws Exception {
        ByteString topic = ByteString.copyFromUtf8("myAsyncUnsubTopic");
        ByteString subscriberId = ByteString.copyFromUtf8("1");
        subscriber.asyncSubscribe(topic, subscriberId, CreateOrAttach.CREATE_OR_ATTACH, new TestCallback(), null);
        assertTrue(queue.take());
        subscriber.asyncUnsubscribe(topic, subscriberId, new TestCallback(), null);
        assertTrue(queue.take());
    }
View Full Code Here

Examples of com.google.protobuf.ByteString

        assertTrue(unsubscribeSuccess);
    }

    @Test
    public void testAsyncSubscribeAndCloseSubscription() throws Exception {
        ByteString topic = ByteString.copyFromUtf8("myAsyncSubAndCloseSubTopic");
        ByteString subscriberId = ByteString.copyFromUtf8("1");
        subscriber.asyncSubscribe(topic, subscriberId, CreateOrAttach.CREATE_OR_ATTACH, new TestCallback(), null);
        assertTrue(queue.take());
        subscriber.closeSubscription(topic, subscriberId);
        assertTrue(true);
    }
View Full Code Here

Examples of com.google.protobuf.ByteString

     * ensure that the next readAheadCount messages are always available.
     *
     * @return the range scan that should be issued for read ahead
     */
    protected RangeScanRequest doReadAhead(ScanRequest request) {
        ByteString topic = request.getTopic();
        Long seqId = request.getStartSeqId();

        int readAheadCount = cfg.getReadAheadCount();
        // To prevent us from getting screwed by bad configuration
        readAheadCount = Math.max(1, readAheadCount);
View Full Code Here

Examples of com.google.protobuf.ByteString

                                     boolean pruneTopic) {

        assert seqId != null;

        // remove this subscriber from the delivery pointers data structure
        ByteString topic = subscriber.getTopic();
        SortedMap<Long, Set<ActiveSubscriberState>> deliveryPtrs = perTopicDeliveryPtrs.get(topic);

        if (deliveryPtrs == null && !isAbsenceOk) {
            throw new UnexpectedError("No delivery pointers found while disconnecting " + "channel for topic:" + topic);
        }
View Full Code Here

Examples of com.linkedin.data.ByteString

            RestRequest request = rb.build();
            Future<RestResponse> f = client.restRequest(request);

            // This will block
            RestResponse response = f.get();
            final ByteString entity = response.getEntity();
            if(entity == null) {
                if(logger.isDebugEnabled()) {
                    logger.debug("Empty response !");
                }
            }
View Full Code Here

Examples of com.linkedin.data.ByteString

            String timeoutStr = Long.toString(this.config.getTimeoutConfig()
                                                         .getOperationTimeout(VoldemortOpCode.GET_OP_CODE));
            rb.setHeader("Accept", MULTIPART_CONTENT_TYPE);

            RestResponse response = fetchGetResponse(rb, timeoutStr);
            final ByteString entity = response.getEntity();
            if(entity != null) {
                resultList = parseGetResponse(entity);
            } else {
                if(logger.isDebugEnabled()) {
                    logger.debug("Did not get any response!");
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.