/** * Create a namespace from a byte array. * * @param name * the name to wrap. * @return the namespace. */ public static Namespace create(byte[] name) { return new Namespace(name); }
@Override public boolean equals(Object other) { if (this == other) return true; if (other instanceof CacheKey) { CacheKey m = (CacheKey) other; return ns.equals(m.ns) && Arrays.equals(key, m.key); } return false; }
public void get(Context options, Set<ObjectIndexKey> objects, AsyncCallback<Map<ObjectIndexKey, Collection<ObjectInfo>>> callback) { List<CacheKey> toFind = new ArrayList<CacheKey>(objects.size()); for (ObjectIndexKey k : objects) toFind.add(ns.key(k)); client.get(toFind, new LoaderFromCache(options, objects, callback)); }
public void get(Context options, Set<ChunkKey> keys, AsyncCallback<Collection<PackChunk.Members>> callback) { List<CacheKey> toFind = new ArrayList<CacheKey>(keys.size()); for (ChunkKey k : keys) toFind.add(nsChunk.key(k)); client.get(toFind, new ChunkFromCache(options, keys, callback)); }
/** * Create a namespace from a byte array. * * @param name * the name to wrap. * @return the namespace. */ public static Namespace create(byte[] name) { return new Namespace(name); }
@Override public boolean equals(Object other) { if (this == other) return true; if (other instanceof CacheKey) { CacheKey m = (CacheKey) other; return ns.equals(m.ns) && Arrays.equals(key, m.key); } return false; }
public void getMeta(Context options, Set<ChunkKey> keys, AsyncCallback<Map<ChunkKey, ChunkMeta>> callback) { List<CacheKey> toFind = new ArrayList<CacheKey>(keys.size()); for (ChunkKey k : keys) toFind.add(nsMeta.key(k)); client.get(toFind, new MetaFromCache(options, keys, callback)); }
/** * Create a namespace from a string name. * * @param name * the name to wrap. * @return the namespace. */ public static Namespace create(String name) { return new Namespace(Constants.encode(name)); }
public void get(Context options, Set<ObjectIndexKey> objects, AsyncCallback<Map<ObjectIndexKey, Collection<ObjectInfo>>> callback) { List<CacheKey> toFind = new ArrayList<CacheKey>(objects.size()); for (ObjectIndexKey k : objects) toFind.add(ns.key(k)); client.get(toFind, new LoaderFromCache(options, objects, callback)); }
/** * Create a namespace from a string name. * * @param name * the name to wrap. * @return the namespace. */ public static Namespace create(String name) { return new Namespace(Constants.encode(name)); }
public void get(Context options, Set<ChunkKey> keys, AsyncCallback<Collection<PackChunk.Members>> callback) { List<CacheKey> toFind = new ArrayList<CacheKey>(keys.size()); for (ChunkKey k : keys) toFind.add(nsChunk.key(k)); client.get(toFind, new ChunkFromCache(options, keys, callback)); }
public void getMeta(Context options, Set<ChunkKey> keys, AsyncCallback<Map<ChunkKey, ChunkMeta>> callback) { List<CacheKey> toFind = new ArrayList<CacheKey>(keys.size()); for (ChunkKey k : keys) toFind.add(nsMeta.key(k)); client.get(toFind, new MetaFromCache(options, keys, callback)); }
public void run() { for (Map.Entry<ChunkKey, ChunkMeta> ent : toPutIntoCache.entrySet()) { ChunkKey key = ent.getKey(); Change op = Change.put(nsMeta.key(key), ent.getValue().toByteArray()); client.modify(singleton(op), none); } } });
public void run() { for (Map.Entry<ChunkKey, ChunkMeta> ent : toPutIntoCache.entrySet()) { ChunkKey key = ent.getKey(); Change op = Change.put(nsMeta.key(key), ent.getValue().toByteArray()); client.modify(singleton(op), none); } } });
public void run() { List<Change> ops = new ArrayList<Change>(toPut.size()); for (Map.Entry<ObjectIndexKey, Collection<ObjectInfo>> e : all(toPut)) { List<ObjectInfo> items = copy(e.getValue()); ObjectInfo.sort(items); ops.add(Change.put(ns.key(e.getKey()), encode(items))); } client.modify(ops, Sync.<Void> none()); }
public void run() { List<Change> ops = new ArrayList<Change>(toPut.size()); for (Map.Entry<ObjectIndexKey, Collection<ObjectInfo>> e : all(toPut)) { List<ObjectInfo> items = copy(e.getValue()); ObjectInfo.sort(items); ops.add(Change.put(ns.key(e.getKey()), encode(items))); } client.modify(ops, Sync.<Void> none()); }
public void run() { for (PackChunk.Members members : toPutIntoCache) { ChunkKey key = members.getChunkKey(); Change op = Change.put(nsChunk.key(key), encode(members)); client.modify(singleton(op), none); } } });
public void run() { for (PackChunk.Members members : toPutIntoCache) { ChunkKey key = members.getChunkKey(); Change op = Change.put(nsChunk.key(key), encode(members)); client.modify(singleton(op), none); } } });