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

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

Best Java code snippets using org.apache.rocketmq.store.CommitLog.getMaxOffset (Showing top 20 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 getMaxPhyOffset() {
  return this.commitLog.getMaxOffset();
}
origin: apache/rocketmq

public long behind() {
  return DefaultMessageStore.this.commitLog.getMaxOffset() - this.reputFromOffset;
}
origin: apache/rocketmq

private boolean isCommitLogAvailable() {
  return this.reputFromOffset < DefaultMessageStore.this.commitLog.getMaxOffset();
}
origin: apache/rocketmq

@Override
public long slaveFallBehindMuch() {
  return this.commitLog.getMaxOffset() - this.haService.getPush2SlaveMaxOffset().get();
}
origin: apache/rocketmq

@Override
public void shutdown() {
  for (int i = 0; i < 50 && this.isCommitLogAvailable(); i++) {
    try {
      Thread.sleep(100);
    } catch (InterruptedException ignored) {
    }
  }
  if (this.isCommitLogAvailable()) {
    log.warn("shutdown ReputMessageService, but commitlog have not finish to be dispatched, CL: {} reputFromOffset: {}",
      DefaultMessageStore.this.commitLog.getMaxOffset(), this.reputFromOffset);
  }
  super.shutdown();
}
origin: apache/rocketmq

/**
 * @throws Exception
 */
public void start() throws Exception {
  lock = lockFile.getChannel().tryLock(0, 1, false);
  if (lock == null || lock.isShared() || !lock.isValid()) {
    throw new RuntimeException("Lock failed,MQ already started");
  }
  lockFile.getChannel().write(ByteBuffer.wrap("lock".getBytes()));
  lockFile.getChannel().force(true);
  this.flushConsumeQueueService.start();
  this.commitLog.start();
  this.storeStatsService.start();
  if (this.scheduleMessageService != null && SLAVE != messageStoreConfig.getBrokerRole()) {
    this.scheduleMessageService.start();
  }
  if (this.getMessageStoreConfig().isDuplicationEnable()) {
    this.reputMessageService.setReputFromOffset(this.commitLog.getConfirmOffset());
  } else {
    this.reputMessageService.setReputFromOffset(this.commitLog.getMaxOffset());
  }
  this.reputMessageService.start();
  this.haService.start();
  this.createTempFile();
  this.addScheduleTask();
  this.shutdown = false;
}
origin: apache/rocketmq

@Override
public boolean checkInDiskByConsumeOffset(final String topic, final int queueId, long consumeOffset) {
  final long maxOffsetPy = this.commitLog.getMaxOffset();
  ConsumeQueue consumeQueue = findConsumeQueue(topic, queueId);
  if (consumeQueue != null) {
    SelectMappedBufferResult bufferConsumeQueue = consumeQueue.getIndexBuffer(consumeOffset);
    if (bufferConsumeQueue != null) {
      try {
        for (int i = 0; i < bufferConsumeQueue.getSize(); ) {
          i += ConsumeQueue.CQ_STORE_UNIT_SIZE;
          long offsetPy = bufferConsumeQueue.getByteBuffer().getLong();
          return checkInDiskByCommitOffset(offsetPy, maxOffsetPy);
        }
      } finally {
        bufferConsumeQueue.release();
      }
    } else {
      return false;
    }
  }
  return false;
}
origin: apache/rocketmq

long masterOffset = HAConnection.this.haService.getDefaultMessageStore().getCommitLog().getMaxOffset();
masterOffset =
  masterOffset
origin: didi/DDMQ

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

private boolean isCommitLogAvailable() {
  return this.reputFromOffset < DefaultMessageStore.this.commitLog.getMaxOffset();
}
origin: didi/DDMQ

public long behind() {
  return DefaultMessageStore.this.commitLog.getMaxOffset() - this.reputFromOffset;
}
origin: didi/DDMQ

@Override
public long slaveFallBehindMuch() {
  return this.commitLog.getMaxOffset() - this.haService.getPush2SlaveMaxOffset().get();
}
origin: apache/rocketmq

final long maxOffsetPy = this.commitLog.getMaxOffset();
origin: didi/DDMQ

@Override
public void shutdown() {
  for (int i = 0; i < 50 && this.isCommitLogAvailable(); i++) {
    try {
      Thread.sleep(100);
    } catch (InterruptedException ignored) {
    }
  }
  if (this.isCommitLogAvailable()) {
    log.warn("shutdown ReputMessageService, but commitlog have not finish to be dispatched, CL: {} reputFromOffset: {}",
      DefaultMessageStore.this.commitLog.getMaxOffset(), this.reputFromOffset);
  }
  super.shutdown();
}
origin: didi/DDMQ

@Override
public boolean checkInDiskByConsumeOffset(final String topic, final int queueId, long consumeOffset) {
  final long maxOffsetPy = this.commitLog.getMaxOffset();
  ConsumeQueue consumeQueue = findConsumeQueue(topic, queueId);
  if (consumeQueue != null) {
    SelectMappedBufferResult bufferConsumeQueue = consumeQueue.getIndexBuffer(consumeOffset);
    if (bufferConsumeQueue != null) {
      try {
        for (int i = 0; i < bufferConsumeQueue.getSize(); ) {
          i += ConsumeQueue.CQ_STORE_UNIT_SIZE;
          long offsetPy = bufferConsumeQueue.getByteBuffer().getLong();
          return checkInDiskByCommitOffset(offsetPy, maxOffsetPy);
        }
      } finally {
        bufferConsumeQueue.release();
      }
    } else {
      return false;
    }
  }
  return false;
}
origin: didi/DDMQ

/**
 * @throws Exception
 */
public void start() throws Exception {
  lock = lockFile.getChannel().tryLock(0, 1, false);
  if (lock == null || lock.isShared() || !lock.isValid()) {
    throw new RuntimeException("Lock failed,MQ already started");
  }
  lockFile.getChannel().write(ByteBuffer.wrap("lock".getBytes()));
  lockFile.getChannel().force(true);
  this.flushConsumeQueueService.start();
  this.commitLog.start();
  this.storeStatsService.start();
  if (this.scheduleMessageService != null && BrokerRole.SLAVE != messageStoreConfig.getBrokerRole()) {
    this.scheduleMessageService.start();
  }
  if (this.getMessageStoreConfig().isDuplicationEnable()) {
    this.reputMessageService.setReputFromOffset(this.commitLog.getConfirmOffset());
  } else {
    this.reputMessageService.setReputFromOffset(this.commitLog.getMaxOffset());
  }
  this.reputMessageService.start();
  this.haService.start();
  this.createTempFile();
  this.addScheduleTask();
  if (BrokerRole.SLAVE != messageStoreConfig.getBrokerRole()) {
    this.haService.initInSyncOffset(getMaxPhyOffset());
  }
  this.shutdown = false;
}
origin: didi/DDMQ

long masterOffset = HAConnection.this.haService.getDefaultMessageStore().getCommitLog().getMaxOffset();
masterOffset =
  masterOffset
origin: didi/DDMQ

public boolean onRoleChange() {
  if (this.scheduleMessageService == null) {
    log.warn("scheduleMessageService is null");
    return false;
  }
  scheduleMessageService.load();
  if (BrokerRole.SLAVE != messageStoreConfig.getBrokerRole()) {
    this.scheduleMessageService.start();
    this.recoverTopicQueueTable();
    this.haService.initInSyncOffset(getMaxPhyOffset());
  } else {
    this.scheduleMessageService.shutdown();
    truncateNotSync();
    if (this.getMessageStoreConfig().isDuplicationEnable()) {
      this.reputMessageService.setReputFromOffset(this.commitLog.getConfirmOffset());
    } else {
      this.reputMessageService.setReputFromOffset(this.commitLog.getMaxOffset());
    }
  }
  log.info("role change, current role:{}", messageStoreConfig.getBrokerRole());
  return true;
}
origin: didi/DDMQ

final long maxOffsetPy = this.commitLog.getMaxOffset();
origin: org.apache.rocketmq/rocketmq-store

@Override
public long slaveFallBehindMuch() {
  return this.commitLog.getMaxOffset() - this.haService.getPush2SlaveMaxOffset().get();
}
org.apache.rocketmq.storeCommitLoggetMaxOffset

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,
  • getMessage,
  • getMinOffset,
  • handleDiskFlush,
  • handleHA,
  • isMappedFileMatchedRecover,
  • load,
  • lockTimeMills

Popular in Java

  • Finding current android device location
  • setContentView (Activity)
  • onRequestPermissionsResult (Fragment)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • SortedSet (java.util)
    A Set that further provides a total ordering on its elements. The elements are ordered using their C
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Join (org.hibernate.mapping)
  • Table (org.hibernate.mapping)
    A relational table
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