Search in sources :

Example 1 with ParallelTaskRunner

use of com.palantir.atlasdb.keyvalue.dbkvs.impl.batch.ParallelTaskRunner 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));
}
Also used : PostgresPrefixedTableNames(com.palantir.atlasdb.keyvalue.dbkvs.impl.postgres.PostgresPrefixedTableNames) CellTsPairLoader(com.palantir.atlasdb.keyvalue.dbkvs.impl.sweep.CellTsPairLoader) DbKvsGetCandidateCellsForSweeping(com.palantir.atlasdb.keyvalue.dbkvs.impl.sweep.DbKvsGetCandidateCellsForSweeping) PostgresCellTsPageLoader(com.palantir.atlasdb.keyvalue.dbkvs.impl.postgres.PostgresCellTsPageLoader) ParallelTaskRunner(com.palantir.atlasdb.keyvalue.dbkvs.impl.batch.ParallelTaskRunner) PostgresGetRange(com.palantir.atlasdb.keyvalue.dbkvs.impl.postgres.PostgresGetRange)

Aggregations

ParallelTaskRunner (com.palantir.atlasdb.keyvalue.dbkvs.impl.batch.ParallelTaskRunner)1 PostgresCellTsPageLoader (com.palantir.atlasdb.keyvalue.dbkvs.impl.postgres.PostgresCellTsPageLoader)1 PostgresGetRange (com.palantir.atlasdb.keyvalue.dbkvs.impl.postgres.PostgresGetRange)1 PostgresPrefixedTableNames (com.palantir.atlasdb.keyvalue.dbkvs.impl.postgres.PostgresPrefixedTableNames)1 CellTsPairLoader (com.palantir.atlasdb.keyvalue.dbkvs.impl.sweep.CellTsPairLoader)1 DbKvsGetCandidateCellsForSweeping (com.palantir.atlasdb.keyvalue.dbkvs.impl.sweep.DbKvsGetCandidateCellsForSweeping)1