Search in sources :

Example 1 with FileStorageService

use of io.trino.plugin.raptor.legacy.storage.FileStorageService in project trino by trinodb.

the class TestShardCleaner method setup.

@BeforeMethod
public void setup() throws IOException {
    dbi = createTestingJdbi();
    dummyHandle = dbi.open();
    createTablesWithRetry(dbi);
    temporary = createTempDirectory(null);
    File directory = temporary.resolve("data").toFile();
    storageService = new FileStorageService(directory);
    storageService.start();
    File backupDirectory = temporary.resolve("backup").toFile();
    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(io.trino.plugin.raptor.legacy.backup.FileBackupStore) TestingTicker(io.airlift.testing.TestingTicker) FileStorageService(io.trino.plugin.raptor.legacy.storage.FileStorageService) DaoSupplier(io.trino.plugin.raptor.legacy.util.DaoSupplier) File(java.io.File) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 2 with FileStorageService

use of io.trino.plugin.raptor.legacy.storage.FileStorageService in project trino by trinodb.

the class TestBackupManager method setup.

@BeforeMethod
public void setup() throws IOException {
    temporary = createTempDirectory(null);
    FileBackupStore fileStore = new FileBackupStore(temporary.resolve("backup").toFile());
    fileStore.start();
    backupStore = new TestingBackupStore(fileStore);
    storageService = new FileStorageService(temporary.resolve("data").toFile());
    storageService.start();
    backupManager = new BackupManager(Optional.of(backupStore), storageService, 5);
}
Also used : FileStorageService(io.trino.plugin.raptor.legacy.storage.FileStorageService) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

FileStorageService (io.trino.plugin.raptor.legacy.storage.FileStorageService)2 BeforeMethod (org.testng.annotations.BeforeMethod)2 TestingTicker (io.airlift.testing.TestingTicker)1 FileBackupStore (io.trino.plugin.raptor.legacy.backup.FileBackupStore)1 DaoSupplier (io.trino.plugin.raptor.legacy.util.DaoSupplier)1 File (java.io.File)1