Class SqlSegmentMetadataReadOnlyTransactionFactory
java.lang.Object
org.apache.druid.metadata.segment.SqlSegmentMetadataReadOnlyTransactionFactory
- All Implemented Interfaces:
SegmentMetadataTransactionFactory
- Direct Known Subclasses:
SqlSegmentMetadataTransactionFactory
public class SqlSegmentMetadataReadOnlyTransactionFactory
extends Object
implements SegmentMetadataTransactionFactory
Factory for read-only
SegmentMetadataTransactions that always read
directly from the metadata store and never from the SegmentMetadataCache.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSqlSegmentMetadataReadOnlyTransactionFactory(com.fasterxml.jackson.databind.ObjectMapper jsonMapper, MetadataStorageTablesConfig tablesConfig, SQLMetadataConnector connector) -
Method Summary
Modifier and TypeMethodDescriptionprotected SegmentMetadataTransactioncreateSqlTransaction(String dataSource, org.skife.jdbi.v2.Handle handle, org.skife.jdbi.v2.TransactionStatus transactionStatus) protected <T> TexecuteReadAndClose(SegmentMetadataReadTransaction transaction, SegmentMetadataReadTransaction.Callback<T> callback) intint<T> TinReadOnlyDatasourceTransaction(String dataSource, SegmentMetadataReadTransaction.Callback<T> callback) Creates and executes a new read-only transaction for the given datasource.<T> TinReadWriteDatasourceTransaction(String dataSource, SegmentMetadataTransaction.Callback<T> callback) Creates and executes a new read-write transaction for the given datasource.
-
Constructor Details
-
SqlSegmentMetadataReadOnlyTransactionFactory
@Inject public SqlSegmentMetadataReadOnlyTransactionFactory(com.fasterxml.jackson.databind.ObjectMapper jsonMapper, MetadataStorageTablesConfig tablesConfig, SQLMetadataConnector connector)
-
-
Method Details
-
getMaxRetries
public int getMaxRetries() -
getQuietRetries
public int getQuietRetries() -
inReadOnlyDatasourceTransaction
public <T> T inReadOnlyDatasourceTransaction(String dataSource, SegmentMetadataReadTransaction.Callback<T> callback) Description copied from interface:SegmentMetadataTransactionFactoryCreates and executes a new read-only transaction for the given datasource. The implementation may retry the transaction until it succeeds.- Specified by:
inReadOnlyDatasourceTransactionin interfaceSegmentMetadataTransactionFactory
-
inReadWriteDatasourceTransaction
public <T> T inReadWriteDatasourceTransaction(String dataSource, SegmentMetadataTransaction.Callback<T> callback) Description copied from interface:SegmentMetadataTransactionFactoryCreates and executes a new read-write transaction for the given datasource. The implementation may retry the transaction until it succeeds.- Specified by:
inReadWriteDatasourceTransactionin interfaceSegmentMetadataTransactionFactory
-
createSqlTransaction
protected SegmentMetadataTransaction createSqlTransaction(String dataSource, org.skife.jdbi.v2.Handle handle, org.skife.jdbi.v2.TransactionStatus transactionStatus) -
executeReadAndClose
protected <T> T executeReadAndClose(SegmentMetadataReadTransaction transaction, SegmentMetadataReadTransaction.Callback<T> callback) throws Exception - Throws:
Exception
-