Tabnine Logo
CommitLog.deleteExpiredFile
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: apache/rocketmq

private void deleteExpiredFiles() {
  int deleteCount = 0;
  long fileReservedTime = DefaultMessageStore.this.getMessageStoreConfig().getFileReservedTime();
  int deletePhysicFilesInterval = DefaultMessageStore.this.getMessageStoreConfig().getDeleteCommitLogFilesInterval();
  int destroyMapedFileIntervalForcibly = DefaultMessageStore.this.getMessageStoreConfig().getDestroyMapedFileIntervalForcibly();
  boolean timeup = this.isTimeToDelete();
  boolean spacefull = this.isSpaceToDelete();
  boolean manualDelete = this.manualDeleteFileSeveralTimes > 0;
  if (timeup || spacefull || manualDelete) {
    if (manualDelete)
      this.manualDeleteFileSeveralTimes--;
    boolean cleanAtOnce = DefaultMessageStore.this.getMessageStoreConfig().isCleanFileForciblyEnable() && this.cleanImmediately;
    log.info("begin to delete before {} hours file. timeup: {} spacefull: {} manualDeleteFileSeveralTimes: {} cleanAtOnce: {}",
      fileReservedTime,
      timeup,
      spacefull,
      manualDeleteFileSeveralTimes,
      cleanAtOnce);
    fileReservedTime *= 60 * 60 * 1000;
    deleteCount = DefaultMessageStore.this.commitLog.deleteExpiredFile(fileReservedTime, deletePhysicFilesInterval,
      destroyMapedFileIntervalForcibly, cleanAtOnce);
    if (deleteCount > 0) {
    } else if (spacefull) {
      log.warn("disk space will be full soon, but delete file failed.");
    }
  }
}
origin: didi/DDMQ

private void deleteExpiredFiles() {
  int deleteCount = 0;
  long fileReservedTime = DefaultMessageStore.this.getMessageStoreConfig().getFileReservedTime();
  int deletePhysicFilesInterval = DefaultMessageStore.this.getMessageStoreConfig().getDeleteCommitLogFilesInterval();
  int destroyMapedFileIntervalForcibly = DefaultMessageStore.this.getMessageStoreConfig().getDestroyMapedFileIntervalForcibly();
  boolean timeup = this.isTimeToDelete();
  boolean spacefull = this.isSpaceToDelete();
  boolean manualDelete = this.manualDeleteFileSeveralTimes > 0;
  if (timeup || spacefull || manualDelete) {
    if (manualDelete)
      this.manualDeleteFileSeveralTimes--;
    boolean cleanAtOnce = DefaultMessageStore.this.getMessageStoreConfig().isCleanFileForciblyEnable() && this.cleanImmediately;
    log.info("begin to delete before {} hours file. timeup: {} spacefull: {} manualDeleteFileSeveralTimes: {} cleanAtOnce: {}",
      fileReservedTime,
      timeup,
      spacefull,
      manualDeleteFileSeveralTimes,
      cleanAtOnce);
    fileReservedTime *= 60 * 60 * 1000;
    deleteCount = DefaultMessageStore.this.commitLog.deleteExpiredFile(fileReservedTime, deletePhysicFilesInterval,
      destroyMapedFileIntervalForcibly, cleanAtOnce);
    if (deleteCount > 0) {
    } else if (spacefull) {
      log.warn("disk space will be full soon, but delete file failed.");
    }
  }
}
origin: org.apache.rocketmq/rocketmq-store

private void deleteExpiredFiles() {
  int deleteCount = 0;
  long fileReservedTime = DefaultMessageStore.this.getMessageStoreConfig().getFileReservedTime();
  int deletePhysicFilesInterval = DefaultMessageStore.this.getMessageStoreConfig().getDeleteCommitLogFilesInterval();
  int destroyMapedFileIntervalForcibly = DefaultMessageStore.this.getMessageStoreConfig().getDestroyMapedFileIntervalForcibly();
  boolean timeup = this.isTimeToDelete();
  boolean spacefull = this.isSpaceToDelete();
  boolean manualDelete = this.manualDeleteFileSeveralTimes > 0;
  if (timeup || spacefull || manualDelete) {
    if (manualDelete)
      this.manualDeleteFileSeveralTimes--;
    boolean cleanAtOnce = DefaultMessageStore.this.getMessageStoreConfig().isCleanFileForciblyEnable() && this.cleanImmediately;
    log.info("begin to delete before {} hours file. timeup: {} spacefull: {} manualDeleteFileSeveralTimes: {} cleanAtOnce: {}",
      fileReservedTime,
      timeup,
      spacefull,
      manualDeleteFileSeveralTimes,
      cleanAtOnce);
    fileReservedTime *= 60 * 60 * 1000;
    deleteCount = DefaultMessageStore.this.commitLog.deleteExpiredFile(fileReservedTime, deletePhysicFilesInterval,
      destroyMapedFileIntervalForcibly, cleanAtOnce);
    if (deleteCount > 0) {
    } else if (spacefull) {
      log.warn("disk space will be full soon, but delete file failed.");
    }
  }
}
org.apache.rocketmq.storeCommitLogdeleteExpiredFile

Popular methods of CommitLog

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

Popular in Java

  • Making http requests using okhttp
  • getContentResolver (Context)
  • scheduleAtFixedRate (Timer)
  • setContentView (Activity)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now