public void remove(ChunkKey key, WriteBuffer buffer) throws DhtException { table.deleteRow(key.asBytes()); } }
public void remove(ChunkKey key, WriteBuffer buffer) throws DhtException { table.deleteRow(key.asBytes()); } }
public String asString() { return decode(asBytes()); }
public String asString() { return decode(asBytes()); }
public void remove(ObjectIndexKey objId, ChunkKey chunk, WriteBuffer buffer) throws DhtException { table.delete(objId.asBytes(), colInfo.append(chunk.asBytes())); } }
public void remove(RepositoryKey repo, ChunkKey chunk, WriteBuffer buffer) throws DhtException { table.delete(repo.asBytes(), colChunkInfo.append(chunk.asBytes())); }
public void remove(ObjectIndexKey objId, ChunkKey chunk, WriteBuffer buffer) throws DhtException { table.delete(objId.asBytes(), colInfo.append(chunk.asBytes())); } }
public void remove(RepositoryKey repo, ChunkKey chunk, WriteBuffer buffer) throws DhtException { table.delete(repo.asBytes(), colChunkInfo.append(chunk.asBytes())); }
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 put(RepositoryKey repo, ChunkInfo info, WriteBuffer buffer) throws DhtException { table.put(repo.asBytes(), colChunkInfo.append(info.getChunkKey().asBytes()), info.getData().toByteArray()); }
public void put(RepositoryKey repo, ChunkInfo info, WriteBuffer buffer) throws DhtException { table.put(repo.asBytes(), colChunkInfo.append(info.getChunkKey().asBytes()), info.getData().toByteArray()); }
public void add(ObjectIndexKey objId, ObjectInfo info, WriteBuffer buffer) throws DhtException { ChunkKey chunk = info.getChunkKey(); table.put(objId.asBytes(), colInfo.append(chunk.asBytes()), info.getData().toByteArray()); }
public void add(ObjectIndexKey objId, ObjectInfo info, WriteBuffer buffer) throws DhtException { ChunkKey chunk = info.getChunkKey(); table.put(objId.asBytes(), colInfo.append(chunk.asBytes()), info.getData().toByteArray()); }
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); }
public void put(PackChunk.Members chunk, WriteBuffer buffer) throws DhtException { byte[] row = chunk.getChunkKey().asBytes(); if (chunk.hasChunkData()) table.put(row, colData.name(), chunk.getChunkData()); if (chunk.hasChunkIndex()) table.put(row, colIndex.name(), chunk.getChunkIndex()); if (chunk.hasMeta()) table.put(row, colMeta.name(), chunk.getMeta().toByteArray()); }
public void put(PackChunk.Members chunk, WriteBuffer buffer) throws DhtException { byte[] row = chunk.getChunkKey().asBytes(); if (chunk.hasChunkData()) table.put(row, colData.name(), chunk.getChunkData()); if (chunk.hasChunkIndex()) table.put(row, colIndex.name(), chunk.getChunkIndex()); if (chunk.hasMeta()) table.put(row, colMeta.name(), chunk.getMeta().toByteArray()); }