@Test public void testClassIdFileContentParsing() { conf.setBoolean(YarnConfiguration.NM_RECOVERY_ENABLED, false); TrafficController trafficController = new TrafficController(conf, privilegedOperationExecutorMock); int parsedClassId = trafficController.getClassIdFromFileContents (TEST_CLASS_ID_DECIMAL_STR); Assert.assertEquals(TEST_CLASS_ID, parsedClassId); }
public int getClassIdFromFileContents(String input) { String classIdStr = String.format("%08x", Integer.parseInt(input)); if (LOG.isDebugEnabled()) { LOG.debug("ClassId hex string : " + classIdStr); } return Integer.parseInt(classIdStr.substring(4)); }
TrafficController { public int getClassIdFromFileContents(String input) { String classIdStr = String.format("%08x", Integer.parseInt(input)); if (LOG.isDebugEnabled()) { LOG.debug("ClassId hex string : " + classIdStr); } return Integer.parseInt(classIdStr.substring(4)); } }
TrafficController { public int getClassIdFromFileContents(String input) { String classIdStr = String.format("%08x", Integer.parseInt(input)); if (LOG.isDebugEnabled()) { LOG.debug("ClassId hex string : " + classIdStr); } return Integer.parseInt(classIdStr.substring(4)); } TrafficController(Configuration conf, PrivilegedOperationExecutor exec); }
TrafficController { public int getClassIdFromFileContents(String input) { String classIdStr = String.format("%08x", Integer.parseInt(input)); if (LOG.isDebugEnabled()) { LOG.debug("ClassId hex string : " + classIdStr); } return Integer.parseInt(classIdStr.substring(4)); } TrafficController(Configuration conf, PrivilegedOperationExecutor exec); void bootstrap(String device, int rootBandwidthMbit, int
      yarnBandwidthMbit, int containerBandwidthMbit, boolean strictMode); Map<Integer, Integer> readStats(); int getNextClassId(); void releaseClassId(int classId); String getStringForNetClsClassId(int classId); int getClassIdFromFileContents(String input); }
TrafficController { public int getClassIdFromFileContents(String input) { String classIdStr = String.format("%08x", Integer.parseInt(input)); if (LOG.isDebugEnabled()) { LOG.debug("ClassId hex string : " + classIdStr); } return Integer.parseInt(classIdStr.substring(4)); } TrafficController(Configuration conf, PrivilegedOperationExecutor exec); void bootstrap(String device, int rootBandwidthMbit, int
      yarnBandwidthMbit, int containerBandwidthMbit, boolean strictMode); Map<Integer, Integer> readStats(); int getNextClassId(); void releaseClassId(int classId); String getStringForNetClsClassId(int classId); int getClassIdFromFileContents(String input);  }