test_class.declarator: msg = "Once, there was a chance for me!"
test_class.modifier: private static final
test_class.original_string: private static final String msg = "Once, there was a chance for me!";
test_class.type: String
test_class.var_name: msg
test_class.declarator: msgBody = msg.getBytes()
test_class.modifier: private static final
test_class.original_string: private static final byte[] msgBody = msg.getBytes();
test_class.type: byte[]
test_class.var_name: msgBody
test_class.declarator: topic = "abc"
test_class.modifier: private static final
test_class.original_string: private static final String topic = "abc";
test_class.type: String
test_class.var_name: topic
test_class.declarator: queueId = 0
test_class.modifier: private static final
test_class.original_string: private static final int queueId = 0;
test_class.type: int
test_class.var_name: queueId
test_class.declarator: storePath = "." + File.separator + "unit_test_store"
test_class.modifier: private static final
test_class.original_string: private static final String storePath = "." + File.separator + "unit_test_store";
test_class.type: String
test_class.var_name: storePath
test_class.declarator: commitLogFileSize = 1024 * 8
test_class.modifier: private static final
test_class.original_string: private static final int commitLogFileSize = 1024 * 8;
test_class.type: int
test_class.var_name: commitLogFileSize
test_class.declarator: cqFileSize = 10 * 20
test_class.modifier: private static final
test_class.original_string: private static final int cqFileSize = 10 * 20;
test_class.type: int
test_class.var_name: cqFileSize
test_class.declarator: cqExtFileSize = 10 * (ConsumeQueueExt.CqExtUnit.MIN_EXT_UNIT_SIZE + 64)
test_class.modifier: private static final
test_class.original_string: private static final int cqExtFileSize = 10 * (ConsumeQueueExt.CqExtUnit.MIN_EXT_UNIT_SIZE + 64);
test_class.type: int
test_class.var_name: cqExtFileSize
test_class.declarator: BornHost
test_class.modifier: private static
test_class.original_string: private static SocketAddress BornHost;
test_class.type: SocketAddress
test_class.var_name: BornHost
test_class.declarator: StoreHost
test_class.modifier: private static
test_class.original_string: private static SocketAddress StoreHost;
test_class.type: SocketAddress
test_class.var_name: StoreHost
test_class.file: store/src/test/java/org/apache/rocketmq/store/ConsumeQueueTest.java
test_class.identifier: ConsumeQueueTest
test_case.body: @Test
      public void testPutMessagePositionInfo_buildCQRepeatedly() throws Exception {
          DefaultMessageStore messageStore = null;
          try {
  
              messageStore = gen();
  
              int totalMessages = 10;
  
              for (int i = 0; i < totalMessages; i++) {
                  putMsg(messageStore);
              }
              Thread.sleep(5);
  
              ConsumeQueue cq = messageStore.getConsumeQueueTable().get(topic).get(queueId);
              Method method = cq.getClass().getDeclaredMethod("putMessagePositionInfo", long.class, int.class, long.class, long.class);
  
              assertThat(method).isNotNull();
  
              method.setAccessible(true);
  
              SelectMappedBufferResult result = messageStore.getCommitLog().getData(0);
              assertThat(result != null).isTrue();
  
              DispatchRequest dispatchRequest = messageStore.getCommitLog().checkMessageAndReturnSize(result.getByteBuffer(), false, false);
  
              assertThat(cq).isNotNull();
  
              Object dispatchResult = method.invoke(cq, dispatchRequest.getCommitLogOffset(),
                  dispatchRequest.getMsgSize(), dispatchRequest.getTagsCode(), dispatchRequest.getConsumeQueueOffset());
  
              assertThat(Boolean.parseBoolean(dispatchResult.toString())).isTrue();
  
          } finally {
              if (messageStore != null) {
                  messageStore.shutdown();
                  messageStore.destroy();
              }
              deleteDirectory(storePath);
          }
  
      }
test_case.class_method_signature: ConsumeQueueTest.testPutMessagePositionInfo_buildCQRepeatedly()
test_case.full_signature: @Test public void testPutMessagePositionInfo_buildCQRepeatedly()
test_case.identifier: testPutMessagePositionInfo_buildCQRepeatedly
test_case.invocations: gen putMsg sleep get get getConsumeQueueTable getDeclaredMethod getClass isNotNull assertThat setAccessible getData getCommitLog isTrue assertThat checkMessageAndReturnSize getCommitLog getByteBuffer isNotNull assertThat invoke getCommitLogOffset getMsgSize getTagsCode getConsumeQueueOffset isTrue assertThat parseBoolean toString shutdown destroy deleteDirectory
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testPutMessagePositionInfo_buildCQRepeatedly()
focal_class.declarator: log = LoggerFactory.getLogger(LoggerName.STORE_LOGGER_NAME)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(LoggerName.STORE_LOGGER_NAME);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: CQ_STORE_UNIT_SIZE = 20
focal_class.modifier: public static final
focal_class.original_string: public static final int CQ_STORE_UNIT_SIZE = 20;
focal_class.type: int
focal_class.var_name: CQ_STORE_UNIT_SIZE
focal_class.declarator: LOG_ERROR = LoggerFactory.getLogger(LoggerName.STORE_ERROR_LOGGER_NAME)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG_ERROR = LoggerFactory.getLogger(LoggerName.STORE_ERROR_LOGGER_NAME);
focal_class.type: Logger
focal_class.var_name: LOG_ERROR
focal_class.declarator: defaultMessageStore
focal_class.modifier: private final
focal_class.original_string: private final DefaultMessageStore defaultMessageStore;
focal_class.type: DefaultMessageStore
focal_class.var_name: defaultMessageStore
focal_class.declarator: mappedFileQueue
focal_class.modifier: private final
focal_class.original_string: private final MappedFileQueue mappedFileQueue;
focal_class.type: MappedFileQueue
focal_class.var_name: mappedFileQueue
focal_class.declarator: topic
focal_class.modifier: private final
focal_class.original_string: private final String topic;
focal_class.type: String
focal_class.var_name: topic
focal_class.declarator: queueId
focal_class.modifier: private final
focal_class.original_string: private final int queueId;
focal_class.type: int
focal_class.var_name: queueId
focal_class.declarator: byteBufferIndex
focal_class.modifier: private final
focal_class.original_string: private final ByteBuffer byteBufferIndex;
focal_class.type: ByteBuffer
focal_class.var_name: byteBufferIndex
focal_class.declarator: storePath
focal_class.modifier: private final
focal_class.original_string: private final String storePath;
focal_class.type: String
focal_class.var_name: storePath
focal_class.declarator: mappedFileSize
focal_class.modifier: private final
focal_class.original_string: private final int mappedFileSize;
focal_class.type: int
focal_class.var_name: mappedFileSize
focal_class.declarator: maxPhysicOffset = -1
focal_class.modifier: private
focal_class.original_string: private long maxPhysicOffset = -1;
focal_class.type: long
focal_class.var_name: maxPhysicOffset
focal_class.declarator: minLogicOffset = 0
focal_class.modifier: private volatile
focal_class.original_string: private volatile long minLogicOffset = 0;
focal_class.type: long
focal_class.var_name: minLogicOffset
focal_class.declarator: consumeQueueExt = null
focal_class.modifier: private
focal_class.original_string: private ConsumeQueueExt consumeQueueExt = null;
focal_class.type: ConsumeQueueExt
focal_class.var_name: consumeQueueExt
focal_class.file: store/src/main/java/org/apache/rocketmq/store/ConsumeQueue.java
focal_class.identifier: ConsumeQueue
focal_class.class_method_signature: ConsumeQueue.ConsumeQueue(
          final String topic,
          final int queueId,
          final String storePath,
          final int mappedFileSize,
          final DefaultMessageStore defaultMessageStore)
focal_class.full_signature: public  ConsumeQueue(
          final String topic,
          final int queueId,
          final String storePath,
          final int mappedFileSize,
          final DefaultMessageStore defaultMessageStore)
focal_class.identifier: ConsumeQueue
focal_class.modifiers: public
focal_class.parameters: (
          final String topic,
          final int queueId,
          final String storePath,
          final int mappedFileSize,
          final DefaultMessageStore defaultMessageStore)
focal_class.signature:  ConsumeQueue(
          final String topic,
          final int queueId,
          final String storePath,
          final int mappedFileSize,
          final DefaultMessageStore defaultMessageStore)
focal_class.class_method_signature: ConsumeQueue.load()
focal_class.full_signature: public boolean load()
focal_class.identifier: load
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean load()
focal_class.class_method_signature: ConsumeQueue.recover()
focal_class.full_signature: public void recover()
focal_class.identifier: recover
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void recover()
focal_class.class_method_signature: ConsumeQueue.getOffsetInQueueByTime(final long timestamp)
focal_class.full_signature: public long getOffsetInQueueByTime(final long timestamp)
focal_class.identifier: getOffsetInQueueByTime
focal_class.modifiers: public
focal_class.parameters: (final long timestamp)
focal_class.return: long
focal_class.signature: long getOffsetInQueueByTime(final long timestamp)
focal_class.class_method_signature: ConsumeQueue.truncateDirtyLogicFiles(long phyOffet)
focal_class.full_signature: public void truncateDirtyLogicFiles(long phyOffet)
focal_class.identifier: truncateDirtyLogicFiles
focal_class.modifiers: public
focal_class.parameters: (long phyOffet)
focal_class.return: void
focal_class.signature: void truncateDirtyLogicFiles(long phyOffet)
focal_class.class_method_signature: ConsumeQueue.getLastOffset()
focal_class.full_signature: public long getLastOffset()
focal_class.identifier: getLastOffset
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long getLastOffset()
focal_class.class_method_signature: ConsumeQueue.flush(final int flushLeastPages)
focal_class.full_signature: public boolean flush(final int flushLeastPages)
focal_class.identifier: flush
focal_class.modifiers: public
focal_class.parameters: (final int flushLeastPages)
focal_class.return: boolean
focal_class.signature: boolean flush(final int flushLeastPages)
focal_class.class_method_signature: ConsumeQueue.deleteExpiredFile(long offset)
focal_class.full_signature: public int deleteExpiredFile(long offset)
focal_class.identifier: deleteExpiredFile
focal_class.modifiers: public
focal_class.parameters: (long offset)
focal_class.return: int
focal_class.signature: int deleteExpiredFile(long offset)
focal_class.class_method_signature: ConsumeQueue.correctMinOffset(long phyMinOffset)
focal_class.full_signature: public void correctMinOffset(long phyMinOffset)
focal_class.identifier: correctMinOffset
focal_class.modifiers: public
focal_class.parameters: (long phyMinOffset)
focal_class.return: void
focal_class.signature: void correctMinOffset(long phyMinOffset)
focal_class.class_method_signature: ConsumeQueue.getMinOffsetInQueue()
focal_class.full_signature: public long getMinOffsetInQueue()
focal_class.identifier: getMinOffsetInQueue
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long getMinOffsetInQueue()
focal_class.class_method_signature: ConsumeQueue.putMessagePositionInfoWrapper(DispatchRequest request)
focal_class.full_signature: public void putMessagePositionInfoWrapper(DispatchRequest request)
focal_class.identifier: putMessagePositionInfoWrapper
focal_class.modifiers: public
focal_class.parameters: (DispatchRequest request)
focal_class.return: void
focal_class.signature: void putMessagePositionInfoWrapper(DispatchRequest request)
focal_class.class_method_signature: ConsumeQueue.putMessagePositionInfo(final long offset, final int size, final long tagsCode,
          final long cqOffset)
focal_class.full_signature: private boolean putMessagePositionInfo(final long offset, final int size, final long tagsCode,
          final long cqOffset)
focal_class.identifier: putMessagePositionInfo
focal_class.modifiers: private
focal_class.parameters: (final long offset, final int size, final long tagsCode,
          final long cqOffset)
focal_class.return: boolean
focal_class.signature: boolean putMessagePositionInfo(final long offset, final int size, final long tagsCode,
          final long cqOffset)
focal_class.class_method_signature: ConsumeQueue.fillPreBlank(final MappedFile mappedFile, final long untilWhere)
focal_class.full_signature: private void fillPreBlank(final MappedFile mappedFile, final long untilWhere)
focal_class.identifier: fillPreBlank
focal_class.modifiers: private
focal_class.parameters: (final MappedFile mappedFile, final long untilWhere)
focal_class.return: void
focal_class.signature: void fillPreBlank(final MappedFile mappedFile, final long untilWhere)
focal_class.class_method_signature: ConsumeQueue.getIndexBuffer(final long startIndex)
focal_class.full_signature: public SelectMappedBufferResult getIndexBuffer(final long startIndex)
focal_class.identifier: getIndexBuffer
focal_class.modifiers: public
focal_class.parameters: (final long startIndex)
focal_class.return: SelectMappedBufferResult
focal_class.signature: SelectMappedBufferResult getIndexBuffer(final long startIndex)
focal_class.class_method_signature: ConsumeQueue.getExt(final long offset)
focal_class.full_signature: public ConsumeQueueExt.CqExtUnit getExt(final long offset)
focal_class.identifier: getExt
focal_class.modifiers: public
focal_class.parameters: (final long offset)
focal_class.return: ConsumeQueueExt.CqExtUnit
focal_class.signature: ConsumeQueueExt.CqExtUnit getExt(final long offset)
focal_class.class_method_signature: ConsumeQueue.getExt(final long offset, ConsumeQueueExt.CqExtUnit cqExtUnit)
focal_class.full_signature: public boolean getExt(final long offset, ConsumeQueueExt.CqExtUnit cqExtUnit)
focal_class.identifier: getExt
focal_class.modifiers: public
focal_class.parameters: (final long offset, ConsumeQueueExt.CqExtUnit cqExtUnit)
focal_class.return: boolean
focal_class.signature: boolean getExt(final long offset, ConsumeQueueExt.CqExtUnit cqExtUnit)
focal_class.class_method_signature: ConsumeQueue.getMinLogicOffset()
focal_class.full_signature: public long getMinLogicOffset()
focal_class.identifier: getMinLogicOffset
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long getMinLogicOffset()
focal_class.class_method_signature: ConsumeQueue.setMinLogicOffset(long minLogicOffset)
focal_class.full_signature: public void setMinLogicOffset(long minLogicOffset)
focal_class.identifier: setMinLogicOffset
focal_class.modifiers: public
focal_class.parameters: (long minLogicOffset)
focal_class.return: void
focal_class.signature: void setMinLogicOffset(long minLogicOffset)
focal_class.class_method_signature: ConsumeQueue.rollNextFile(final long index)
focal_class.full_signature: public long rollNextFile(final long index)
focal_class.identifier: rollNextFile
focal_class.modifiers: public
focal_class.parameters: (final long index)
focal_class.return: long
focal_class.signature: long rollNextFile(final long index)
focal_class.class_method_signature: ConsumeQueue.getTopic()
focal_class.full_signature: public String getTopic()
focal_class.identifier: getTopic
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getTopic()
focal_class.class_method_signature: ConsumeQueue.getQueueId()
focal_class.full_signature: public int getQueueId()
focal_class.identifier: getQueueId
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getQueueId()
focal_class.class_method_signature: ConsumeQueue.getMaxPhysicOffset()
focal_class.full_signature: public long getMaxPhysicOffset()
focal_class.identifier: getMaxPhysicOffset
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long getMaxPhysicOffset()
focal_class.class_method_signature: ConsumeQueue.setMaxPhysicOffset(long maxPhysicOffset)
focal_class.full_signature: public void setMaxPhysicOffset(long maxPhysicOffset)
focal_class.identifier: setMaxPhysicOffset
focal_class.modifiers: public
focal_class.parameters: (long maxPhysicOffset)
focal_class.return: void
focal_class.signature: void setMaxPhysicOffset(long maxPhysicOffset)
focal_class.class_method_signature: ConsumeQueue.destroy()
focal_class.full_signature: public void destroy()
focal_class.identifier: destroy
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void destroy()
focal_class.class_method_signature: ConsumeQueue.getMessageTotalInQueue()
focal_class.full_signature: public long getMessageTotalInQueue()
focal_class.identifier: getMessageTotalInQueue
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long getMessageTotalInQueue()
focal_class.class_method_signature: ConsumeQueue.getMaxOffsetInQueue()
focal_class.full_signature: public long getMaxOffsetInQueue()
focal_class.identifier: getMaxOffsetInQueue
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long getMaxOffsetInQueue()
focal_class.class_method_signature: ConsumeQueue.checkSelf()
focal_class.full_signature: public void checkSelf()
focal_class.identifier: checkSelf
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void checkSelf()
focal_class.class_method_signature: ConsumeQueue.isExtReadEnable()
focal_class.full_signature: protected boolean isExtReadEnable()
focal_class.identifier: isExtReadEnable
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isExtReadEnable()
focal_class.class_method_signature: ConsumeQueue.isExtWriteEnable()
focal_class.full_signature: protected boolean isExtWriteEnable()
focal_class.identifier: isExtWriteEnable
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isExtWriteEnable()
focal_class.class_method_signature: ConsumeQueue.isExtAddr(long tagsCode)
focal_class.full_signature: public boolean isExtAddr(long tagsCode)
focal_class.identifier: isExtAddr
focal_class.modifiers: public
focal_class.parameters: (long tagsCode)
focal_class.return: boolean
focal_class.signature: boolean isExtAddr(long tagsCode)
focal_class.class_method_signature: ConsumeQueue.deleteExpiredFileByIndex(int startIndex)
focal_class.full_signature: public void deleteExpiredFileByIndex(int startIndex)
focal_class.identifier: deleteExpiredFileByIndex
focal_class.modifiers: public
focal_class.parameters: (int startIndex)
focal_class.return: void
focal_class.signature: void deleteExpiredFileByIndex(int startIndex)
focal_method.body: public void destroy() {
          this.maxPhysicOffset = -1;
          this.minLogicOffset = 0;
          this.mappedFileQueue.destroy();
          if (isExtReadEnable()) {
              this.consumeQueueExt.destroy();
          }
      }
focal_method.class_method_signature: ConsumeQueue.destroy()
focal_method.full_signature: public void destroy()
focal_method.identifier: destroy
focal_method.invocations: destroy isExtReadEnable destroy
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void destroy()