Search in sources :

Example 1 with DiskNamespaceLoader

use of com.palantir.atlasdb.timelock.management.DiskNamespaceLoader in project atlasdb by palantir.

the class LocalPaxosComponents method createWithAsyncMigration.

public static LocalPaxosComponents createWithAsyncMigration(TimelockPaxosMetrics metrics, PaxosUseCase paxosUseCase, Path legacyLogDirectory, DataSource sqliteDataSource, UUID leaderUuid, boolean canCreateNewClients, OrderableSlsVersion timeLockVersion, boolean skipConsistencyCheckAndTruncateOldPaxosLog, ExecutorService sqliteAsyncExecutor) {
    LocalPaxosComponents components = new LocalPaxosComponents(metrics, paxosUseCase, legacyLogDirectory, sqliteDataSource, leaderUuid, canCreateNewClients, timeLockVersion, skipConsistencyCheckAndTruncateOldPaxosLog);
    Path legacyClientDir = paxosUseCase.logDirectoryRelativeToDataDirectory(legacyLogDirectory);
    PersistentNamespaceLoader namespaceLoader = new DiskNamespaceLoader(legacyClientDir);
    Set<Client> namespaces = namespaceLoader.getAllPersistedNamespaces();
    sqliteAsyncExecutor.execute(() -> migrate(components, namespaces));
    return components;
}
Also used : Path(java.nio.file.Path) DiskNamespaceLoader(com.palantir.atlasdb.timelock.management.DiskNamespaceLoader) Client(com.palantir.paxos.Client) PersistentNamespaceLoader(com.palantir.atlasdb.timelock.management.PersistentNamespaceLoader)

Aggregations

DiskNamespaceLoader (com.palantir.atlasdb.timelock.management.DiskNamespaceLoader)1 PersistentNamespaceLoader (com.palantir.atlasdb.timelock.management.PersistentNamespaceLoader)1 Client (com.palantir.paxos.Client)1 Path (java.nio.file.Path)1