1. A method for managing a template on an operator graph, comprising: receiving the template for processing a stream of tuples, the template having a plurality of template elements operating on one or more computer processors; calculating a resource requirement of a template element from the template; calculating a resource availability of a virtual machine; allocating the template onto the operator graph, the operator graph having a plurality of processing elements operating on one or more computer processors; mapping the template element from the template onto the virtual machine as a function of the resource requirement of the template element and the resource availability of the virtual machine.