use of io.trino.plugin.raptor.legacy.backup.FileBackupStore in project trino by trinodb.
the class TestRaptorStorageManager method createRaptorStorageManager.
public static RaptorStorageManager createRaptorStorageManager(Jdbi dbi, File temporary, int maxShardRows) {
File directory = new File(temporary, "data");
StorageService storageService = new FileStorageService(directory);
storageService.start();
File backupDirectory = new File(temporary, "backup");
FileBackupStore fileBackupStore = new FileBackupStore(backupDirectory);
fileBackupStore.start();
Optional<BackupStore> backupStore = Optional.of(fileBackupStore);
ShardManager shardManager = createShardManager(dbi);
ShardRecoveryManager recoveryManager = new ShardRecoveryManager(storageService, backupStore, new TestingNodeManager(), shardManager, MISSING_SHARD_DISCOVERY, 10);
return createRaptorStorageManager(storageService, backupStore, recoveryManager, new InMemoryShardRecorder(), maxShardRows, MAX_FILE_SIZE);
}
use of io.trino.plugin.raptor.legacy.backup.FileBackupStore in project trino by trinodb.
the class TestRaptorStorageManager method setup.
@BeforeMethod
public void setup() throws IOException {
temporary = createTempDirectory(null);
File directory = temporary.resolve("data").toFile();
storageService = new FileStorageService(directory);
storageService.start();
File backupDirectory = temporary.resolve("backup").toFile();
fileBackupStore = new FileBackupStore(backupDirectory);
fileBackupStore.start();
backupStore = Optional.of(fileBackupStore);
Jdbi dbi = createTestingJdbi();
dummyHandle = dbi.open();
createTablesWithRetry(dbi);
ShardManager shardManager = createShardManager(dbi);
Duration discoveryInterval = new Duration(5, TimeUnit.MINUTES);
recoveryManager = new ShardRecoveryManager(storageService, backupStore, nodeManager, shardManager, discoveryInterval, 10);
shardRecorder = new InMemoryShardRecorder();
}
use of io.trino.plugin.raptor.legacy.backup.FileBackupStore in project trino by trinodb.
the class TestShardRecovery method setup.
@BeforeMethod
public void setup() throws IOException {
temporary = createTempDirectory(null);
File directory = temporary.resolve("data").toFile();
File backupDirectory = temporary.resolve("backup").toFile();
backupStore = new FileBackupStore(backupDirectory);
backupStore.start();
storageService = new FileStorageService(directory);
storageService.start();
Jdbi dbi = createTestingJdbi();
dummyHandle = dbi.open();
createTablesWithRetry(dbi);
ShardManager shardManager = createShardManager(dbi);
recoveryManager = createShardRecoveryManager(storageService, Optional.of(backupStore), shardManager);
}
use of io.trino.plugin.raptor.legacy.backup.FileBackupStore 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());
}
Aggregations