public <Chunk> Map<KeyIn, Chunk> requestChunk() { int mapSize = MapReduceUtil.mapSize(combiners.size()); Map<KeyIn, Chunk> chunkMap = createHashMapAdapter(mapSize); for (Map.Entry<KeyIn, Combiner<ValueIn, ?>> entry : combiners.entrySet()) { Combiner<ValueIn, ?> combiner = entry.getValue(); Chunk chunk = (Chunk) combiner.finalizeChunk(); combiner.reset(); if (chunk != null) { chunkMap.put(entry.getKey(), chunk); } } COLLECTED.set(this, 0); return chunkMap; }
public <Chunk> Map<KeyIn, Chunk> requestChunk() { int mapSize = MapReduceUtil.mapSize(combiners.size()); Map<KeyIn, Chunk> chunkMap = createHashMapAdapter(mapSize); for (Map.Entry<KeyIn, Combiner<ValueIn, ?>> entry : combiners.entrySet()) { Combiner<ValueIn, ?> combiner = entry.getValue(); Chunk chunk = (Chunk) combiner.finalizeChunk(); combiner.reset(); if (chunk != null) { chunkMap.put(entry.getKey(), chunk); } } COLLECTED.set(this, 0); return chunkMap; }