@Override protected synchronized void storeBlock(byte[] digest, int level, byte[] data) { BlockId id = new BlockId(digest, 0); map.put(id, data); timestamps.put(id, System.currentTimeMillis()); }
@Override protected synchronized void storeBlock(byte[] digest, int level, byte[] data) { BlockId id = new BlockId(digest, 0); map.put(id, data); timestamps.put(id, System.currentTimeMillis()); }
@Override protected synchronized void storeBlock(byte[] digest, int level, byte[] data) { BlockId id = new BlockId(digest, 0); map.put(id, data); timestamps.put(id, System.currentTimeMillis()); }
BlockId id = new BlockId(digest, 0); mark(id); if (level > 0) {
BlockId id = new BlockId(digest, 0); mark(id); if (level > 0) {
BlockId id = new BlockId(digest, 0); mark(id); if (level > 0) {
/** * Ignores the maxlastModifiedTime */ @Override public long countDeleteChunks(List<String> chunkIds, long maxLastModifiedTime) throws Exception { int count = 0; for (String chunkId : chunkIds) { BlockId id = new BlockId(StringUtils.convertHexToBytes(chunkId), 0); if (map.containsKey(id)) { if (maxLastModifiedTime == 0 || (maxLastModifiedTime > 0 && maxLastModifiedTime > timestamps.get(id))) { map.remove(id); timestamps.remove(id); count++; } } else if (old.containsKey(id)) { old.remove(id); count++; } } return count; }
/** * Ignores the maxlastModifiedTime */ @Override public long countDeleteChunks(List<String> chunkIds, long maxLastModifiedTime) throws Exception { int count = 0; for (String chunkId : chunkIds) { BlockId id = new BlockId(StringUtils.convertHexToBytes(chunkId), 0); if (map.containsKey(id)) { if (maxLastModifiedTime == 0 || (maxLastModifiedTime > 0 && maxLastModifiedTime > timestamps.get(id))) { map.remove(id); timestamps.remove(id); count++; } } else if (old.containsKey(id)) { old.remove(id); count++; } } return count; }
/** * Ignores the maxlastModifiedTime */ @Override public long countDeleteChunks(List<String> chunkIds, long maxLastModifiedTime) throws Exception { int count = 0; for (String chunkId : chunkIds) { BlockId id = new BlockId(StringUtils.convertHexToBytes(chunkId), 0); if (map.containsKey(id)) { if (maxLastModifiedTime == 0 || (maxLastModifiedTime > 0 && maxLastModifiedTime > timestamps.get(id))) { map.remove(id); timestamps.remove(id); count++; } } else if (old.containsKey(id)) { old.remove(id); count++; } } return count; }
byte[] readBlock(byte[] digest, long pos) { BlockId id = new BlockId(digest, pos); return load(id).data; }
byte[] readBlock(byte[] digest, long pos) { BlockId id = new BlockId(digest, pos); return load(id).data; }
byte[] readBlock(byte[] digest, long pos) { BlockId id = new BlockId(digest, pos); return load(id).data; }