1. A computer-implemented method for establishing a stream application, comprising: selecting a current optimization mode from a plurality of optimization modes based on at least one of a number of constraints, a type of each constraint, and a number of a plurality of compute nodes; selecting, by operation of one or more computer processors, a processing element from a plurality of processing elements in the stream application based on at least one processing element selection criteria; determining, based on one or more constraints, a plurality of candidate compute nodes to which the processing element can be allocated from among a plurality of compute nodes; selecting, based on at least one compute node selection criteria, a compute node from the candidate compute nodes, wherein at least one of the processing element selection criteria and the compute node selection criteria is determined by a current optimization mode for the stream application; and allocating the processing element to the selected compute node.