Index: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestWindowsBasedProcessTree.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestWindowsBasedProcessTree.java (date 1489606102000) +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestWindowsBasedProcessTree.java (revision ) @@ -56,13 +56,9 @@ pTree.infoStr = "3524,1024,1024,500\r\n2844,1024,1024,500\r\n"; pTree.updateProcessTree(); assertTrue(pTree.getVirtualMemorySize() == 2048); - assertTrue(pTree.getCumulativeVmem() == 2048); assertTrue(pTree.getVirtualMemorySize(0) == 2048); - assertTrue(pTree.getCumulativeVmem(0) == 2048); assertTrue(pTree.getRssMemorySize() == 2048); - assertTrue(pTree.getCumulativeRssmem() == 2048); assertTrue(pTree.getRssMemorySize(0) == 2048); - assertTrue(pTree.getCumulativeRssmem(0) == 2048); assertTrue(pTree.getCumulativeCpuTime() == 1000); assertTrue(pTree.getCpuUsagePercent() == ResourceCalculatorProcessTree.UNAVAILABLE); @@ -71,13 +67,9 @@ testClock.setTime(elapsedTimeBetweenUpdatesMsec); pTree.updateProcessTree(); assertTrue(pTree.getVirtualMemorySize() == 3072); - assertTrue(pTree.getCumulativeVmem() == 3072); assertTrue(pTree.getVirtualMemorySize(1) == 2048); - assertTrue(pTree.getCumulativeVmem(1) == 2048); assertTrue(pTree.getRssMemorySize() == 3072); - assertTrue(pTree.getCumulativeRssmem() == 3072); assertTrue(pTree.getRssMemorySize(1) == 2048); - assertTrue(pTree.getCumulativeRssmem(1) == 2048); assertTrue(pTree.getCumulativeCpuTime() == 3000); assertTrue(pTree.getCpuUsagePercent() == 200); Assert.assertEquals("Percent CPU time is not correct", @@ -88,13 +80,9 @@ testClock.setTime(elapsedTimeBetweenUpdatesMsec); pTree.updateProcessTree(); assertTrue(pTree.getVirtualMemorySize() == 2048); - assertTrue(pTree.getCumulativeVmem() == 2048); assertTrue(pTree.getVirtualMemorySize(2) == 2048); - assertTrue(pTree.getCumulativeVmem(2) == 2048); assertTrue(pTree.getRssMemorySize() == 2048); - assertTrue(pTree.getCumulativeRssmem() == 2048); assertTrue(pTree.getRssMemorySize(2) == 2048); - assertTrue(pTree.getCumulativeRssmem(2) == 2048); assertTrue(pTree.getCumulativeCpuTime() == 4000); Assert.assertEquals("Percent CPU time is not correct", pTree.getCpuUsagePercent(), 0, 0.01); Index: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/ResourceCalculatorProcessTree.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/ResourceCalculatorProcessTree.java (date 1489606102000) +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/ResourceCalculatorProcessTree.java (revision ) @@ -79,18 +79,6 @@ return getVirtualMemorySize(0); } - /** - * Get the virtual memory used by all the processes in the - * process-tree. - * - * @return virtual memory used by the process-tree in bytes, - * {@link #UNAVAILABLE} if it cannot be calculated. - */ - @Deprecated - public long getCumulativeVmem() { - return getCumulativeVmem(0); - } - /** * Get the resident set size (rss) memory used by all the processes * in the process-tree. @@ -102,18 +90,6 @@ return getRssMemorySize(0); } - /** - * Get the resident set size (rss) memory used by all the processes - * in the process-tree. - * - * @return rss memory used by the process-tree in bytes, - * {@link #UNAVAILABLE} if it cannot be calculated. - */ - @Deprecated - public long getCumulativeRssmem() { - return getCumulativeRssmem(0); - } - /** * Get the virtual memory used by all the processes in the * process-tree that are older than the passed in age. @@ -128,21 +104,6 @@ return UNAVAILABLE; } - /** - * Get the virtual memory used by all the processes in the - * process-tree that are older than the passed in age. - * - * @param olderThanAge processes above this age are included in the - * memory addition - * @return virtual memory used by the process-tree in bytes for - * processes older than the specified age, {@link #UNAVAILABLE} if it - * cannot be calculated. - */ - @Deprecated - public long getCumulativeVmem(int olderThanAge) { - return UNAVAILABLE; - } - /** * Get the resident set size (rss) memory used by all the processes * in the process-tree that are older than the passed in age. @@ -156,21 +117,6 @@ public long getRssMemorySize(int olderThanAge) { return UNAVAILABLE; } - - /** - * Get the resident set size (rss) memory used by all the processes - * in the process-tree that are older than the passed in age. - * - * @param olderThanAge processes above this age are included in the - * memory addition - * @return rss memory used by the process-tree in bytes for - * processes older than specified age, {@link #UNAVAILABLE} if it cannot be - * calculated. - */ - @Deprecated - public long getCumulativeRssmem(int olderThanAge) { - return UNAVAILABLE; - } /** * Get the CPU time in millisecond used by all the processes in the Index: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/ProcfsBasedProcessTree.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/ProcfsBasedProcessTree.java (date 1489606102000) +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/ProcfsBasedProcessTree.java (revision ) @@ -341,12 +341,6 @@ return total; } - @Override - @SuppressWarnings("deprecation") - public long getCumulativeVmem(int olderThanAge) { - return getVirtualMemorySize(olderThanAge); - } - @Override public long getRssMemorySize(int olderThanAge) { if (PAGE_SIZE < 0) { @@ -368,12 +362,6 @@ return isAvailable ? totalPages * PAGE_SIZE : UNAVAILABLE; // convert # pages to byte } - @Override - @SuppressWarnings("deprecation") - public long getCumulativeRssmem(int olderThanAge) { - return getRssMemorySize(olderThanAge); - } - /** * Get the resident set size (RSS) memory used by all the processes * in the process-tree that are older than the passed in age. RSS is Index: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/WindowsBasedProcessTree.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/WindowsBasedProcessTree.java (date 1489606102000) +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/WindowsBasedProcessTree.java (revision ) @@ -214,12 +214,6 @@ return total; } - @Override - @SuppressWarnings("deprecation") - public long getCumulativeVmem(int olderThanAge) { - return getVirtualMemorySize(olderThanAge); - } - @Override public long getRssMemorySize(int olderThanAge) { long total = UNAVAILABLE; @@ -236,12 +230,6 @@ return total; } - @Override - @SuppressWarnings("deprecation") - public long getCumulativeRssmem(int olderThanAge) { - return getRssMemorySize(olderThanAge); - } - @Override public long getCumulativeCpuTime() { for (ProcessInfo p : processTree.values()) { Index: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestProcfsBasedProcessTree.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestProcfsBasedProcessTree.java (date 1489606102000) +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/test/java/org/apache/hadoop/yarn/util/TestProcfsBasedProcessTree.java (revision ) @@ -236,10 +236,6 @@ "vmem for the gone-process is " + p.getVirtualMemorySize() + " . It should be UNAVAILABLE(-1).", p.getVirtualMemorySize() == UNAVAILABLE); - Assert.assertTrue( - "vmem (old API) for the gone-process is " + p.getCumulativeVmem() - + " . It should be UNAVAILABLE(-1).", - p.getCumulativeVmem() == UNAVAILABLE); Assert.assertTrue(p.toString().equals("[ ]")); } @@ -456,9 +452,6 @@ ResourceCalculatorProcessTree.UNAVAILABLE; Assert.assertEquals("rss memory does not match", cumuRssMem, processTree.getRssMemorySize()); - // verify old API - Assert.assertEquals("rss memory (old API) does not match", cumuRssMem, - processTree.getCumulativeRssmem()); // verify cumulative cpu time long cumuCpuTime = @@ -477,9 +470,6 @@ // anon (exclude r-xs,r--s) Assert.assertEquals("rss memory does not match", (20 * KB_TO_BYTES * 3), processTree.getRssMemorySize()); - // verify old API - Assert.assertEquals("rss memory (old API) does not match", - (20 * KB_TO_BYTES * 3), processTree.getCumulativeRssmem()); // test the cpu time again to see if it cumulates procInfos[0] = @@ -589,8 +579,6 @@ // verify virtual memory Assert.assertEquals("Virtual memory does not match", 700000L, processTree.getVirtualMemorySize()); - Assert.assertEquals("Virtual memory (old API) does not match", 700000L, - processTree.getCumulativeVmem()); // write one more process as child of 100. String[] newPids = { "500" }; @@ -609,8 +597,6 @@ processTree.updateProcessTree(); Assert.assertEquals("vmem does not include new process", 1200000L, processTree.getVirtualMemorySize()); - Assert.assertEquals("vmem (old API) does not include new process", - 1200000L, processTree.getCumulativeVmem()); if (!smapEnabled) { long cumuRssMem = ProcfsBasedProcessTree.PAGE_SIZE > 0 @@ -618,25 +604,15 @@ ResourceCalculatorProcessTree.UNAVAILABLE; Assert.assertEquals("rssmem does not include new process", cumuRssMem, processTree.getRssMemorySize()); - // verify old API - Assert.assertEquals("rssmem (old API) does not include new process", - cumuRssMem, processTree.getCumulativeRssmem()); } else { Assert.assertEquals("rssmem does not include new process", 20 * KB_TO_BYTES * 4, processTree.getRssMemorySize()); - // verify old API - Assert.assertEquals("rssmem (old API) does not include new process", - 20 * KB_TO_BYTES * 4, processTree.getCumulativeRssmem()); } // however processes older than 1 iteration will retain the older value Assert.assertEquals( "vmem shouldn't have included new process", 700000L, processTree.getVirtualMemorySize(1)); - // verify old API - Assert.assertEquals( - "vmem (old API) shouldn't have included new process", 700000L, - processTree.getCumulativeVmem(1)); if (!smapEnabled) { long cumuRssMem = ProcfsBasedProcessTree.PAGE_SIZE > 0 @@ -645,18 +621,10 @@ Assert.assertEquals( "rssmem shouldn't have included new process", cumuRssMem, processTree.getRssMemorySize(1)); - // Verify old API - Assert.assertEquals( - "rssmem (old API) shouldn't have included new process", cumuRssMem, - processTree.getCumulativeRssmem(1)); } else { Assert.assertEquals( "rssmem shouldn't have included new process", 20 * KB_TO_BYTES * 3, processTree.getRssMemorySize(1)); - // Verify old API - Assert.assertEquals( - "rssmem (old API) shouldn't have included new process", - 20 * KB_TO_BYTES * 3, processTree.getCumulativeRssmem(1)); } // one more process @@ -679,10 +647,6 @@ Assert.assertEquals( "vmem shouldn't have included new processes", 700000L, processTree.getVirtualMemorySize(2)); - // verify old API - Assert.assertEquals( - "vmem (old API) shouldn't have included new processes", 700000L, - processTree.getCumulativeVmem(2)); if (!smapEnabled) { long cumuRssMem = ProcfsBasedProcessTree.PAGE_SIZE > 0 @@ -691,18 +655,10 @@ Assert.assertEquals( "rssmem shouldn't have included new processes", cumuRssMem, processTree.getRssMemorySize(2)); - // Verify old API - Assert.assertEquals( - "rssmem (old API) shouldn't have included new processes", - cumuRssMem, processTree.getCumulativeRssmem(2)); } else { Assert.assertEquals( "rssmem shouldn't have included new processes", 20 * KB_TO_BYTES * 3, processTree.getRssMemorySize(2)); - // Verify old API - Assert.assertEquals( - "rssmem (old API) shouldn't have included new processes", - 20 * KB_TO_BYTES * 3, processTree.getCumulativeRssmem(2)); } // processes older than 1 iteration should not include new process, @@ -710,10 +666,6 @@ Assert.assertEquals( "vmem shouldn't have included new processes", 1200000L, processTree.getVirtualMemorySize(1)); - // verify old API - Assert.assertEquals( - "vmem (old API) shouldn't have included new processes", 1200000L, - processTree.getCumulativeVmem(1)); if (!smapEnabled) { long cumuRssMem = ProcfsBasedProcessTree.PAGE_SIZE > 0 @@ -722,34 +674,19 @@ Assert.assertEquals( "rssmem shouldn't have included new processes", cumuRssMem, processTree.getRssMemorySize(1)); - // verify old API - Assert.assertEquals( - "rssmem (old API) shouldn't have included new processes", - cumuRssMem, processTree.getCumulativeRssmem(1)); } else { Assert.assertEquals( "rssmem shouldn't have included new processes", 20 * KB_TO_BYTES * 4, processTree.getRssMemorySize(1)); - Assert.assertEquals( - "rssmem (old API) shouldn't have included new processes", - 20 * KB_TO_BYTES * 4, processTree.getCumulativeRssmem(1)); } // no processes older than 3 iterations Assert.assertEquals( "Getting non-zero vmem for processes older than 3 iterations", 0, processTree.getVirtualMemorySize(3)); - // verify old API - Assert.assertEquals( - "Getting non-zero vmem (old API) for processes older than 3 iterations", - 0, processTree.getCumulativeVmem(3)); Assert.assertEquals( "Getting non-zero rssmem for processes older than 3 iterations", 0, processTree.getRssMemorySize(3)); - // verify old API - Assert.assertEquals( - "Getting non-zero rssmem (old API) for processes older than 3 iterations", - 0, processTree.getCumulativeRssmem(3)); } finally { FileUtil.fullyDelete(procfsRootDir); }