/** Initialize an empty database. */ public MemoryDatabase() { repositoryIndex = new MemRepositoryIndexTable(); repository = new MemRepositoryTable(); ref = new MemRefTable(); objectIndex = new MemObjectIndexTable(); chunk = new MemChunkTable(); }
/** * Delete an entire row. * * @param row */ public void deleteRow(byte[] row) { synchronized (lock) { map.remove(new Key(row)); } }
/** * Put a value into a cell. * * @param row * @param col * @param val */ public void put(byte[] row, byte[] col, byte[] val) { synchronized (lock) { Key rowKey = new Key(row); Map<Key, Cell> r = map.get(rowKey); if (r == null) { r = new HashMap<Key, Cell>(4); map.put(rowKey, r); } r.put(new Key(col), new Cell(row, col, val)); } }
public void remove(ObjectIndexKey objId, ChunkKey chunk, WriteBuffer buffer) throws DhtException { table.delete(objId.asBytes(), colInfo.append(chunk.asBytes())); } }
public void remove(ChunkKey key, WriteBuffer buffer) throws DhtException { table.deleteRow(key.asBytes()); } }
/** Initialize an empty database. */ public MemoryDatabase() { repositoryIndex = new MemRepositoryIndexTable(); repository = new MemRepositoryTable(); ref = new MemRefTable(); objectIndex = new MemObjectIndexTable(); chunk = new MemChunkTable(); }
/** * Put a value into a cell. * * @param row * @param col * @param val */ public void put(byte[] row, byte[] col, byte[] val) { synchronized (lock) { Key rowKey = new Key(row); Map<Key, Cell> r = map.get(rowKey); if (r == null) { r = new HashMap<Key, Cell>(4); map.put(rowKey, r); } r.put(new Key(col), new Cell(row, col, val)); } }
public void remove(RepositoryKey repo, CachedPackKey key, WriteBuffer buffer) throws DhtException { table.delete(repo.asBytes(), colCachedPack.append(key.asBytes())); } }
public void remove(ChunkKey key, WriteBuffer buffer) throws DhtException { table.deleteRow(key.asBytes()); } }
/** * Delete an entire row. * * @param row */ public void deleteRow(byte[] row) { synchronized (lock) { map.remove(new Key(row)); } }
public void remove(RepositoryKey repo, ChunkKey chunk, WriteBuffer buffer) throws DhtException { table.delete(repo.asBytes(), colChunkInfo.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(RepositoryKey repo, CachedPackKey key, WriteBuffer buffer) throws DhtException { table.delete(repo.asBytes(), colCachedPack.append(key.asBytes())); } }
public void remove(ObjectIndexKey objId, ChunkKey chunk, WriteBuffer buffer) throws DhtException { table.delete(objId.asBytes(), colInfo.append(chunk.asBytes())); } }