@Test(timeout=10000) public void testInterruptInMemory() throws Exception { final int FETCHER = 2; IFileWrappedMapOutput<Text,Text> immo = spy(new InMemoryMapOutput<Text,Text>( job, id, mm, 100, null, true)); when(mm.reserve(any(TaskAttemptID.class), anyLong(), anyInt()))
when(connection.getInputStream()).thenReturn(in); IFileWrappedMapOutput<Text,Text> mapOut = new InMemoryMapOutput<Text, Text>( job, map1ID, mm, 8, null, true ); IFileWrappedMapOutput<Text,Text> mapOut2 = new InMemoryMapOutput<Text, Text>( job, map2ID, mm, 10, null, true );
/** * Unconditional Reserve is used by the Memory-to-Memory thread * @return */ private synchronized InMemoryMapOutput<K, V> unconditionalReserve( TaskAttemptID mapId, long requestedSize, boolean primaryMapOutput) { usedMemory += requestedSize; return new InMemoryMapOutput<K,V>(jobConf, mapId, this, (int)requestedSize, codec, primaryMapOutput); }
/** * Unconditional Reserve is used by the Memory-to-Memory thread * @return */ private synchronized InMemoryMapOutput<K, V> unconditionalReserve( TaskAttemptID mapId, long requestedSize, boolean primaryMapOutput) { usedMemory += requestedSize; return new InMemoryMapOutput<K,V>(jobConf, mapId, this, (int)requestedSize, codec, primaryMapOutput); }
/** * Unconditional Reserve is used by the Memory-to-Memory thread * @return */ private synchronized InMemoryMapOutput<K, V> unconditionalReserve( TaskAttemptID mapId, long requestedSize, boolean primaryMapOutput) { usedMemory += requestedSize; return new InMemoryMapOutput<K,V>(jobConf, mapId, this, (int)requestedSize, codec, primaryMapOutput); }
/** * Unconditional Reserve is used by the Memory-to-Memory thread * @return */ private synchronized InMemoryMapOutput<K, V> unconditionalReserve( TaskAttemptID mapId, long requestedSize, boolean primaryMapOutput) { usedMemory += requestedSize; return new InMemoryMapOutput<K,V>(jobConf, mapId, this, (int)requestedSize, codec, primaryMapOutput); }
byte[] mapOutputBytes1 = writeMapOutput(conf, map1); byte[] mapOutputBytes2 = writeMapOutput(conf, map2); InMemoryMapOutput<Text, Text> mapOutput1 = new InMemoryMapOutput<Text, Text>( conf, mapId1, mergeManager, mapOutputBytes1.length, null, true); InMemoryMapOutput<Text, Text> mapOutput2 = new InMemoryMapOutput<Text, Text>( conf, mapId2, mergeManager, mapOutputBytes2.length, null, true); System.arraycopy(mapOutputBytes1, 0, mapOutput1.getMemory(), 0, byte[] mapOutputBytes3 = writeMapOutput(conf, map3); byte[] mapOutputBytes4 = writeMapOutput(conf, map4); InMemoryMapOutput<Text, Text> mapOutput3 = new InMemoryMapOutput<Text, Text>( conf, mapId3, mergeManager, mapOutputBytes3.length, null, true); InMemoryMapOutput<Text, Text> mapOutput4 = new InMemoryMapOutput<Text, Text>( conf, mapId4, mergeManager, mapOutputBytes4.length, null, true); System.arraycopy(mapOutputBytes3, 0, mapOutput3.getMemory(), 0,