public String asString() { return decode(asBytes()); }
public String asString() { return decode(asBytes()); }
public void remove(RepositoryKey repo, CachedPackKey key, WriteBuffer buffer) throws DhtException { table.delete(repo.asBytes(), colCachedPack.append(key.asBytes())); } }
public void remove(RepositoryKey repo, CachedPackKey key, WriteBuffer buffer) throws DhtException { table.delete(repo.asBytes(), colCachedPack.append(key.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, ChunkKey chunk, WriteBuffer buffer) throws DhtException { table.delete(repo.asBytes(), colChunkInfo.append(chunk.asBytes())); }
public void putUnique(RepositoryName name, RepositoryKey key) throws DhtException, TimeoutException { db.putUnique(name, key); Sync<Void> sync = Sync.create(); CacheKey memKey = ns.key(name); byte[] data = key.asBytes(); client.modify(singleton(Change.put(memKey, data)), sync); try { sync.get(options.getTimeout()); } catch (InterruptedException e) { throw new TimeoutException(); } }
public void putUnique(RepositoryName name, RepositoryKey key) throws DhtException, TimeoutException { db.putUnique(name, key); Sync<Void> sync = Sync.create(); CacheKey memKey = ns.key(name); byte[] data = key.asBytes(); client.modify(singleton(Change.put(memKey, data)), sync); try { sync.get(options.getTimeout()); } catch (InterruptedException e) { throw new TimeoutException(); } }
public void putUnique(RepositoryName name, RepositoryKey key) throws DhtException, TimeoutException { boolean ok = table.compareAndSet( // name.asBytes(), // colId.name(), // null, // key.asBytes()); if (!ok) throw new DhtException(MessageFormat.format( DhtText.get().repositoryAlreadyExists, name.asString())); }
public void remove(RepositoryName name, RepositoryKey key) throws DhtException, TimeoutException { boolean ok = table.compareAndSet( name.asBytes(), colId.name(), key.asBytes(), null); if (!ok) throw new DhtException(MessageFormat.format( DhtText.get().repositoryAlreadyExists, name.asString())); } }
public void remove(RepositoryName name, RepositoryKey key) throws DhtException, TimeoutException { boolean ok = table.compareAndSet( name.asBytes(), colId.name(), key.asBytes(), null); if (!ok) throw new DhtException(MessageFormat.format( DhtText.get().repositoryAlreadyExists, name.asString())); } }
public void putUnique(RepositoryName name, RepositoryKey key) throws DhtException, TimeoutException { boolean ok = table.compareAndSet( // name.asBytes(), // colId.name(), // null, // key.asBytes()); if (!ok) throw new DhtException(MessageFormat.format( DhtText.get().repositoryAlreadyExists, name.asString())); }
public boolean compareAndRemove(RefKey refKey, RefData oldData) throws DhtException, TimeoutException { RepositoryKey repo = refKey.getRepositoryKey(); return table.compareAndSet( // repo.asBytes(), // colRef.append(refKey.asBytes()), // oldData != RefDataUtil.NONE ? oldData.toByteArray() : null, // null); } }
public void put(RepositoryKey repo, CachedPackInfo info, WriteBuffer buffer) throws DhtException { CachedPackKey key = CachedPackKey.fromInfo(info); table.put(repo.asBytes(), colCachedPack.append(key.asBytes()), info.toByteArray()); }
public boolean compareAndRemove(RefKey refKey, RefData oldData) throws DhtException, TimeoutException { RepositoryKey repo = refKey.getRepositoryKey(); return table.compareAndSet( // repo.asBytes(), // colRef.append(refKey.asBytes()), // oldData != RefDataUtil.NONE ? oldData.toByteArray() : null, // null); } }
public void put(RepositoryKey repo, CachedPackInfo info, WriteBuffer buffer) throws DhtException { CachedPackKey key = CachedPackKey.fromInfo(info); table.put(repo.asBytes(), colCachedPack.append(key.asBytes()), info.toByteArray()); }
public boolean compareAndPut(RefKey refKey, RefData oldData, RefData newData) throws DhtException, TimeoutException { RepositoryKey repo = refKey.getRepositoryKey(); return table.compareAndSet( // repo.asBytes(), // colRef.append(refKey.asBytes()), // oldData != RefDataUtil.NONE ? oldData.toByteArray() : null, // newData.toByteArray()); }
public boolean compareAndPut(RefKey refKey, RefData oldData, RefData newData) throws DhtException, TimeoutException { RepositoryKey repo = refKey.getRepositoryKey(); return table.compareAndSet( // repo.asBytes(), // colRef.append(refKey.asBytes()), // oldData != RefDataUtil.NONE ? oldData.toByteArray() : null, // newData.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 put(RepositoryKey repo, ChunkInfo info, WriteBuffer buffer) throws DhtException { table.put(repo.asBytes(), colChunkInfo.append(info.getChunkKey().asBytes()), info.getData().toByteArray()); }