use of com.apple.foundationdb.record.provider.foundationdb.layers.interning.ScopedInterningLayer in project fdb-record-layer by FoundationDB.
the class ResolverMappingDigestTest method testInterningLayerAndExtendedLayer.
@Test
public void testInterningLayerAndExtendedLayer() throws Exception {
LocatableResolver primary;
LocatableResolver replica;
try (FDBRecordContext context = database.openContext()) {
primary = new ScopedInterningLayer(database, keySpace.path("test-path").add("to").add("primary").toResolvedPath(context));
replica = new ExtendedDirectoryLayer(database, keySpace.path("test-path").add("to").add("replica").toResolvedPath(context));
}
testComputeDigest(primary, replica, false);
}
use of com.apple.foundationdb.record.provider.foundationdb.layers.interning.ScopedInterningLayer in project fdb-record-layer by FoundationDB.
the class ResolverMappingDigestTest method testDirectoryLayerAndInterningLayer.
@Test
public void testDirectoryLayerAndInterningLayer() throws Exception {
LocatableResolver primary;
LocatableResolver replica;
try (FDBRecordContext context = database.openContext()) {
primary = new ScopedDirectoryLayer(database, keySpace.path("test-path").add("to").add("primary").toResolvedPath(context));
replica = new ScopedInterningLayer(database, keySpace.path("test-path").add("to").add("replica").toResolvedPath(context));
}
testComputeDigest(primary, replica, false);
}
use of com.apple.foundationdb.record.provider.foundationdb.layers.interning.ScopedInterningLayer in project fdb-record-layer by FoundationDB.
the class ResolverMappingReplicatorTest method testCopyInSameDatabase.
@Test
public void testCopyInSameDatabase() {
ResolverMappingReplicator replicator = new ResolverMappingReplicator(primary, 10);
FDBDatabase differentDB = new FDBDatabase(FDBDatabaseFactory.instance(), null);
KeySpacePath path = keySpace.path("test-path").add("to").add("replica");
try (FDBRecordContext context = differentDB.openContext()) {
LocatableResolver resolverInDifferentDB = new ScopedInterningLayer(differentDB, path.toResolvedPath(context));
replicator.copyTo(resolverInDifferentDB);
fail("should throw IllegalArgumentException");
} catch (IllegalArgumentException ex) {
assertThat(ex, hasMessageContaining("copy must be within same database"));
}
}
use of com.apple.foundationdb.record.provider.foundationdb.layers.interning.ScopedInterningLayer in project fdb-record-layer by FoundationDB.
the class DirectoryLayerToInterningLayerReplicaTest method setup.
@BeforeEach
public void setup() {
try (FDBRecordContext context = database.openContext()) {
primary = new ScopedDirectoryLayer(database, keySpace.path("test-path").add("to").add("primary").toResolvedPath(context));
replica = new ScopedInterningLayer(database, keySpace.path("test-path").add("to").add("replica").toResolvedPath(context));
}
}
use of com.apple.foundationdb.record.provider.foundationdb.layers.interning.ScopedInterningLayer in project fdb-record-layer by FoundationDB.
the class InterningLayerToExtendedDirectoryLayerReplicaTest method setup.
@BeforeEach
public void setup() {
try (FDBRecordContext context = database.openContext()) {
primary = new ScopedInterningLayer(database, keySpace.path("test-path").add("to").add("primary").toResolvedPath(context));
replica = new ExtendedDirectoryLayer(database, keySpace.path("test-path").add("to").add("replica").toResolvedPath(context));
}
seedWithMetadata = true;
}
Aggregations