Package com.alibaba.rocketmq.common.protocol.header

Examples of com.alibaba.rocketmq.common.protocol.header.QueryCorrectionOffsetHeader



    private RemotingCommand queryCorrectionOffset(ChannelHandlerContext ctx, RemotingCommand request)
            throws RemotingCommandException {
        final RemotingCommand response = RemotingCommand.createResponseCommand(null);
        QueryCorrectionOffsetHeader requestHeader =
                (QueryCorrectionOffsetHeader) request
                    .decodeCommandCustomHeader(QueryCorrectionOffsetHeader.class);

        Map<Integer, Long> correctionOffset =
                this.brokerController.getConsumerOffsetManager().queryMinOffsetInAllGroup(
                    requestHeader.getTopic(), requestHeader.getFilterGroups());

        Map<Integer, Long> compareOffset =
                this.brokerController.getConsumerOffsetManager().queryOffset(requestHeader.getTopic(),
                    requestHeader.getCompareGroup());

        if (compareOffset != null && !compareOffset.isEmpty()) {
            for (Integer queueId : compareOffset.keySet()) {
                correctionOffset.put(queueId,
                    correctionOffset.get(queueId) > compareOffset.get(queueId) ? Long.MAX_VALUE
View Full Code Here



    public Map<Integer, Long> queryCorrectionOffset(final String addr, final String group,
            final String topic, long timeoutMillis) throws MQClientException, RemotingConnectException,
            RemotingSendRequestException, RemotingTimeoutException, InterruptedException {
        QueryCorrectionOffsetHeader requestHeader = new QueryCorrectionOffsetHeader();
        requestHeader.setGroup(group);
        requestHeader.setTopic(topic);
        RemotingCommand request =
                RemotingCommand.createRequestCommand(RequestCode.QUERY_CORRECTION_OFFSET, requestHeader);

        RemotingCommand response = this.remotingClient.invokeSync(addr, request, timeoutMillis);
        assert response != null;
View Full Code Here


    private RemotingCommand queryCorrectionOffset(ChannelHandlerContext ctx, RemotingCommand request)
            throws RemotingCommandException {
        final RemotingCommand response = RemotingCommand.createResponseCommand(null);
        QueryCorrectionOffsetHeader requestHeader =
                (QueryCorrectionOffsetHeader) request
                    .decodeCommandCustomHeader(QueryCorrectionOffsetHeader.class);

        Map<Integer, Long> correctionOffset =
                this.brokerController.getConsumerOffsetManager().queryMinOffsetInAllGroup(
                    requestHeader.getTopic());

        Map<Integer, Long> compareOffset =
                this.brokerController.getConsumerOffsetManager().queryOffset(requestHeader.getTopic(),
                    requestHeader.getGroup());

        if (compareOffset != null && !compareOffset.isEmpty()) {
            for (Integer queueId : compareOffset.keySet()) {
                correctionOffset.put(queueId,
                    correctionOffset.get(queueId) > compareOffset.get(queueId) ? Long.MAX_VALUE
View Full Code Here

    public Map<Integer, Long> queryCorrectionOffset(final String addr, final String topic,
            final String group, Set<String> filterGroup, long timeoutMillis) throws MQClientException,
            RemotingConnectException, RemotingSendRequestException, RemotingTimeoutException,
            InterruptedException {
        QueryCorrectionOffsetHeader requestHeader = new QueryCorrectionOffsetHeader();
        requestHeader.setCompareGroup(group);
        requestHeader.setTopic(topic);
        if (filterGroup != null) {
            StringBuilder sb = new StringBuilder();
            String splitor = "";
            for (String s : filterGroup) {
                sb.append(splitor).append(s);
                splitor = ",";
            }
            requestHeader.setFilterGroups(sb.toString());
        }
        RemotingCommand request =
                RemotingCommand.createRequestCommand(RequestCode.QUERY_CORRECTION_OFFSET, requestHeader);

        RemotingCommand response = this.remotingClient.invokeSync(addr, request, timeoutMillis);
View Full Code Here

TOP

Related Classes of com.alibaba.rocketmq.common.protocol.header.QueryCorrectionOffsetHeader

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.