• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RollbackStats类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.alibaba.rocketmq.common.admin.RollbackStats的典型用法代码示例。如果您正苦于以下问题:Java RollbackStats类的具体用法?Java RollbackStats怎么用?Java RollbackStats使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RollbackStats类属于com.alibaba.rocketmq.common.admin包,在下文中一共展示了RollbackStats类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: resetOffset

import com.alibaba.rocketmq.common.admin.RollbackStats; //导入依赖的package包/类
public static void resetOffset(DefaultMQAdminExt defaultMQAdminExt, String consumerGroup, String topic,
        long timestamp, boolean force, String timeStampStr) throws RemotingException, MQBrokerException,
        InterruptedException, MQClientException {
    List<RollbackStats> rollbackStatsList =
            defaultMQAdminExt.resetOffsetByTimestampOld(consumerGroup, topic, timestamp, force);
    System.out
        .printf(
            "rollback consumer offset by specified consumerGroup[%s], topic[%s], force[%s], timestamp(string)[%s], timestamp(long)[%s]\n",
            consumerGroup, topic, force, timeStampStr, timestamp);

    System.out.printf("%-20s  %-20s  %-20s  %-20s  %-20s  %-20s\n",//
        "#brokerName",//
        "#queueId",//
        "#brokerOffset",//
        "#consumerOffset",//
        "#timestampOffset",//
        "#rollbackOffset" //
    );

    for (RollbackStats rollbackStats : rollbackStatsList) {
        System.out.printf("%-20s  %-20d  %-20d  %-20d  %-20d  %-20d\n",//
            UtilAll.frontStringAtLeast(rollbackStats.getBrokerName(), 32),//
            rollbackStats.getQueueId(),//
            rollbackStats.getBrokerOffset(),//
            rollbackStats.getConsumerOffset(),//
            rollbackStats.getTimestampOffset(),//
            rollbackStats.getRollbackOffset() //
            );
    }
}
 
开发者ID:y123456yz,项目名称:reading-and-annotate-rocketmq-3.4.6,代码行数:31,代码来源:ResetOffsetByTimeOldCommand.java


示例2: resetOffsetByTimestampOld

import com.alibaba.rocketmq.common.admin.RollbackStats; //导入依赖的package包/类
public List<RollbackStats> resetOffsetByTimestampOld(String consumerGroup, String topic, long timestamp, boolean force)
        throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
    return defaultMQAdminExtImpl.resetOffsetByTimestampOld(consumerGroup, topic, timestamp, force);
}
 
开发者ID:y123456yz,项目名称:reading-and-annotate-rocketmq-3.4.6,代码行数:5,代码来源:DefaultMQAdminExt.java


示例3: resetOffsetByTimestampOld

import com.alibaba.rocketmq.common.admin.RollbackStats; //导入依赖的package包/类
List<RollbackStats> resetOffsetByTimestampOld(String consumerGroup, String topic, long timestamp, boolean force)
throws RemotingException, MQBrokerException, InterruptedException, MQClientException;
 
开发者ID:y123456yz,项目名称:reading-and-annotate-rocketmq-3.4.6,代码行数:3,代码来源:MQAdminExt.java


示例4: getRollbackStatsList

import com.alibaba.rocketmq.common.admin.RollbackStats; //导入依赖的package包/类
public List<RollbackStats> getRollbackStatsList() {
    return rollbackStatsList;
}
 
开发者ID:didapinchegit,项目名称:rocket-console,代码行数:4,代码来源:ConsumerGroupRollBackStat.java


示例5: setRollbackStatsList

import com.alibaba.rocketmq.common.admin.RollbackStats; //导入依赖的package包/类
public void setRollbackStatsList(List<RollbackStats> rollbackStatsList) {
    this.rollbackStatsList = rollbackStatsList;
}
 
开发者ID:didapinchegit,项目名称:rocket-console,代码行数:4,代码来源:ConsumerGroupRollBackStat.java


示例6: resetOffsetByTimestampOld

import com.alibaba.rocketmq.common.admin.RollbackStats; //导入依赖的package包/类
@Override
public List<RollbackStats> resetOffsetByTimestampOld(String consumerGroup, String topic, long timestamp,
                                                     boolean force) throws RemotingException, MQBrokerException, InterruptedException, MQClientException {
    return MQAdminInstance.threadLocalMQAdminExt().resetOffsetByTimestampOld(consumerGroup, topic, timestamp, force);
}
 
开发者ID:didapinchegit,项目名称:rocket-console,代码行数:6,代码来源:MQAdminExtImpl.java


示例7: resetOffsetByTimestampOld

import com.alibaba.rocketmq.common.admin.RollbackStats; //导入依赖的package包/类
public List<RollbackStats> resetOffsetByTimestampOld(String consumerGroup, String topic, long timestamp,
        boolean force) throws RemotingException, MQBrokerException, InterruptedException,
        MQClientException {
    return defaultMQAdminExtImpl.resetOffsetByTimestampOld(consumerGroup, topic, timestamp, force);
}
 
开发者ID:diwayou,项目名称:rocketmq-all-trans,代码行数:6,代码来源:DefaultMQAdminExt.java


示例8: resetOffsetByTimestampOld

import com.alibaba.rocketmq.common.admin.RollbackStats; //导入依赖的package包/类
@Override
public List<RollbackStats> resetOffsetByTimestampOld(String consumerGroup, String topic, long timestamp,
        boolean force) throws RemotingException, MQBrokerException, InterruptedException,
        MQClientException {
    TopicRouteData topicRouteData = this.examineTopicRouteInfo(topic);
    List<RollbackStats> rollbackStatsList = new ArrayList<RollbackStats>();
    for (BrokerData bd : topicRouteData.getBrokerDatas()) {
        String addr = bd.selectBrokerAddr();
        if (addr != null) {
            // 根据 consumerGroup 查找对应的 mq
            ConsumeStats consumeStats =
                    this.mQClientFactory.getMQClientAPIImpl().getConsumeStats(addr, consumerGroup, 3000);

            // 根据 topic 过滤不需要的 mq
            for (Map.Entry<MessageQueue, OffsetWrapper> entry : consumeStats.getOffsetTable().entrySet()) {
                MessageQueue queue = entry.getKey();
                OffsetWrapper offsetWrapper = entry.getValue();
                if (topic.equals(queue.getTopic())) {
                    // 根据 timestamp 查找对应的offset
                    long offset =
                            this.mQClientFactory.getMQClientAPIImpl().searchOffset(addr, topic,
                                queue.getQueueId(), timestamp, 3000);
                    // 构建按时间回溯消费进度
                    RollbackStats rollbackStats = new RollbackStats();
                    rollbackStats.setBrokerName(bd.getBrokerName());
                    rollbackStats.setQueueId(queue.getQueueId());
                    rollbackStats.setBrokerOffset(offsetWrapper.getBrokerOffset());
                    rollbackStats.setConsumerOffset(offsetWrapper.getConsumerOffset());
                    rollbackStats.setTimestampOffset(offset);
                    rollbackStats.setRollbackOffset(offsetWrapper.getConsumerOffset());
                    // 更新 offset
                    if (force || offset <= offsetWrapper.getConsumerOffset()) {
                        rollbackStats.setRollbackOffset(offset);
                        UpdateConsumerOffsetRequestHeader requestHeader =
                                new UpdateConsumerOffsetRequestHeader();
                        requestHeader.setConsumerGroup(consumerGroup);
                        requestHeader.setTopic(topic);
                        requestHeader.setQueueId(queue.getQueueId());
                        requestHeader.setCommitOffset(offset);
                        this.mQClientFactory.getMQClientAPIImpl().updateConsumerOffset(addr,
                            requestHeader, 3000);
                    }
                    rollbackStatsList.add(rollbackStats);
                }
            }
        }
    }
    return rollbackStatsList;
}
 
开发者ID:diwayou,项目名称:rocketmq-all-trans,代码行数:50,代码来源:DefaultMQAdminExtImpl.java


示例9: resetOffsetByTimestampOld

import com.alibaba.rocketmq.common.admin.RollbackStats; //导入依赖的package包/类
/**
 * 按照时间回溯消费进度(客户端需要重启)
 * 
 * @param consumerGroup
 * @param topic
 * @param timestamp
 * @param force
 * @throws RemotingException
 * @throws MQBrokerException
 * @throws InterruptedException
 * @throws MQClientException
 * @return
 */
public List<RollbackStats> resetOffsetByTimestampOld(String consumerGroup, String topic, long timestamp,
        boolean force) throws RemotingException, MQBrokerException, InterruptedException,
        MQClientException;
 
开发者ID:diwayou,项目名称:rocketmq-all-trans,代码行数:17,代码来源:MQAdminExt.java



注:本文中的com.alibaba.rocketmq.common.admin.RollbackStats类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FileSystemImporter类代码示例发布时间:2022-05-22
下一篇:
Java SpoonInterface类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap