Search in sources :

Example 1 with ResolvedKeySpacePath

use of com.apple.foundationdb.record.provider.foundationdb.keyspace.ResolvedKeySpacePath in project fdb-record-layer by FoundationDB.

the class FDBReverseDirectoryCacheTest method createRandomDirectoryScope.

private LocatableResolver createRandomDirectoryScope() {
    final String name = String.format("name-%d", Math.abs(random.nextLong()));
    KeySpace keySpace = new KeySpace(new KeySpaceDirectory(name, KeySpaceDirectory.KeyType.STRING, name));
    ResolvedKeySpacePath path;
    try (FDBRecordContext context = fdb.openContext()) {
        path = keySpace.resolveFromKey(context, Tuple.from(name));
    }
    return new ScopedDirectoryLayer(fdb, path);
}
Also used : ScopedDirectoryLayer(com.apple.foundationdb.record.provider.foundationdb.keyspace.ScopedDirectoryLayer) ResolvedKeySpacePath(com.apple.foundationdb.record.provider.foundationdb.keyspace.ResolvedKeySpacePath) KeySpace(com.apple.foundationdb.record.provider.foundationdb.keyspace.KeySpace) KeySpaceDirectory(com.apple.foundationdb.record.provider.foundationdb.keyspace.KeySpaceDirectory)

Aggregations

KeySpace (com.apple.foundationdb.record.provider.foundationdb.keyspace.KeySpace)1 KeySpaceDirectory (com.apple.foundationdb.record.provider.foundationdb.keyspace.KeySpaceDirectory)1 ResolvedKeySpacePath (com.apple.foundationdb.record.provider.foundationdb.keyspace.ResolvedKeySpacePath)1 ScopedDirectoryLayer (com.apple.foundationdb.record.provider.foundationdb.keyspace.ScopedDirectoryLayer)1