public static Leaderboard[] fetchAll() { final Key<Leaderboard>[] leaderboardKeys = KeySnapshot.globalSnapshot().filter(new KeySnapshot.KVFilter() { @Override public boolean filter(KeySnapshot.KeyInfo k) { return Value.isSubclassOf(k._type, Leaderboard.class); } }).keys(); Leaderboard[] leaderboards = new Leaderboard[leaderboardKeys.length]; for (int i = 0; i < leaderboardKeys.length; i++) { Leaderboard leaderboard = getFromDKV("(none)", leaderboardKeys[i]); leaderboards[i] = leaderboard; } return leaderboards; }
private void cleanUpCache(Futures fs) { final Key[] cacheKeys = KeySnapshot.globalSnapshot().filter(new KeySnapshot.KVFilter() { @Override public boolean filter(KeySnapshot.KeyInfo k) { return Value.isSubclassOf(k._type, DeepWaterImageIterator.IcedImage.class) && k._key.toString().contains(CACHE_MARKER) || Value.isSubclassOf(k._type, DeepWaterDatasetIterator.IcedRow.class) && k._key.toString().contains(CACHE_MARKER); } }).keys(); if (fs==null) fs = new Futures(); for (Key k : cacheKeys) DKV.remove(k, fs); fs.blockForPending(); }
public static Leaderboard[] fetchAll() { final Key<Leaderboard>[] leaderboardKeys = KeySnapshot.globalSnapshot().filter(new KeySnapshot.KVFilter() { @Override public boolean filter(KeySnapshot.KeyInfo k) { return Value.isSubclassOf(k._type, Leaderboard.class); } }).keys(); Leaderboard[] leaderboards = new Leaderboard[leaderboardKeys.length]; for (int i = 0; i < leaderboardKeys.length; i++) { Leaderboard leaderboard = getFromDKV("(none)", leaderboardKeys[i]); leaderboards[i] = leaderboard; } return leaderboards; }
private void cleanUpCache(Futures fs) { final Key[] cacheKeys = KeySnapshot.globalSnapshot().filter(new KeySnapshot.KVFilter() { @Override public boolean filter(KeySnapshot.KeyInfo k) { return Value.isSubclassOf(k._type, DeepWaterImageIterator.IcedImage.class) && k._key.toString().contains(CACHE_MARKER) || Value.isSubclassOf(k._type, DeepWaterDatasetIterator.IcedRow.class) && k._key.toString().contains(CACHE_MARKER); } }).keys(); if (fs==null) fs = new Futures(); for (Key k : cacheKeys) DKV.remove(k, fs); fs.blockForPending(); }