Package com.taobao.metamorphosis.network

Examples of com.taobao.metamorphosis.network.DataCommand


        this.consumerFilterManager = this.mocksControl.createMock(ConsumerFilterManager.class);
        EasyMock.expect(this.consumerFilterManager.findFilter(this.topic, this.group))
        .andReturn(
            new AcceptMessageFilter());
        this.commandProcessor.setConsumerFilterManager(this.consumerFilterManager);
        this.conn.response(new DataCommand(msgBuf.array(), opaque, true));
        EasyMock.expectLastCall();
        this.mocksControl.replay();

        this.getProcessor.handleRequest(request, this.conn);
        this.mocksControl.verify();
View Full Code Here


                        if (bytes.length == 0) {
                            return new BooleanCommand(HttpStatus.Moved, String.valueOf(request.getOffset()
                                + it.getOffset()), request.getOpaque());
                        }
                    }
                    return new DataCommand(bytes, request.getOpaque(), true);
                }
            }
            else {
                this.statsManager.statsGetMiss(topic, group, 1);
                this.statsManager.statsGetFailed(topic, group, 1);
View Full Code Here

        EasyMock.expect(this.producerZooKeeper.selectBroker(topic, partition)).andReturn(url);
        EasyMock.expect(
            this.remotingClient.invokeToGroup(url,
                new GetCommand(topic, this.consumerConfig.getGroup(), partition.getPartition(), offset, maxSize,
                    Integer.MIN_VALUE), 10000, TimeUnit.MILLISECONDS)).andReturn(
                        new DataCommand(data, Integer.MIN_VALUE));
        this.mocksControl.replay();
        OpaqueGenerator.resetOpaque();
        assertEquals(messageIterator, this.consumer.get(topic, partition, offset, maxSize));
        this.mocksControl.verify();
    }
View Full Code Here

                    new GetCommand(fetchRequest.getTopic(), this.consumerConfig.getGroup(),
                        fetchRequest.getPartition(), currentOffset, fetchRequest.getMaxSize(),
                        OpaqueGenerator.getNextOpaque());
            final ResponseCommand response = this.remotingClient.invokeToGroup(serverUrl, getCmd, timeout, timeUnit);
            if (response instanceof DataCommand) {
                final DataCommand dataCmd = (DataCommand) response;
                final byte[] data = dataCmd.getData();
                // ��ȡ���������ز����ʱ������maxSize
                if (data.length < fetchRequest.getMaxSize() / 2) {
                    fetchRequest.decreaseMaxSize();
                }
                success = true;
View Full Code Here

TOP

Related Classes of com.taobao.metamorphosis.network.DataCommand

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.