use of com.palantir.atlasdb.keyvalue.dbkvs.impl.sweep.CellTsPairLoader in project atlasdb by palantir.
the class DbKvs method createOracle.
private static DbKvs createOracle(ExecutorService executor, OracleDdlConfig oracleDdlConfig, SqlConnectionSupplier connections) {
OracleTableNameGetter tableNameGetter = new OracleTableNameGetter(oracleDdlConfig);
OraclePrefixedTableNames prefixedTableNames = new OraclePrefixedTableNames(tableNameGetter);
TableValueStyleCache valueStyleCache = new TableValueStyleCache();
OverflowValueLoader overflowValueLoader = new OracleOverflowValueLoader(oracleDdlConfig, tableNameGetter);
DbKvsGetRange getRange = new OracleGetRange(connections, overflowValueLoader, tableNameGetter, valueStyleCache, oracleDdlConfig);
CellTsPairLoader cellTsPageLoader = new OracleCellTsPageLoader(connections, tableNameGetter, valueStyleCache, oracleDdlConfig);
return new DbKvs(executor, oracleDdlConfig, new OracleDbTableFactory(oracleDdlConfig, tableNameGetter, prefixedTableNames, valueStyleCache, PTExecutors.newSingleThreadScheduledExecutor()), connections, new ImmediateSingleBatchTaskRunner(), overflowValueLoader, getRange, new DbKvsGetCandidateCellsForSweeping(cellTsPageLoader));
}
use of com.palantir.atlasdb.keyvalue.dbkvs.impl.sweep.CellTsPairLoader in project atlasdb by palantir.
the class DbKvs method createPostgres.
private static DbKvs createPostgres(ExecutorService executor, PostgresDdlConfig config, SqlConnectionSupplier connections) {
PostgresPrefixedTableNames prefixedTableNames = new PostgresPrefixedTableNames(config);
DbTableFactory tableFactory = new PostgresDbTableFactory(config, prefixedTableNames);
TableMetadataCache tableMetadataCache = new TableMetadataCache(tableFactory);
CellTsPairLoader cellTsPairLoader = new PostgresCellTsPageLoader(prefixedTableNames, connections);
return new DbKvs(executor, config, tableFactory, connections, new ParallelTaskRunner(newFixedThreadPool(config.poolSize()), config.fetchBatchSize()), // no overflow on postgres
(conns, tbl, ids) -> Collections.emptyMap(), new PostgresGetRange(prefixedTableNames, connections, tableMetadataCache), new DbKvsGetCandidateCellsForSweeping(cellTsPairLoader));
}
Aggregations