def get_commands_to_run(self):
<EOL>if len(self.packing_plan.container_plans) == <NUM_LIT:0>:<EOL><INDENT>return {}<EOL><DEDENT>if self._get_instance_plans(self.packing_plan, self.shard) is None and self.shard != <NUM_LIT:0>:<EOL><INDENT>retval = {}<EOL>retval['<STR_LIT>'] = Command([<EOL>'<STR_LIT:%s>' % self.heron_shell_binary,<EOL>'<STR_LIT>' % self.shell_port,<EOL>'<STR_LIT>' % (self.log_dir, self.shard),<EOL>'<STR_LIT>' % self.topology_id], self.shell_env)<EOL>return retval<EOL><DEDENT>if self.shard == <NUM_LIT:0>:<EOL><INDENT>commands = self._get_tmaster_processes()<EOL><DEDENT>else:<EOL><INDENT>self._untar_if_needed()<EOL>commands = self._get_streaming_processes()<EOL><DEDENT>commands.update(self._get_heron_support_processes())<EOL>return commands<EOL>
Prepare either TMaster or Streaming commands according to shard.
The Shell command is attached to all containers. The empty container plan and non-exist
container plan are bypassed.