Search in sources :

Example 1 with FileStorageService

use of com.facebook.presto.raptor.storage.FileStorageService in project presto by prestodb.

the class TestShardCleaner method setup.

@BeforeMethod
public void setup() throws Exception {
    dbi = new DBI("jdbc:h2:mem:test" + System.nanoTime());
    dummyHandle = dbi.open();
    createTablesWithRetry(dbi);
    temporary = createTempDir();
    File directory = new File(temporary, "data");
    storageService = new FileStorageService(directory);
    storageService.start();
    File backupDirectory = new File(temporary, "backup");
    backupStore = new FileBackupStore(backupDirectory);
    ((FileBackupStore) backupStore).start();
    ticker = new TestingTicker();
    ShardCleanerConfig config = new ShardCleanerConfig();
    cleaner = new ShardCleaner(new DaoSupplier<>(dbi, H2ShardDao.class), "node1", true, ticker, storageService, Optional.of(backupStore), config.getMaxTransactionAge(), config.getTransactionCleanerInterval(), config.getLocalCleanerInterval(), config.getLocalCleanTime(), config.getBackupCleanerInterval(), config.getBackupCleanTime(), config.getBackupDeletionThreads(), config.getMaxCompletedTransactionAge());
}
Also used : FileBackupStore(com.facebook.presto.raptor.backup.FileBackupStore) TestingTicker(io.airlift.testing.TestingTicker) FileStorageService(com.facebook.presto.raptor.storage.FileStorageService) IDBI(org.skife.jdbi.v2.IDBI) DBI(org.skife.jdbi.v2.DBI) DaoSupplier(com.facebook.presto.raptor.util.DaoSupplier) File(java.io.File) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

FileBackupStore (com.facebook.presto.raptor.backup.FileBackupStore)1 FileStorageService (com.facebook.presto.raptor.storage.FileStorageService)1 DaoSupplier (com.facebook.presto.raptor.util.DaoSupplier)1 TestingTicker (io.airlift.testing.TestingTicker)1 File (java.io.File)1 DBI (org.skife.jdbi.v2.DBI)1 IDBI (org.skife.jdbi.v2.IDBI)1 BeforeMethod (org.testng.annotations.BeforeMethod)1