flink 参数之 -yn and -p

-yn  container , also known as task manager count.

-p, parallelism , it is the count the job be divided into.  the count of subtask.


please see following code:

when set the -p, whatever, flink run will popup a message. "but the ...."

// convenience
  int userParallelism = Integer.valueOf(cmd.getOptionValue(CliFrontendParser.PARALLELISM_OPTION.getOpt(),"-1"));
  int maxSlots = slotsPerTaskManager * numberTaskManagers;
  if (userParallelism != -1) {
  int slotsPerTM = (int) Math.ceil((double) userParallelism/ numberTaskManagers);
  String message = "The YARN cluster has" + maxSlots + " slots available, " +
  "but the user requested a parallelism of" + userParallelism +" on YARN." +
  "Each of the" + numberTaskManagers +" TaskManagers" +
  "will get" + slotsPerTM + " slots.";
  logAndSysout(message);
  slotsPerTaskManager = slotsPerTM;
  }

你可能感兴趣的:(flink 参数之 -yn and -p)