Codota Logo
CommitLog.getMinOffset
Code IndexAdd Codota to your IDE (free)

How to use
getMinOffset
method
in
org.apache.rocketmq.store.CommitLog

Best Java code snippets using org.apache.rocketmq.store.CommitLog.getMinOffset (Showing top 15 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: apache/rocketmq

@Override
public long getMinPhyOffset() {
  return this.commitLog.getMinOffset();
}
origin: apache/rocketmq

private void recoverTopicQueueTable() {
  HashMap<String/* topic-queueid */, Long/* offset */> table = new HashMap<String, Long>(1024);
  long minPhyOffset = this.commitLog.getMinOffset();
  for (ConcurrentMap<Integer, ConsumeQueue> maps : this.consumeQueueTable.values()) {
    for (ConsumeQueue logic : maps.values()) {
      String key = logic.getTopic() + "-" + logic.getQueueId();
      table.put(key, logic.getMaxOffsetInQueue());
      logic.correctMinOffset(minPhyOffset);
    }
  }
  this.commitLog.setTopicQueueTable(table);
}
origin: apache/rocketmq

/**
 * According to receive certain message or offset storage time if an error occurs, it returns -1
 */
public long pickupStoreTimestamp(final long offset, final int size) {
  if (offset >= this.getMinOffset()) {
    SelectMappedBufferResult result = this.getMessage(offset, size);
    if (null != result) {
      try {
        return result.getByteBuffer().getLong(MessageDecoder.MESSAGE_STORE_TIMESTAMP_POSTION);
      } finally {
        result.release();
      }
    }
  }
  return -1;
}
origin: apache/rocketmq

private void deleteExpiredFiles() {
  int deleteLogicsFilesInterval = DefaultMessageStore.this.getMessageStoreConfig().getDeleteConsumeQueueFilesInterval();
  long minOffset = DefaultMessageStore.this.commitLog.getMinOffset();
  if (minOffset > this.lastPhysicalMinOffset) {
    this.lastPhysicalMinOffset = minOffset;
    ConcurrentMap<String, ConcurrentMap<Integer, ConsumeQueue>> tables = DefaultMessageStore.this.consumeQueueTable;
    for (ConcurrentMap<Integer, ConsumeQueue> maps : tables.values()) {
      for (ConsumeQueue logic : maps.values()) {
        int deleteCount = logic.deleteExpiredFile(minOffset);
        if (deleteCount > 0 && deleteLogicsFilesInterval > 0) {
          try {
            Thread.sleep(deleteLogicsFilesInterval);
          } catch (InterruptedException ignored) {
          }
        }
      }
    }
    DefaultMessageStore.this.indexService.deleteExpiredFile(minOffset);
  }
}
origin: apache/rocketmq

public void cleanExpiredConsumerQueue() {
  long minCommitLogOffset = this.commitLog.getMinOffset();
origin: didi/DDMQ

@Override
public long getMinPhyOffset() {
  return this.commitLog.getMinOffset();
}
origin: didi/DDMQ

private void recoverTopicQueueTable() {
  ConcurrentHashMap<String/* topic-queueid */, Long/* offset */> table = new ConcurrentHashMap<String, Long>(1024);
  long minPhyOffset = this.commitLog.getMinOffset();
  for (ConcurrentMap<Integer, ConsumeQueue> maps : this.consumeQueueTable.values()) {
    for (ConsumeQueue logic : maps.values()) {
      String key = logic.getTopic() + "-" + logic.getQueueId();
      table.put(key, logic.getMaxOffsetInQueue());
      logic.correctMinOffset(minPhyOffset);
    }
  }
  this.commitLog.setTopicQueueTable(table);
}
origin: didi/DDMQ

/**
 * According to receive certain message or offset storage time if an error occurs, it returns -1
 */
public long pickupStoreTimestamp(final long offset, final int size) {
  if (offset >= this.getMinOffset()) {
    SelectMappedBufferResult result = this.getMessage(offset, size);
    if (null != result) {
      try {
        return result.getByteBuffer().getLong(MessageDecoder.MESSAGE_STORE_TIMESTAMP_POSTION);
      } finally {
        result.release();
      }
    }
  }
  return -1;
}
origin: didi/DDMQ

public void cleanExpiredConsumerQueue() {
  long minCommitLogOffset = this.commitLog.getMinOffset();
origin: didi/DDMQ

private void deleteExpiredFiles() {
  int deleteLogicsFilesInterval = DefaultMessageStore.this.getMessageStoreConfig().getDeleteConsumeQueueFilesInterval();
  int readConsumeQueueFilesMaxWhenDel = DefaultMessageStore.this.getMessageStoreConfig().getReadConsumeQueueFilesMaxWhenDel();
  long minOffset = DefaultMessageStore.this.commitLog.getMinOffset();
  if (minOffset > this.lastPhysicalMinOffset) {
    this.lastPhysicalMinOffset = minOffset;
    ConcurrentMap<String, ConcurrentMap<Integer, ConsumeQueue>> tables = DefaultMessageStore.this.consumeQueueTable;
    int readCount = 0;
    for (ConcurrentMap<Integer, ConsumeQueue> maps : tables.values()) {
      for (ConsumeQueue logic : maps.values()) {
        int deleteCount = logic.deleteExpiredFile(minOffset);
        if ((deleteCount > 0 || readCount++ > readConsumeQueueFilesMaxWhenDel) && deleteLogicsFilesInterval > 0) {
          try {
            Thread.sleep(deleteLogicsFilesInterval);
            readCount = 0;
          } catch (InterruptedException ignored) {
          }
        }
      }
    }
    DefaultMessageStore.this.indexService.deleteExpiredFile(minOffset);
  }
}
origin: org.apache.rocketmq/rocketmq-store

@Override
public long getMinPhyOffset() {
  return this.commitLog.getMinOffset();
}
origin: org.apache.rocketmq/rocketmq-store

private void recoverTopicQueueTable() {
  HashMap<String/* topic-queueid */, Long/* offset */> table = new HashMap<String, Long>(1024);
  long minPhyOffset = this.commitLog.getMinOffset();
  for (ConcurrentMap<Integer, ConsumeQueue> maps : this.consumeQueueTable.values()) {
    for (ConsumeQueue logic : maps.values()) {
      String key = logic.getTopic() + "-" + logic.getQueueId();
      table.put(key, logic.getMaxOffsetInQueue());
      logic.correctMinOffset(minPhyOffset);
    }
  }
  this.commitLog.setTopicQueueTable(table);
}
origin: org.apache.rocketmq/rocketmq-store

/**
 * According to receive certain message or offset storage time if an error occurs, it returns -1
 */
public long pickupStoreTimestamp(final long offset, final int size) {
  if (offset >= this.getMinOffset()) {
    SelectMappedBufferResult result = this.getMessage(offset, size);
    if (null != result) {
      try {
        return result.getByteBuffer().getLong(MessageDecoder.MESSAGE_STORE_TIMESTAMP_POSTION);
      } finally {
        result.release();
      }
    }
  }
  return -1;
}
origin: org.apache.rocketmq/rocketmq-store

private void deleteExpiredFiles() {
  int deleteLogicsFilesInterval = DefaultMessageStore.this.getMessageStoreConfig().getDeleteConsumeQueueFilesInterval();
  long minOffset = DefaultMessageStore.this.commitLog.getMinOffset();
  if (minOffset > this.lastPhysicalMinOffset) {
    this.lastPhysicalMinOffset = minOffset;
    ConcurrentMap<String, ConcurrentMap<Integer, ConsumeQueue>> tables = DefaultMessageStore.this.consumeQueueTable;
    for (ConcurrentMap<Integer, ConsumeQueue> maps : tables.values()) {
      for (ConsumeQueue logic : maps.values()) {
        int deleteCount = logic.deleteExpiredFile(minOffset);
        if (deleteCount > 0 && deleteLogicsFilesInterval > 0) {
          try {
            Thread.sleep(deleteLogicsFilesInterval);
          } catch (InterruptedException ignored) {
          }
        }
      }
    }
    DefaultMessageStore.this.indexService.deleteExpiredFile(minOffset);
  }
}
origin: org.apache.rocketmq/rocketmq-store

public void cleanExpiredConsumerQueue() {
  long minCommitLogOffset = this.commitLog.getMinOffset();
org.apache.rocketmq.storeCommitLoggetMinOffset

Popular methods of CommitLog

  • <init>
  • appendData
  • calMsgLength
  • checkMessageAndReturnSize
    check the message and returns the message size
  • checkSelf
  • deleteExpiredFile
  • destroy
  • doNothingForDeadCode
  • flush
  • getBeginTimeInLock
  • getConfirmOffset
  • getData
  • getConfirmOffset,
  • getData,
  • getMaxOffset,
  • getMessage,
  • handleDiskFlush,
  • handleHA,
  • isMappedFileMatchedRecover,
  • load,
  • lockTimeMills

Popular in Java

  • Finding current android device location
  • onCreateOptionsMenu (Activity)
  • getSharedPreferences (Context)
  • getSystemService (Context)
  • Menu (java.awt)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • ArrayList (java.util)
    Resizable-array implementation of the List interface. Implements all optional list operations, and p
  • Table (org.hibernate.mapping)
    A relational table
  • Option (scala)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now