类 ManagedLedgerConfig

java.lang.Object
org.apache.bookkeeper.mledger.ManagedLedgerConfig

@LimitedPrivate @Stable public class ManagedLedgerConfig extends Object
Configuration class for a ManagedLedger.
  • 构造器详细资料

    • ManagedLedgerConfig

      public ManagedLedgerConfig()
  • 方法详细资料

    • isCreateIfMissing

      public boolean isCreateIfMissing()
    • setCreateIfMissing

      public ManagedLedgerConfig setCreateIfMissing(boolean createIfMissing)
    • isLazyCursorRecovery

      public boolean isLazyCursorRecovery()
      返回:
      the lazyCursorRecovery
    • setLazyCursorRecovery

      public ManagedLedgerConfig setLazyCursorRecovery(boolean lazyCursorRecovery)
      Whether to recover cursors lazily when trying to recover a managed ledger backing a persistent topic. It can improve write availability of topics. The caveat is now when recovered ledger is ready to write we're not sure if all old consumers last mark delete position can be recovered or not.
      参数:
      lazyCursorRecovery - if enable lazy cursor recovery.
    • getMaxEntriesPerLedger

      public int getMaxEntriesPerLedger()
      返回:
      the maxEntriesPerLedger
    • setMaxEntriesPerLedger

      public ManagedLedgerConfig setMaxEntriesPerLedger(int maxEntriesPerLedger)
      参数:
      maxEntriesPerLedger - the maxEntriesPerLedger to set
    • getMaxSizePerLedgerMb

      public int getMaxSizePerLedgerMb()
      返回:
      the maxSizePerLedgerMb
    • setMaxSizePerLedgerMb

      public ManagedLedgerConfig setMaxSizePerLedgerMb(int maxSizePerLedgerMb)
      参数:
      maxSizePerLedgerMb - the maxSizePerLedgerMb to set
    • getMinimumRolloverTimeMs

      public int getMinimumRolloverTimeMs()
      返回:
      the minimum rollover time
    • setMinimumRolloverTime

      public void setMinimumRolloverTime(int minimumRolloverTime, TimeUnit unit)
      Set the minimum rollover time for ledgers in this managed ledger.

      If this time is > 0, a ledger will not be rolled over more frequently than the specified time, even if it has reached the maximum number of entries or maximum size. This parameter can be used to reduce the amount of rollovers on managed ledger with high write throughput.

      参数:
      minimumRolloverTime - the minimum rollover time
      unit - the time unit
    • getMaximumRolloverTimeMs

      public long getMaximumRolloverTimeMs()
      返回:
      the maximum rollover time.
    • setMaximumRolloverTime

      public void setMaximumRolloverTime(int maximumRolloverTime, TimeUnit unit)
      Set the maximum rollover time for ledgers in this managed ledger.

      If the ledger is not rolled over until this time, even if it has not reached the number of entry or size limit, this setting will trigger rollover. This parameter can be used for topics with low request rate to force rollover, so recovery failure does not have to go far back.

      参数:
      maximumRolloverTime - the maximum rollover time
      unit - the time unit
    • getEnsembleSize

      public int getEnsembleSize()
      返回:
      the ensembleSize
    • setEnsembleSize

      public ManagedLedgerConfig setEnsembleSize(int ensembleSize)
      参数:
      ensembleSize - the ensembleSize to set
    • getAckQuorumSize

      public int getAckQuorumSize()
      返回:
      the ackQuorumSize
    • getWriteQuorumSize

      public int getWriteQuorumSize()
      返回:
      the writeQuorumSize
    • setWriteQuorumSize

      public ManagedLedgerConfig setWriteQuorumSize(int writeQuorumSize)
      参数:
      writeQuorumSize - the writeQuorumSize to set
    • setAckQuorumSize

      public ManagedLedgerConfig setAckQuorumSize(int ackQuorumSize)
      参数:
      ackQuorumSize - the ackQuorumSize to set
    • getDigestType

      public org.apache.bookkeeper.client.api.DigestType getDigestType()
      返回:
      the digestType
    • setDigestType

      public ManagedLedgerConfig setDigestType(org.apache.bookkeeper.client.api.DigestType digestType)
      参数:
      digestType - the digestType to set
    • getPassword

      public byte[] getPassword()
      返回:
      the password
    • setPassword

      public ManagedLedgerConfig setPassword(String password)
      参数:
      password - the password to set
    • isUnackedRangesOpenCacheSetEnabled

      public boolean isUnackedRangesOpenCacheSetEnabled()
      should use ConcurrentOpenLongPairRangeSet to store unacked ranges.
      返回:
    • setUnackedRangesOpenCacheSetEnabled

      public ManagedLedgerConfig setUnackedRangesOpenCacheSetEnabled(boolean unackedRangesOpenCacheSetEnabled)
    • getMetadataEnsemblesize

      public int getMetadataEnsemblesize()
      返回:
      the metadataEnsemblesize
    • setMetadataEnsembleSize

      public ManagedLedgerConfig setMetadataEnsembleSize(int metadataEnsembleSize)
      参数:
      metadataEnsembleSize - the metadataEnsembleSize to set
    • getMetadataAckQuorumSize

      public int getMetadataAckQuorumSize()
      返回:
      the metadataAckQuorumSize
    • getMetadataWriteQuorumSize

      public int getMetadataWriteQuorumSize()
      返回:
      the metadataWriteQuorumSize
    • setMetadataAckQuorumSize

      public ManagedLedgerConfig setMetadataAckQuorumSize(int metadataAckQuorumSize)
      参数:
      metadataAckQuorumSize - the metadataAckQuorumSize to set
    • setMetadataWriteQuorumSize

      public ManagedLedgerConfig setMetadataWriteQuorumSize(int metadataWriteQuorumSize)
      参数:
      metadataWriteQuorumSize - the metadataWriteQuorumSize to set
    • getMetadataMaxEntriesPerLedger

      public int getMetadataMaxEntriesPerLedger()
      返回:
      the metadataMaxEntriesPerLedger
    • setMetadataMaxEntriesPerLedger

      public ManagedLedgerConfig setMetadataMaxEntriesPerLedger(int metadataMaxEntriesPerLedger)
      参数:
      metadataMaxEntriesPerLedger - the metadataMaxEntriesPerLedger to set
    • getLedgerRolloverTimeout

      public int getLedgerRolloverTimeout()
      返回:
      the ledgerRolloverTimeout
    • setLedgerRolloverTimeout

      public ManagedLedgerConfig setLedgerRolloverTimeout(int ledgerRolloverTimeout)
      参数:
      ledgerRolloverTimeout - the ledgerRolloverTimeout to set
    • getThrottleMarkDelete

      public double getThrottleMarkDelete()
      返回:
      the throttling rate limit for mark-delete calls
    • setThrottleMarkDelete

      public ManagedLedgerConfig setThrottleMarkDelete(double throttleMarkDelete)
      Set the rate limiter on how many mark-delete calls per second are allowed. If the value is set to 0, the rate limiter is disabled. Default is 0.
      参数:
      throttleMarkDelete - the max number of mark-delete calls allowed per second
    • setRetentionTime

      public ManagedLedgerConfig setRetentionTime(int retentionTime, TimeUnit unit)
      Set the retention time for the ManagedLedger.

      Retention time and retention size (setRetentionSizeInMB(long)) are together used to retain the ledger data when when there are no cursors or when all the cursors have marked the data for deletion. Data will be deleted in this case when both retention time and retention size settings don't prevent deleting the data marked for deletion.

      A retention time of 0 (default) will make data to be deleted immediately.

      A retention time of -1, means to have an unlimited retention time.

      参数:
      retentionTime - duration for which messages should be retained
      unit - time unit for retention time
    • getRetentionTimeMillis

      public long getRetentionTimeMillis()
      返回:
      duration for which messages are retained
    • setRetentionSizeInMB

      public ManagedLedgerConfig setRetentionSizeInMB(long retentionSizeInMB)
      The retention size is used to set a maximum retention size quota on the ManagedLedger.

      Retention size and retention time (setRetentionTime(int, TimeUnit)) are together used to retain the ledger data when when there are no cursors or when all the cursors have marked the data for deletion. Data will be deleted in this case when both retention time and retention size settings don't prevent deleting the data marked for deletion.

      A retention size of 0 (default) will make data to be deleted immediately.

      A retention size of -1, means to have an unlimited retention size.

      参数:
      retentionSizeInMB - quota for message retention
    • getRetentionSizeInMB

      public long getRetentionSizeInMB()
      返回:
      quota for message retention
    • isAutoSkipNonRecoverableData

      public boolean isAutoSkipNonRecoverableData()
      Skip reading non-recoverable/unreadable data-ledger under managed-ledger's list. It helps when data-ledgers gets corrupted at bookkeeper and managed-cursor is stuck at that ledger.
    • setAutoSkipNonRecoverableData

      public void setAutoSkipNonRecoverableData(boolean skipNonRecoverableData)
    • getMaxUnackedRangesToPersist

      public int getMaxUnackedRangesToPersist()
      返回:
      max unacked message ranges that will be persisted and recovered.
    • getMaxBatchDeletedIndexToPersist

      public int getMaxBatchDeletedIndexToPersist()
      返回:
      max batch deleted index that will be persisted and recoverd.
    • setMaxUnackedRangesToPersist

      public ManagedLedgerConfig setMaxUnackedRangesToPersist(int maxUnackedRangesToPersist)
      参数:
      maxUnackedRangesToPersist - max unacked message ranges that will be persisted and receverd.
    • getMaxUnackedRangesToPersistInZk

      public int getMaxUnackedRangesToPersistInZk()
      返回:
      max unacked message ranges up to which it can store in Zookeeper
    • setMaxUnackedRangesToPersistInZk

      public void setMaxUnackedRangesToPersistInZk(int maxUnackedRangesToPersistInZk)
    • getLedgerOffloader

      public LedgerOffloader getLedgerOffloader()
      Get ledger offloader which will be used to offload ledgers to longterm storage. The default offloader throws an exception on any attempt to offload.
      返回:
      a ledger offloader
    • setLedgerOffloader

      public ManagedLedgerConfig setLedgerOffloader(LedgerOffloader offloader)
      Set ledger offloader to use for offloading ledgers to longterm storage.
      参数:
      offloader - the ledger offloader to use
    • getClock

      public Clock getClock()
      Get clock to use to time operations.
      返回:
      a clock
    • setClock

      public ManagedLedgerConfig setClock(Clock clock)
      Set clock to use for time operations.
      参数:
      clock - the clock to use
    • getMetadataOperationsTimeoutSeconds

      public long getMetadataOperationsTimeoutSeconds()
      Ledger-Op (Create/Delete) timeout.
      返回:
    • setMetadataOperationsTimeoutSeconds

      public ManagedLedgerConfig setMetadataOperationsTimeoutSeconds(long metadataOperationsTimeoutSeconds)
      Ledger-Op (Create/Delete) timeout after which callback will be completed with failure.
      参数:
      metadataOperationsTimeoutSeconds -
    • getReadEntryTimeoutSeconds

      public long getReadEntryTimeoutSeconds()
      Ledger read-entry timeout.
      返回:
    • setReadEntryTimeoutSeconds

      public ManagedLedgerConfig setReadEntryTimeoutSeconds(long readEntryTimeoutSeconds)
      Ledger read entry timeout after which callback will be completed with failure. (disable timeout by setting. readTimeoutSeconds <= 0)
      参数:
      readEntryTimeoutSeconds -
      返回:
    • getAddEntryTimeoutSeconds

      public long getAddEntryTimeoutSeconds()
    • setAddEntryTimeoutSeconds

      public ManagedLedgerConfig setAddEntryTimeoutSeconds(long addEntryTimeoutSeconds)
      Add-entry timeout after which add-entry callback will be failed if add-entry is not succeeded.
      参数:
      addEntryTimeoutSeconds -
    • getBookKeeperEnsemblePlacementPolicyClassName

      public Class<? extends org.apache.bookkeeper.client.EnsemblePlacementPolicy> getBookKeeperEnsemblePlacementPolicyClassName()
      Managed-ledger can setup different custom EnsemblePlacementPolicy (eg: affinity to write ledgers to only setup of group of bookies).
      返回:
    • setBookKeeperEnsemblePlacementPolicyClassName

      public void setBookKeeperEnsemblePlacementPolicyClassName(Class<? extends org.apache.bookkeeper.client.EnsemblePlacementPolicy> bookKeeperEnsemblePlacementPolicyClassName)
      Returns EnsemblePlacementPolicy configured for the Managed-ledger.
      参数:
      bookKeeperEnsemblePlacementPolicyClassName -
    • getBookKeeperEnsemblePlacementPolicyProperties

      public Map<String,Object> getBookKeeperEnsemblePlacementPolicyProperties()
      Returns properties required by configured bookKeeperEnsemblePlacementPolicy.
      返回:
    • setBookKeeperEnsemblePlacementPolicyProperties

      public void setBookKeeperEnsemblePlacementPolicyProperties(Map<String,Object> bookKeeperEnsemblePlacementPolicyProperties)
      Managed-ledger can setup different custom EnsemblePlacementPolicy which needs bookKeeperEnsemblePlacementPolicy-Properties.
      参数:
      bookKeeperEnsemblePlacementPolicyProperties -
    • getProperties

      public Map<String,String> getProperties()
    • setProperties

      public void setProperties(Map<String,String> properties)
    • isDeletionAtBatchIndexLevelEnabled

      public boolean isDeletionAtBatchIndexLevelEnabled()
    • setDeletionAtBatchIndexLevelEnabled

      public void setDeletionAtBatchIndexLevelEnabled(boolean deletionAtBatchIndexLevelEnabled)
    • getNewEntriesCheckDelayInMillis

      public int getNewEntriesCheckDelayInMillis()
    • setNewEntriesCheckDelayInMillis

      public void setNewEntriesCheckDelayInMillis(int newEntriesCheckDelayInMillis)
    • getManagedLedgerInterceptor

      public ManagedLedgerInterceptor getManagedLedgerInterceptor()
    • setManagedLedgerInterceptor

      public void setManagedLedgerInterceptor(ManagedLedgerInterceptor managedLedgerInterceptor)
    • getInactiveLedgerRollOverTimeMs

      public int getInactiveLedgerRollOverTimeMs()
    • setInactiveLedgerRollOverTime

      public void setInactiveLedgerRollOverTime(int inactiveLedgerRollOverTimeMs, TimeUnit unit)
      Set rollOver time for inactive ledgers.
      参数:
      inactiveLedgerRollOverTimeMs -
      unit -