當前位置: 首頁>>代碼示例>>Java>>正文


Java ProcessQueueInfo類代碼示例

本文整理匯總了Java中com.alibaba.rocketmq.common.protocol.body.ProcessQueueInfo的典型用法代碼示例。如果您正苦於以下問題:Java ProcessQueueInfo類的具體用法?Java ProcessQueueInfo怎麽用?Java ProcessQueueInfo使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ProcessQueueInfo類屬於com.alibaba.rocketmq.common.protocol.body包,在下文中一共展示了ProcessQueueInfo類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: fillProcessQueueInfo

import com.alibaba.rocketmq.common.protocol.body.ProcessQueueInfo; //導入依賴的package包/類
public void fillProcessQueueInfo(final ProcessQueueInfo info) {
    try {
        this.lockTreeMap.readLock().lockInterruptibly();

        if (!this.msgTreeMap.isEmpty()) {
            info.setCachedMsgMinOffset(this.msgTreeMap.firstKey());
            info.setCachedMsgMaxOffset(this.msgTreeMap.lastKey());
            info.setCachedMsgCount(this.msgTreeMap.size());
        }

        if (!this.msgTreeMapTemp.isEmpty()) {
            info.setTransactionMsgMinOffset(this.msgTreeMapTemp.firstKey());
            info.setTransactionMsgMaxOffset(this.msgTreeMapTemp.lastKey());
            info.setTransactionMsgCount(this.msgTreeMapTemp.size());
        }

        info.setLocked(this.locked);
        info.setTryUnlockTimes(this.tryUnlockTimes.get());
        info.setLastLockTimestamp(this.lastLockTimestamp);

        info.setDroped(this.dropped);
        info.setLastPullTimestamp(this.lastPullTimestamp);
        info.setLastConsumeTimestamp(this.lastConsumeTimestamp);
    }
    catch (Exception e) {
    }
    finally {
        this.lockTreeMap.readLock().unlock();
    }
}
 
開發者ID:y123456yz,項目名稱:reading-and-annotate-rocketmq-3.4.6,代碼行數:31,代碼來源:ProcessQueue.java

示例2: consumerRunningInfo

import com.alibaba.rocketmq.common.protocol.body.ProcessQueueInfo; //導入依賴的package包/類
@Override
public ConsumerRunningInfo consumerRunningInfo() {
    ConsumerRunningInfo info = new ConsumerRunningInfo();

    Properties prop = MixAll.object2Properties(this.defaultMQPushConsumer);

    prop.put(ConsumerRunningInfo.PROP_CONSUME_ORDERLY, String.valueOf(this.consumeOrderly));
    prop.put(ConsumerRunningInfo.PROP_THREADPOOL_CORE_SIZE,
        String.valueOf(this.consumeMessageService.getCorePoolSize()));
    prop.put(ConsumerRunningInfo.PROP_CONSUMER_START_TIMESTAMP,
        String.valueOf(this.consumerStartTimestamp));

    info.setProperties(prop);

    Set<SubscriptionData> subSet = this.subscriptions();
    info.getSubscriptionSet().addAll(subSet);

    Iterator<Entry<MessageQueue, ProcessQueue>> it =
            this.rebalanceImpl.getProcessQueueTable().entrySet().iterator();
    while (it.hasNext()) {
        Entry<MessageQueue, ProcessQueue> next = it.next();
        MessageQueue mq = next.getKey();
        ProcessQueue pq = next.getValue();

        ProcessQueueInfo pqinfo = new ProcessQueueInfo();
        pqinfo.setCommitOffset(this.offsetStore.readOffset(mq, ReadOffsetType.MEMORY_FIRST_THEN_STORE));
        pq.fillProcessQueueInfo(pqinfo);
        info.getMqTable().put(mq, pqinfo);
    }

    for (SubscriptionData sd : subSet) {
        ConsumeStatus consumeStatus =
                this.mQClientFactory.getConsumerStatsManager().consumeStatus(this.groupName(),
                    sd.getTopic());
        info.getStatusTable().put(sd.getTopic(), consumeStatus);
    }

    return info;
}
 
開發者ID:y123456yz,項目名稱:reading-and-annotate-rocketmq-3.4.6,代碼行數:40,代碼來源:DefaultMQPushConsumerImpl.java

示例3: fillProcessQueueInfo

import com.alibaba.rocketmq.common.protocol.body.ProcessQueueInfo; //導入依賴的package包/類
public void fillProcessQueueInfo(final ProcessQueueInfo info) {
    try {
        this.lockTreeMap.readLock().lockInterruptibly();

        if (!this.msgTreeMap.isEmpty()) {
            info.setCachedMsgMinOffset(this.msgTreeMap.firstKey());
            info.setCachedMsgMaxOffset(this.msgTreeMap.lastKey());
            info.setCachedMsgCount(this.msgTreeMap.size());
        }

        if (!this.msgTreeMapTemp.isEmpty()) {
            info.setTransactionMsgMinOffset(this.msgTreeMapTemp.firstKey());
            info.setTransactionMsgMaxOffset(this.msgTreeMapTemp.lastKey());
            info.setTransactionMsgCount(this.msgTreeMapTemp.size());
        }

        info.setLocked(this.locked);
        info.setTryUnlockTimes(this.tryUnlockTimes.get());
        info.setLastLockTimestamp(this.lastLockTimestamp);

        info.setDroped(this.dropped);
        info.setLastPullTimestamp(this.lastPullTimestamp);
        info.setLastConsumeTimestamp(this.lastConsumeTimestamp);
    } catch (Exception e) {
    } finally {
        this.lockTreeMap.readLock().unlock();
    }
}
 
開發者ID:medusar,項目名稱:rocketmq-commet,代碼行數:29,代碼來源:ProcessQueue.java

示例4: consumerRunningInfo

import com.alibaba.rocketmq.common.protocol.body.ProcessQueueInfo; //導入依賴的package包/類
@Override
public ConsumerRunningInfo consumerRunningInfo() {
    ConsumerRunningInfo info = new ConsumerRunningInfo();

    Properties prop = MixAll.object2Properties(this.defaultMQPushConsumer);

    prop.put(ConsumerRunningInfo.PROP_CONSUME_ORDERLY, String.valueOf(this.consumeOrderly));
    prop.put(ConsumerRunningInfo.PROP_THREADPOOL_CORE_SIZE,
            String.valueOf(this.consumeMessageService.getCorePoolSize()));
    prop.put(ConsumerRunningInfo.PROP_CONSUMER_START_TIMESTAMP,
            String.valueOf(this.consumerStartTimestamp));

    info.setProperties(prop);

    Set<SubscriptionData> subSet = this.subscriptions();
    info.getSubscriptionSet().addAll(subSet);

    Iterator<Entry<MessageQueue, ProcessQueue>> it =
            this.rebalanceImpl.getProcessQueueTable().entrySet().iterator();
    while (it.hasNext()) {
        Entry<MessageQueue, ProcessQueue> next = it.next();
        MessageQueue mq = next.getKey();
        ProcessQueue pq = next.getValue();

        ProcessQueueInfo pqinfo = new ProcessQueueInfo();
        pqinfo.setCommitOffset(this.offsetStore.readOffset(mq, ReadOffsetType.MEMORY_FIRST_THEN_STORE));
        pq.fillProcessQueueInfo(pqinfo);
        info.getMqTable().put(mq, pqinfo);
    }

    for (SubscriptionData sd : subSet) {
        ConsumeStatus consumeStatus =
                this.mqClientInstance.getConsumerStatsManager().consumeStatus(this.groupName(),
                        sd.getTopic());
        info.getStatusTable().put(sd.getTopic(), consumeStatus);
    }

    return info;
}
 
開發者ID:medusar,項目名稱:rocketmq-commet,代碼行數:40,代碼來源:DefaultMQPushConsumerImpl.java


注:本文中的com.alibaba.rocketmq.common.protocol.body.ProcessQueueInfo類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。