Class OffloadPoliciesImpl
java.lang.Object
org.apache.pulsar.common.policies.data.OffloadPoliciesImpl
- All Implemented Interfaces:
Serializable,org.apache.pulsar.common.policies.data.OffloadPolicies
public class OffloadPoliciesImpl
extends Object
implements Serializable, org.apache.pulsar.common.policies.data.OffloadPolicies
Definition of the offload policies.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.apache.pulsar.common.policies.data.OffloadPolicies
org.apache.pulsar.common.policies.data.OffloadPolicies.Builder -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final Longstatic final intstatic final intstatic final Longstatic final org.apache.pulsar.common.policies.data.OffloadedReadPrioritystatic final Stringstatic final intstatic final Stringstatic final com.google.common.collect.ImmutableList<String>static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbuilder()voidcompatibleWithBrokerConfigFile(Properties properties) static OffloadPoliciesImplcreate(String driver, String region, String bucket, String endpoint, String role, String roleSessionName, String credentialId, String credentialSecret, Integer maxBlockSizeInBytes, Integer readBufferSizeInBytes, Long offloadThresholdInBytes, Long offloadDeletionLagInMillis, org.apache.pulsar.common.policies.data.OffloadedReadPriority readPriority) static OffloadPoliciesImplcreate(Properties properties) booleanstatic Stringbooleanbooleanbooleanstatic OffloadPoliciesImplmergeConfiguration(OffloadPoliciesImpl topicLevelPolicies, OffloadPoliciesImpl nsLevelPolicies, Properties brokerProperties) Merge different level offload policies.static OffloadPoliciesImploldPoliciesCompatible(OffloadPoliciesImpl nsLevelPolicies, org.apache.pulsar.common.policies.data.Policies policies) This method is used to make a compatible with old policies.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pulsar.common.policies.data.OffloadPolicies
getFileSystemProfilePath, getFileSystemURI, getGcsManagedLedgerOffloadBucket, getGcsManagedLedgerOffloadMaxBlockSizeInBytes, getGcsManagedLedgerOffloadReadBufferSizeInBytes, getGcsManagedLedgerOffloadRegion, getGcsManagedLedgerOffloadServiceAccountKeyFile, getManagedLedgerOffloadBucket, getManagedLedgerOffloadDeletionLagInMillis, getManagedLedgerOffloadDriver, getManagedLedgerOffloadedReadPriority, getManagedLedgerOffloadMaxBlockSizeInBytes, getManagedLedgerOffloadMaxThreads, getManagedLedgerOffloadPrefetchRounds, getManagedLedgerOffloadReadBufferSizeInBytes, getManagedLedgerOffloadRegion, getManagedLedgerOffloadServiceEndpoint, getManagedLedgerOffloadThresholdInBytes, getOffloadersDirectory, getS3ManagedLedgerOffloadBucket, getS3ManagedLedgerOffloadCredentialId, getS3ManagedLedgerOffloadCredentialSecret, getS3ManagedLedgerOffloadMaxBlockSizeInBytes, getS3ManagedLedgerOffloadReadBufferSizeInBytes, getS3ManagedLedgerOffloadRegion, getS3ManagedLedgerOffloadRole, getS3ManagedLedgerOffloadRoleSessionName, getS3ManagedLedgerOffloadServiceEndpoint
-
Field Details
-
CONFIGURATION_FIELDS
-
DEFAULT_MAX_BLOCK_SIZE_IN_BYTES
public static final int DEFAULT_MAX_BLOCK_SIZE_IN_BYTES- See Also:
-
DEFAULT_READ_BUFFER_SIZE_IN_BYTES
public static final int DEFAULT_READ_BUFFER_SIZE_IN_BYTES- See Also:
-
DEFAULT_OFFLOAD_MAX_THREADS
public static final int DEFAULT_OFFLOAD_MAX_THREADS- See Also:
-
DEFAULT_OFFLOAD_MAX_PREFETCH_ROUNDS
public static final int DEFAULT_OFFLOAD_MAX_PREFETCH_ROUNDS- See Also:
-
DRIVER_NAMES
-
DEFAULT_OFFLOADER_DIRECTORY
- See Also:
-
DEFAULT_OFFLOAD_THRESHOLD_IN_BYTES
-
DEFAULT_OFFLOAD_DELETION_LAG_IN_MILLIS
-
OFFLOAD_THRESHOLD_NAME_IN_CONF_FILE
- See Also:
-
DELETION_LAG_NAME_IN_CONF_FILE
- See Also:
-
DEFAULT_OFFLOADED_READ_PRIORITY
public static final org.apache.pulsar.common.policies.data.OffloadedReadPriority DEFAULT_OFFLOADED_READ_PRIORITY
-
-
Constructor Details
-
OffloadPoliciesImpl
public OffloadPoliciesImpl()
-
-
Method Details
-
create
public static OffloadPoliciesImpl create(String driver, String region, String bucket, String endpoint, String role, String roleSessionName, String credentialId, String credentialSecret, Integer maxBlockSizeInBytes, Integer readBufferSizeInBytes, Long offloadThresholdInBytes, Long offloadDeletionLagInMillis, org.apache.pulsar.common.policies.data.OffloadedReadPriority readPriority) -
create
-
builder
-
compatibleWithBrokerConfigFile
-
driverSupported
public boolean driverSupported() -
getSupportedDriverNames
-
isS3Driver
public boolean isS3Driver() -
isGcsDriver
public boolean isGcsDriver() -
isFileSystemDriver
public boolean isFileSystemDriver() -
bucketValid
public boolean bucketValid() -
toProperties
-
oldPoliciesCompatible
public static OffloadPoliciesImpl oldPoliciesCompatible(OffloadPoliciesImpl nsLevelPolicies, org.apache.pulsar.common.policies.data.Policies policies) This method is used to make a compatible with old policies.The filed
Policies.offload_thresholdis primitive, so it can't be known whether it had been set. In the old logic, if the field value is -1, it could be thought that the field had not been set.- Parameters:
nsLevelPolicies- namespace level offload policiespolicies- namespace policies- Returns:
- offload policies
-
mergeConfiguration
public static OffloadPoliciesImpl mergeConfiguration(OffloadPoliciesImpl topicLevelPolicies, OffloadPoliciesImpl nsLevelPolicies, Properties brokerProperties) Merge different level offload policies.policies level priority: topic > namespace > broker
- Parameters:
topicLevelPolicies- topic level offload policiesnsLevelPolicies- namespace level offload policiesbrokerProperties- broker level offload configuration- Returns:
- offload policies
-