/** * @return List of cached blocks suitable for translation into a * {@link BlockListAsLongs} for a cache report. */ synchronized List<Long> getCachedBlocks(String bpid) { List<Long> blocks = new ArrayList<Long>(); for (Iterator<Entry<ExtendedBlockId, Value>> iter = mappableBlockMap.entrySet().iterator(); iter.hasNext(); ) { Entry<ExtendedBlockId, Value> entry = iter.next(); if (entry.getKey().getBlockPoolId().equals(bpid)) { if (entry.getValue().state.shouldAdvertise()) { blocks.add(entry.getKey().getBlockId()); } } } return blocks; }
/** * @return List of cached blocks suitable for translation into a * {@link BlockListAsLongs} for a cache report. */ synchronized List<Long> getCachedBlocks(String bpid) { List<Long> blocks = new ArrayList<Long>(); for (Iterator<Entry<ExtendedBlockId, Value>> iter = mappableBlockMap.entrySet().iterator(); iter.hasNext(); ) { Entry<ExtendedBlockId, Value> entry = iter.next(); if (entry.getKey().getBlockPoolId().equals(bpid)) { if (entry.getValue().state.shouldAdvertise()) { blocks.add(entry.getKey().getBlockId()); } } } return blocks; }
/** * @return List of cached blocks suitable for translation into a * {@link BlockListAsLongs} for a cache report. */ synchronized List<Long> getCachedBlocks(String bpid) { List<Long> blocks = new ArrayList<Long>(); for (Iterator<Entry<ExtendedBlockId, Value>> iter = mappableBlockMap.entrySet().iterator(); iter.hasNext(); ) { Entry<ExtendedBlockId, Value> entry = iter.next(); if (entry.getKey().getBlockPoolId().equals(bpid)) { if (entry.getValue().state.shouldAdvertise()) { blocks.add(entry.getKey().getBlockId()); } } } return blocks; }
public synchronized boolean isCached(String bpid, long blockId) { ExtendedBlockId block = new ExtendedBlockId(blockId, bpid); Value val = mappableBlockMap.get(block); return (val != null) && val.state.shouldAdvertise(); } }
public synchronized boolean isCached(String bpid, long blockId) { ExtendedBlockId block = new ExtendedBlockId(blockId, bpid); Value val = mappableBlockMap.get(block); return (val != null) && val.state.shouldAdvertise(); } }
public synchronized boolean isCached(String bpid, long blockId) { ExtendedBlockId block = new ExtendedBlockId(blockId, bpid); Value val = mappableBlockMap.get(block); return (val != null) && val.state.shouldAdvertise(); } }