Patent ID: 8521867

Claim:
A method implemented in a computer for processing a plurality of streams of data, the method comprising: processing the plurality of streams, to execute thereon a plurality of continuous queries based on a global plan; receiving a command to register a user-defined aggregation and an identification of a set of instructions comprising a function to be executed to perform the user-defined aggregation over multiple tuples of the data in messages received from the plurality of streams; creating in a memory of the computer, a first structure comprising said identification of the set of instructions; receiving a new continuous query comprising the user-defined aggregation; during execution of the new continuous query: creating in the memory, an instance of said function to be executed to perform the user-defined aggregation, by using the identification in the first structure in response to receipt of a message from the plurality of streams; invoking within said instance created in response to receipt of the message, the function to perform the user-defined aggregation to process a tuple of the data in the message; continuing to execute the new continuous query, by performing the invoking and skipping the creating, in response to receipt of an additional message from the plurality of streams; and outputting from said computer, a stream based on results including a result generated based at least partially on processing of said tuple of the data by executing the new continuous query.