Class TieredStorageConfiguration
- java.lang.Object
-
- org.apache.bookkeeper.mledger.offload.jcloud.provider.TieredStorageConfiguration
-
public class TieredStorageConfiguration extends java.lang.ObjectClass responsible for holding all of the tiered storage configuration data that is set in the global Pulsar broker.conf file.This class is used by the BlobStoreManagedLedgerOffloader to determine which JCloud provider to use for Tiered Storage offloand, along with the associated properties such as region, bucket, user credentials, etc.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceTieredStorageConfiguration.BlobStoreBuilderBuilds a JCloudprovider BlobStore from the TieredStorageConfiguration, which allows us to publish and retrieve data blocks from the external storage system.static interfaceTieredStorageConfiguration.ConfigValidationChecks the given TieredStorageConfiguration to see if all of the required properties are set, and that all properties are valid.static interfaceTieredStorageConfiguration.CredentialBuilderConstructs the proper credentials for the given JCloud provider from the given TieredStorageConfiguration.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description TieredStorageConfiguration(java.util.Map<java.lang.String,java.lang.String> configProperties)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TieredStorageConfigurationcreate(java.util.Map<java.lang.String,java.lang.String> props)static TieredStorageConfigurationcreate(java.util.Properties props)org.jclouds.blobstore.BlobStoregetBlobStore()BlobStoreLocationgetBlobStoreLocation()java.lang.StringgetBlobStoreProviderKey()java.lang.StringgetBucket()java.lang.StringgetConfigProperty(java.lang.String propertyName)Used to find a specific configuration property other than one of the predefined ones.java.lang.StringgetDriver()java.util.List<java.lang.String>getKeys(java.lang.String property)java.lang.IntegergetMaxBlockSizeInBytes()longgetMaxSegmentSizeInBytes()longgetMaxSegmentTimeInSecond()java.lang.IntegergetMinBlockSizeInBytes()longgetMinSegmentTimeInSecond()java.util.Map<java.lang.String,java.lang.String>getOffloadDriverMetadata()protected java.util.PropertiesgetOverrides()JCloudBlobStoreProvidergetProvider()java.util.function.Supplier<org.jclouds.domain.Credentials>getProviderCredentials()org.jclouds.providers.ProviderMetadatagetProviderMetadata()java.lang.IntegergetReadBufferSizeInBytes()java.lang.StringgetRegion()java.lang.StringgetServiceEndpoint()java.lang.IntegergetWriteBufferSizeInBytes()voidsetProvider(JCloudBlobStoreProvider provider)voidsetProviderCredentials(java.util.function.Supplier<org.jclouds.domain.Credentials> credentials)voidsetRegion(java.lang.String s)voidsetServiceEndpoint(java.lang.String s)voidvalidate()
-
-
-
Field Detail
-
BLOB_STORE_PROVIDER_KEY
public static final java.lang.String BLOB_STORE_PROVIDER_KEY
- See Also:
- Constant Field Values
-
METADATA_FIELD_BUCKET
public static final java.lang.String METADATA_FIELD_BUCKET
- See Also:
- Constant Field Values
-
METADATA_FIELD_REGION
public static final java.lang.String METADATA_FIELD_REGION
- See Also:
- Constant Field Values
-
METADATA_FIELD_ENDPOINT
public static final java.lang.String METADATA_FIELD_ENDPOINT
- See Also:
- Constant Field Values
-
METADATA_FIELD_MAX_BLOCK_SIZE
public static final java.lang.String METADATA_FIELD_MAX_BLOCK_SIZE
- See Also:
- Constant Field Values
-
METADATA_FIELD_MIN_BLOCK_SIZE
public static final java.lang.String METADATA_FIELD_MIN_BLOCK_SIZE
- See Also:
- Constant Field Values
-
METADATA_FIELD_READ_BUFFER_SIZE
public static final java.lang.String METADATA_FIELD_READ_BUFFER_SIZE
- See Also:
- Constant Field Values
-
METADATA_FIELD_WRITE_BUFFER_SIZE
public static final java.lang.String METADATA_FIELD_WRITE_BUFFER_SIZE
- See Also:
- Constant Field Values
-
OFFLOADER_PROPERTY_PREFIX
public static final java.lang.String OFFLOADER_PROPERTY_PREFIX
- See Also:
- Constant Field Values
-
MAX_OFFLOAD_SEGMENT_ROLLOVER_TIME_SEC
public static final java.lang.String MAX_OFFLOAD_SEGMENT_ROLLOVER_TIME_SEC
- See Also:
- Constant Field Values
-
MIN_OFFLOAD_SEGMENT_ROLLOVER_TIME_SEC
public static final java.lang.String MIN_OFFLOAD_SEGMENT_ROLLOVER_TIME_SEC
- See Also:
- Constant Field Values
-
DEFAULT_MAX_SEGMENT_TIME_IN_SECOND
public static final long DEFAULT_MAX_SEGMENT_TIME_IN_SECOND
- See Also:
- Constant Field Values
-
DEFAULT_MIN_SEGMENT_TIME_IN_SECOND
public static final long DEFAULT_MIN_SEGMENT_TIME_IN_SECOND
- See Also:
- Constant Field Values
-
MAX_OFFLOAD_SEGMENT_SIZE_IN_BYTES
public static final java.lang.String MAX_OFFLOAD_SEGMENT_SIZE_IN_BYTES
- See Also:
- Constant Field Values
-
DEFAULT_MAX_SEGMENT_SIZE_IN_BYTES
public static final long DEFAULT_MAX_SEGMENT_SIZE_IN_BYTES
- See Also:
- Constant Field Values
-
MB
protected static final int MB
- See Also:
- Constant Field Values
-
GCS_ACCOUNT_KEY_FILE_FIELD
public static final java.lang.String GCS_ACCOUNT_KEY_FILE_FIELD
- See Also:
- Constant Field Values
-
S3_ID_FIELD
public static final java.lang.String S3_ID_FIELD
- See Also:
- Constant Field Values
-
S3_SECRET_FIELD
public static final java.lang.String S3_SECRET_FIELD
- See Also:
- Constant Field Values
-
S3_ROLE_FIELD
public static final java.lang.String S3_ROLE_FIELD
- See Also:
- Constant Field Values
-
S3_ROLE_SESSION_NAME_FIELD
public static final java.lang.String S3_ROLE_SESSION_NAME_FIELD
- See Also:
- Constant Field Values
-
-
Method Detail
-
create
public static TieredStorageConfiguration create(java.util.Properties props) throws java.io.IOException
- Throws:
java.io.IOException
-
create
public static TieredStorageConfiguration create(java.util.Map<java.lang.String,java.lang.String> props)
-
getKeys
public java.util.List<java.lang.String> getKeys(java.lang.String property)
-
getBlobStoreProviderKey
public java.lang.String getBlobStoreProviderKey()
-
getDriver
public java.lang.String getDriver()
-
getRegion
public java.lang.String getRegion()
-
setRegion
public void setRegion(java.lang.String s)
-
getBucket
public java.lang.String getBucket()
-
getServiceEndpoint
public java.lang.String getServiceEndpoint()
-
getMaxSegmentTimeInSecond
public long getMaxSegmentTimeInSecond()
-
getMinSegmentTimeInSecond
public long getMinSegmentTimeInSecond()
-
getMaxSegmentSizeInBytes
public long getMaxSegmentSizeInBytes()
-
setServiceEndpoint
public void setServiceEndpoint(java.lang.String s)
-
getConfigProperty
public java.lang.String getConfigProperty(java.lang.String propertyName)
Used to find a specific configuration property other than one of the predefined ones. This allows for any number of provider specific, or new properties to added in the future.- Parameters:
propertyName-- Returns:
-
getProvider
public JCloudBlobStoreProvider getProvider()
-
setProvider
public void setProvider(JCloudBlobStoreProvider provider)
-
getMaxBlockSizeInBytes
public java.lang.Integer getMaxBlockSizeInBytes()
-
getMinBlockSizeInBytes
public java.lang.Integer getMinBlockSizeInBytes()
-
getReadBufferSizeInBytes
public java.lang.Integer getReadBufferSizeInBytes()
-
getWriteBufferSizeInBytes
public java.lang.Integer getWriteBufferSizeInBytes()
-
getProviderCredentials
public java.util.function.Supplier<org.jclouds.domain.Credentials> getProviderCredentials()
-
setProviderCredentials
public void setProviderCredentials(java.util.function.Supplier<org.jclouds.domain.Credentials> credentials)
-
validate
public void validate()
-
getProviderMetadata
public org.jclouds.providers.ProviderMetadata getProviderMetadata()
-
getBlobStoreLocation
public BlobStoreLocation getBlobStoreLocation()
-
getBlobStore
public org.jclouds.blobstore.BlobStore getBlobStore()
-
getOffloadDriverMetadata
public java.util.Map<java.lang.String,java.lang.String> getOffloadDriverMetadata()
-
getOverrides
protected java.util.Properties getOverrides()
-
-