byte[] taskInBytes;
try {
taskInBytes = ThriftBinaryCodec.encode(task.newBuilder());
} catch (ThriftBinaryCodec.CodingException e) {
LOG.log(Level.SEVERE, "Unable to serialize task.", e);
throw new SchedulerException("Internal error.", e);
}
ITaskConfig config = task.getTask();
// TODO(wfarner): Re-evaluate if/why we need to continue handling unset assignedPorts field.
List<Resource> resources = Resources.from(config)