Search in sources :

Example 6 with LocalFileStorageService

use of com.facebook.presto.raptor.filesystem.LocalFileStorageService in project presto by prestodb.

the class TestShardRecovery method setup.

@BeforeMethod
public void setup() {
    temporary = createTempDir();
    File directory = new File(temporary, "data");
    File backupDirectory = new File(temporary, "backup");
    backupStore = new FileBackupStore(backupDirectory);
    backupStore.start();
    storageService = new LocalFileStorageService(new LocalOrcDataEnvironment(), directory.toURI());
    storageService.start();
    IDBI dbi = new DBI("jdbc:h2:mem:test" + System.nanoTime() + "_" + ThreadLocalRandom.current().nextInt());
    dummyHandle = dbi.open();
    createTablesWithRetry(dbi);
    ShardManager shardManager = createShardManager(dbi);
    recoveryManager = createShardRecoveryManager(storageService, Optional.of(backupStore), shardManager);
}
Also used : IDBI(org.skife.jdbi.v2.IDBI) FileBackupStore(com.facebook.presto.raptor.backup.FileBackupStore) LocalOrcDataEnvironment(com.facebook.presto.raptor.filesystem.LocalOrcDataEnvironment) IDBI(org.skife.jdbi.v2.IDBI) DBI(org.skife.jdbi.v2.DBI) ShardManager(com.facebook.presto.raptor.metadata.ShardManager) TestDatabaseShardManager.createShardManager(com.facebook.presto.raptor.metadata.TestDatabaseShardManager.createShardManager) File.createTempFile(java.io.File.createTempFile) File(java.io.File) LocalFileStorageService(com.facebook.presto.raptor.filesystem.LocalFileStorageService) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 7 with LocalFileStorageService

use of com.facebook.presto.raptor.filesystem.LocalFileStorageService in project presto by prestodb.

the class TestBackupManager method setup.

@BeforeMethod
public void setup() {
    temporary = createTempDir();
    FileBackupStore fileStore = new FileBackupStore(new File(temporary, "backup"));
    fileStore.start();
    backupStore = new TestingBackupStore(fileStore);
    storageService = new LocalFileStorageService(new LocalOrcDataEnvironment(), new File(temporary, "data").toURI());
    storageService.start();
    backupManager = new BackupManager(Optional.of(backupStore), storageService, new LocalOrcDataEnvironment(), 5);
}
Also used : LocalOrcDataEnvironment(com.facebook.presto.raptor.filesystem.LocalOrcDataEnvironment) RandomAccessFile(java.io.RandomAccessFile) FileAssert.assertFile(org.testng.FileAssert.assertFile) File(java.io.File) LocalFileStorageService(com.facebook.presto.raptor.filesystem.LocalFileStorageService) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

LocalFileStorageService (com.facebook.presto.raptor.filesystem.LocalFileStorageService)7 LocalOrcDataEnvironment (com.facebook.presto.raptor.filesystem.LocalOrcDataEnvironment)7 BeforeMethod (org.testng.annotations.BeforeMethod)6 File (java.io.File)5 FileBackupStore (com.facebook.presto.raptor.backup.FileBackupStore)4 DBI (org.skife.jdbi.v2.DBI)4 IDBI (org.skife.jdbi.v2.IDBI)4 ShardManager (com.facebook.presto.raptor.metadata.ShardManager)3 TestDatabaseShardManager.createShardManager (com.facebook.presto.raptor.metadata.TestDatabaseShardManager.createShardManager)3 FileAssert.assertFile (org.testng.FileAssert.assertFile)3 URI (java.net.URI)2 TestingTicker (com.facebook.airlift.testing.TestingTicker)1 BackupStore (com.facebook.presto.raptor.backup.BackupStore)1 DaoSupplier (com.facebook.presto.raptor.util.DaoSupplier)1 TestingNodeManager (com.facebook.presto.testing.TestingNodeManager)1 Duration (io.airlift.units.Duration)1 File.createTempFile (java.io.File.createTempFile)1 RandomAccessFile (java.io.RandomAccessFile)1