Skip to content

Commit cc6d2cd

Browse files
committed
adding comments instead of removing method
Signed-off-by: Nischal Kumar <[email protected]>
1 parent 8cafd91 commit cc6d2cd

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/main/java/org/janusgraph/diskstorage/foundationdb/FoundationDBKeyValueStore.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
package org.janusgraph.diskstorage.foundationdb;
1616

1717
import com.apple.foundationdb.KeyValue;
18+
import com.apple.foundationdb.LocalityUtil;
1819
import com.apple.foundationdb.async.AsyncIterator;
20+
import com.apple.foundationdb.async.CloseableAsyncIterator;
1921
import com.apple.foundationdb.directory.DirectorySubspace;
2022
import com.google.common.base.Preconditions;
2123
import org.janusgraph.diskstorage.BackendException;
@@ -30,6 +32,7 @@
3032
import org.slf4j.Logger;
3133
import org.slf4j.LoggerFactory;
3234

35+
import java.util.ArrayList;
3336
import java.util.List;
3437
import java.util.Map;
3538
import java.util.HashMap;
@@ -250,7 +253,20 @@ public void delete(StaticBuffer key, StoreTransaction txh) throws BackendExcepti
250253
}
251254
}
252255

256+
/* this method is not called within JanusGraph, it's used for bulk access in Spark jobs.
257+
For more: Please check: {@link https://github.com/JanusGraph/janusgraph-foundationdb/pull/48#discussion_r498917927}
258+
*/
259+
public List<StaticBuffer> getBoundaryKeys() {
260+
List<StaticBuffer> keys = new ArrayList<>();
261+
try (CloseableAsyncIterator<byte[]> it = LocalityUtil.getBoundaryKeys(manager.db, db.range().begin, db.range().end)) {
262+
it.forEachRemaining(key -> keys.add(getBuffer(db.unpack(key).getBytes(0))));
263+
}
264+
return keys;
265+
}
266+
253267
static StaticBuffer getBuffer(byte[] entry) {
254268
return new StaticArrayBuffer(entry);
255269
}
270+
271+
256272
}

0 commit comments

Comments
 (0)