Class TieredStorageConfiguration
- java.lang.Object
-
- org.apache.bookkeeper.mledger.offload.jcloud.provider.TieredStorageConfiguration
-
public class TieredStorageConfiguration extends Object
Class 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
Fields Modifier and Type Field Description static StringBLOB_STORE_PROVIDER_KEYstatic longDEFAULT_MAX_SEGMENT_SIZE_IN_BYTESstatic longDEFAULT_MAX_SEGMENT_TIME_IN_SECONDstatic longDEFAULT_MIN_SEGMENT_TIME_IN_SECONDstatic StringGCS_ACCOUNT_KEY_FILE_FIELDstatic StringMAX_OFFLOAD_SEGMENT_ROLLOVER_TIME_SECstatic StringMAX_OFFLOAD_SEGMENT_SIZE_IN_BYTESprotected static intMBstatic StringMETADATA_FIELD_BUCKETstatic StringMETADATA_FIELD_ENDPOINTstatic StringMETADATA_FIELD_MAX_BLOCK_SIZEstatic StringMETADATA_FIELD_MIN_BLOCK_SIZEstatic StringMETADATA_FIELD_READ_BUFFER_SIZEstatic StringMETADATA_FIELD_REGIONstatic StringMETADATA_FIELD_WRITE_BUFFER_SIZEstatic StringMIN_OFFLOAD_SEGMENT_ROLLOVER_TIME_SECstatic StringOFFLOADER_PROPERTY_PREFIXstatic StringS3_ID_FIELDstatic StringS3_ROLE_FIELDstatic StringS3_ROLE_SESSION_NAME_FIELDstatic StringS3_SECRET_FIELD
-
Constructor Summary
Constructors Constructor Description TieredStorageConfiguration(Map<String,String> configProperties)
-
Method Summary
-
-
-
Field Detail
-
BLOB_STORE_PROVIDER_KEY
public static final String BLOB_STORE_PROVIDER_KEY
- See Also:
- Constant Field Values
-
METADATA_FIELD_BUCKET
public static final String METADATA_FIELD_BUCKET
- See Also:
- Constant Field Values
-
METADATA_FIELD_REGION
public static final String METADATA_FIELD_REGION
- See Also:
- Constant Field Values
-
METADATA_FIELD_ENDPOINT
public static final String METADATA_FIELD_ENDPOINT
- See Also:
- Constant Field Values
-
METADATA_FIELD_MAX_BLOCK_SIZE
public static final String METADATA_FIELD_MAX_BLOCK_SIZE
- See Also:
- Constant Field Values
-
METADATA_FIELD_MIN_BLOCK_SIZE
public static final String METADATA_FIELD_MIN_BLOCK_SIZE
- See Also:
- Constant Field Values
-
METADATA_FIELD_READ_BUFFER_SIZE
public static final String METADATA_FIELD_READ_BUFFER_SIZE
- See Also:
- Constant Field Values
-
METADATA_FIELD_WRITE_BUFFER_SIZE
public static final String METADATA_FIELD_WRITE_BUFFER_SIZE
- See Also:
- Constant Field Values
-
OFFLOADER_PROPERTY_PREFIX
public static final String OFFLOADER_PROPERTY_PREFIX
- See Also:
- Constant Field Values
-
MAX_OFFLOAD_SEGMENT_ROLLOVER_TIME_SEC
public static final String MAX_OFFLOAD_SEGMENT_ROLLOVER_TIME_SEC
- See Also:
- Constant Field Values
-
MIN_OFFLOAD_SEGMENT_ROLLOVER_TIME_SEC
public static final 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 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 String GCS_ACCOUNT_KEY_FILE_FIELD
- See Also:
- Constant Field Values
-
S3_ID_FIELD
public static final String S3_ID_FIELD
- See Also:
- Constant Field Values
-
S3_SECRET_FIELD
public static final String S3_SECRET_FIELD
- See Also:
- Constant Field Values
-
S3_ROLE_FIELD
public static final String S3_ROLE_FIELD
- See Also:
- Constant Field Values
-
S3_ROLE_SESSION_NAME_FIELD
public static final String S3_ROLE_SESSION_NAME_FIELD
- See Also:
- Constant Field Values
-
-
Method Detail
-
create
public static TieredStorageConfiguration create(Properties props) throws IOException
- Throws:
IOException
-
create
public static TieredStorageConfiguration create(Map<String,String> props)
-
getBlobStoreProviderKey
public String getBlobStoreProviderKey()
-
getDriver
public String getDriver()
-
getRegion
public String getRegion()
-
setRegion
public void setRegion(String s)
-
getBucket
public String getBucket()
-
getServiceEndpoint
public String getServiceEndpoint()
-
getMaxSegmentTimeInSecond
public long getMaxSegmentTimeInSecond()
-
getMinSegmentTimeInSecond
public long getMinSegmentTimeInSecond()
-
getMaxSegmentSizeInBytes
public long getMaxSegmentSizeInBytes()
-
setServiceEndpoint
public void setServiceEndpoint(String s)
-
getConfigProperty
public String getConfigProperty(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 Integer getMaxBlockSizeInBytes()
-
getMinBlockSizeInBytes
public Integer getMinBlockSizeInBytes()
-
getReadBufferSizeInBytes
public Integer getReadBufferSizeInBytes()
-
getWriteBufferSizeInBytes
public Integer getWriteBufferSizeInBytes()
-
getProviderCredentials
public Supplier<org.jclouds.domain.Credentials> getProviderCredentials()
-
setProviderCredentials
public void setProviderCredentials(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()
-
getOverrides
protected Properties getOverrides()
-
-