public void onFailure(DhtException error) { // TODO(spearce) We may want to just drop to database here. normalCallback.onFailure(error); } }
public void onFailure(DhtException error) { // TODO(spearce) We may want to just drop to database here. normalCallback.onFailure(error); } }
public void onFailure(DhtException error) { normalCallback.onFailure(error); } }
public void onFailure(DhtException error) { // TODO(spearce) We may want to just drop to database here. normalCallback.onFailure(error); } }
public void onFailure(DhtException error) { // TODO(spearce) We may want to just drop to database here. normalCallback.onFailure(error); } }
public void onFailure(DhtException error) { // TODO(spearce) We may want to just drop to database here. normalCallback.onFailure(error); } }
public void onFailure(DhtException error) { // TODO(spearce) We may want to just drop to database here. normalCallback.onFailure(error); } }
public void onFailure(DhtException error) { normalCallback.onFailure(error); } }
public void onFailure(DhtException error) { normalCallback.onFailure(error); } }
public void onFailure(DhtException error) { normalCallback.onFailure(error); } }
public void onFailure(DhtException error) { normalCallback.onFailure(error); } }
public void onFailure(DhtException error) { normalCallback.onFailure(error); } }
public void onFailure(DhtException error) { try { callback.onFailure(error); } finally { done(); } }
public void onFailure(DhtException error) { try { callback.onFailure(error); } finally { done(); } }
public void getMeta(Context options, Set<ChunkKey> keys, AsyncCallback<Map<ChunkKey, ChunkMeta>> callback) { Map<ChunkKey, ChunkMeta> out = new HashMap<ChunkKey, ChunkMeta>(); for (ChunkKey chunk : keys) { byte[] row = chunk.asBytes(); MemTable.Cell cell = table.get(row, colMeta.name()); if (cell != null) { try { out.put(chunk, ChunkMeta.parseFrom(cell.getValue())); } catch (InvalidProtocolBufferException err) { callback.onFailure(new DhtException(MessageFormat.format( DhtText.get().invalidChunkMeta, chunk), err)); return; } } } callback.onSuccess(out); }
public void getMeta(Context options, Set<ChunkKey> keys, AsyncCallback<Map<ChunkKey, ChunkMeta>> callback) { Map<ChunkKey, ChunkMeta> out = new HashMap<ChunkKey, ChunkMeta>(); for (ChunkKey chunk : keys) { byte[] row = chunk.asBytes(); MemTable.Cell cell = table.get(row, colMeta.name()); if (cell != null) { try { out.put(chunk, ChunkMeta.parseFrom(cell.getValue())); } catch (InvalidProtocolBufferException err) { callback.onFailure(new DhtException(MessageFormat.format( DhtText.get().invalidChunkMeta, chunk), err)); return; } } } callback.onSuccess(out); }
public void get(Context options, Set<ObjectIndexKey> objects, AsyncCallback<Map<ObjectIndexKey, Collection<ObjectInfo>>> callback) { Map<ObjectIndexKey, Collection<ObjectInfo>> out = new HashMap<ObjectIndexKey, Collection<ObjectInfo>>(); for (ObjectIndexKey objId : objects) { for (MemTable.Cell cell : table.scanFamily(objId.asBytes(), colInfo)) { Collection<ObjectInfo> chunks = out.get(objId); ChunkKey chunkKey; if (chunks == null) { chunks = new ArrayList<ObjectInfo>(4); out.put(objId, chunks); } chunkKey = ChunkKey.fromBytes(colInfo.suffix(cell.getName())); try { chunks.add(new ObjectInfo( chunkKey, cell.getTimestamp(), GitStore.ObjectInfo.parseFrom(cell.getValue()))); } catch (InvalidProtocolBufferException badCell) { callback.onFailure(new DhtException(MessageFormat.format( DhtText.get().invalidObjectInfo, objId, chunkKey), badCell)); return; } } } callback.onSuccess(out); }
public void get(Context options, Set<ObjectIndexKey> objects, AsyncCallback<Map<ObjectIndexKey, Collection<ObjectInfo>>> callback) { Map<ObjectIndexKey, Collection<ObjectInfo>> out = new HashMap<ObjectIndexKey, Collection<ObjectInfo>>(); for (ObjectIndexKey objId : objects) { for (MemTable.Cell cell : table.scanFamily(objId.asBytes(), colInfo)) { Collection<ObjectInfo> chunks = out.get(objId); ChunkKey chunkKey; if (chunks == null) { chunks = new ArrayList<ObjectInfo>(4); out.put(objId, chunks); } chunkKey = ChunkKey.fromBytes(colInfo.suffix(cell.getName())); try { chunks.add(new ObjectInfo( chunkKey, cell.getTimestamp(), GitStore.ObjectInfo.parseFrom(cell.getValue()))); } catch (InvalidProtocolBufferException badCell) { callback.onFailure(new DhtException(MessageFormat.format( DhtText.get().invalidObjectInfo, objId, chunkKey), badCell)); return; } } } callback.onSuccess(out); }
public void get(Context options, Set<ChunkKey> keys, AsyncCallback<Collection<PackChunk.Members>> callback) { int cnt = keys.size(); List<PackChunk.Members> out = new ArrayList<PackChunk.Members>(cnt); for (ChunkKey chunk : keys) { byte[] row = chunk.asBytes(); MemTable.Cell cell; cell = table.get(row, colData.name()); if (cell == null) continue; PackChunk.Members m = new PackChunk.Members(); m.setChunkKey(chunk); m.setChunkData(cell.getValue()); cell = table.get(row, colIndex.name()); if (cell != null) m.setChunkIndex(cell.getValue()); cell = table.get(row, colMeta.name()); if (cell != null) { try { m.setMeta(ChunkMeta.parseFrom(cell.getValue())); } catch (InvalidProtocolBufferException err) { callback.onFailure(new DhtException(MessageFormat.format( DhtText.get().invalidChunkMeta, chunk), err)); return; } } out.add(m); } callback.onSuccess(out); }
public void get(Context options, Set<ChunkKey> keys, AsyncCallback<Collection<PackChunk.Members>> callback) { int cnt = keys.size(); List<PackChunk.Members> out = new ArrayList<PackChunk.Members>(cnt); for (ChunkKey chunk : keys) { byte[] row = chunk.asBytes(); MemTable.Cell cell; cell = table.get(row, colData.name()); if (cell == null) continue; PackChunk.Members m = new PackChunk.Members(); m.setChunkKey(chunk); m.setChunkData(cell.getValue()); cell = table.get(row, colIndex.name()); if (cell != null) m.setChunkIndex(cell.getValue()); cell = table.get(row, colMeta.name()); if (cell != null) { try { m.setMeta(ChunkMeta.parseFrom(cell.getValue())); } catch (InvalidProtocolBufferException err) { callback.onFailure(new DhtException(MessageFormat.format( DhtText.get().invalidChunkMeta, chunk), err)); return; } } out.add(m); } callback.onSuccess(out); }