// optimize only B's input spec since it is immediately following a store
// and is conducive to optimization. At this point we clone and make
// sure only B's "command" gets optimized while C's "command" remains
// untouched.
StreamingCommand optimizedCommand = (StreamingCommand)command.clone();
if (handle == Handle.INPUT) {
HandleSpec streamInputSpec = optimizedCommand.getInputSpec();
streamInputSpec.setSpec(spec);
} else if (handle == Handle.OUTPUT) {
HandleSpec streamOutputSpec = optimizedCommand.getOutputSpec();
streamOutputSpec.setSpec(spec);
}
command = optimizedCommand;
}