@Test(expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = ".*amount of " + Constants.GPUS + ".*requested exceeds.*") public void testValidateTonyConfTooManyGpus() { Configuration conf = new Configuration(); conf.setInt(TonyConfigurationKeys.getResourceKey(Constants.WORKER_JOB_NAME, Constants.GPUS), 1); conf.setInt(TonyConfigurationKeys.getInstancesKey(Constants.WORKER_JOB_NAME), 10); conf.setInt(TonyConfigurationKeys.getMaxTotalResourceKey(Constants.GPUS), 5); TonyClient.validateTonyConf(conf); }
@VisibleForTesting static void validateTonyConf(Configuration tonyConf) { enforceTaskInstanceLimits(tonyConf); enforceResourceLimits(tonyConf); }
TonyClient implements AutoCloseable { @VisibleForTesting static void validateTonyConf(Configuration tonyConf) { enforceTaskInstanceLimits(tonyConf); enforceResourceLimits(tonyConf); } }
TonyClient implements AutoCloseable { @VisibleForTesting static void validateTonyConf(Configuration tonyConf) { enforceTaskInstanceLimits(tonyConf); enforceResourceLimits(tonyConf); } TonyClient();  TonyClient(Configuration conf);  TonyClient(CallbackHandler handler, Configuration conf); }
TonyClient implements AutoCloseable { @VisibleForTesting static void validateTonyConf(Configuration tonyConf) { enforceTaskInstanceLimits(tonyConf); enforceResourceLimits(tonyConf); } TonyClient();  TonyClient(Configuration conf);  TonyClient(CallbackHandler handler, Configuration conf); @VisibleForTesting String processFinalTonyConf(); @VisibleForTesting void submitApplication(ApplicationSubmissionContext appContext); boolean init(String[] args); void initTonyConf(Configuration tonyConf, CommandLine cliParser); @VisibleForTesting void processTonyConfResources(Configuration tonyConf, FileSystem fs); Configuration getTonyConf(); ContainerLaunchContext createAMContainerSpec(long amMemory, ByteBuffer tokens); @VisibleForTesting boolean monitorApplication(); void forceKillApplication(); @VisibleForTesting CopyOnWriteArrayList<TaskUpdateListener> getListener(); @Override void close(); @VisibleForTesting int start(); static String getRmPrincipal(Configuration conf); static String getRmPrincipal(String rmPrincipal, Configuration conf); void addListener(TaskUpdateListener listener); void removeListener(TaskUpdateListener listener); static void main(String[] args); }
TonyClient implements AutoCloseable { @VisibleForTesting static void validateTonyConf(Configuration tonyConf) { enforceTaskInstanceLimits(tonyConf); enforceResourceLimits(tonyConf); } TonyClient();  TonyClient(Configuration conf);  TonyClient(CallbackHandler handler, Configuration conf); @VisibleForTesting String processFinalTonyConf(); @VisibleForTesting void submitApplication(ApplicationSubmissionContext appContext); boolean init(String[] args); void initTonyConf(Configuration tonyConf, CommandLine cliParser); @VisibleForTesting void processTonyConfResources(Configuration tonyConf, FileSystem fs); Configuration getTonyConf(); ContainerLaunchContext createAMContainerSpec(long amMemory, ByteBuffer tokens); @VisibleForTesting boolean monitorApplication(); void forceKillApplication(); @VisibleForTesting CopyOnWriteArrayList<TaskUpdateListener> getListener(); @Override void close(); @VisibleForTesting int start(); static String getRmPrincipal(Configuration conf); static String getRmPrincipal(String rmPrincipal, Configuration conf); void addListener(TaskUpdateListener listener); void removeListener(TaskUpdateListener listener); static void main(String[] args);  }