Sybase CEP Studio and Files

Questions and answers about Sybase CEP Studio and about data organization within Sybase CEP applications. Discusses Sybase CEP Studio and Sybase CEP Project functionality, the CCL module, workspaces, and so on.

Questions


What is Sybase CEP Studio?

Sybase CEP Studio is a User Interface application that lets users create streams and stream schemas, develop CCL queries, organize them into query modules and projects, compile and load projects into workspaces, load adapters, view streams at run-time, and so on.

What is a Sybase CEP Project?

Projects contain reusable groups of CCL queries (query modules), combined with one or more data streams and adapters. Every project includes at least one query module, which may contain one or more submodules. Projects must be loaded into a workspace for editing and execution, and, once loaded, appear under one of the workspaces in the Sybase CEP Studio. Project definition information is stored in a file with the extension .ccp, while query module code is stored in a file with the extension .ccl. After being compiled, projects are translated into a low-level language that can be executed by the Sybase CEP Server. The resulting .ccx files are not visible in Studio, but are executed when a project is started.

Note: Once projects are started, they keep running until either explicitly stopped, or the Sybase CEP Server on which they are running is shut down. Projects do not stop running when simply disconnected from the workspace or the Studio is closed.

What is a CCL Module?

In its simplest form, a CCL query module is just a collection of CCL queries. CCL modules make it easy to organize queries into logical units, and also to organize a large application into easily manageable parts. Every Sybase CEP project contains at least one main query module, which may contain additional submodules. Query module code is stored in a file with the extension .ccl.

Can modules be parameterized and reused?

Yes, a module may optionally be parameterized with any of the following:


For example, if developing a module that takes in a stream from an RFID reader, and counts the number of readings per unit of time, the module could look like this:

INSERT INTO RFIDCounts 
SELECT Count(*) 
FROM RFIDRaw KEEP 10 SEC 
OUTPUT EVERY 10 SEC;

This module hard-codes the names of the streams, as well as the parameter 10 SEC . But what if somebody wants to use this module with other input and output streams, and with a different interval? In this case, it is possible to define an interface to this module, consisting of formal input streams InRFIDRaw and OutRFIDCounts, and a parameter Duration. Then the query can be rewritten as:

INSERT INTO OutRFIDCounts 
SELECT Count(*) 
FROM InRFIDRaw KEEP $Duration SEC 
OUTPUT EVERY $Duration SEC;
Note:
  • Formal input and output stream names do not use the dollar sign character ($) but scalars do.

  • Parameters are specified in the Parameters tab for the module.

  • When a project containing the module is loaded, the connections for the stream and values for scalar parameters are specified in the Bindings tab.

  • The notion of formal names and connections is modeled on how parameters are passed to functions in any high-level language like C++ or Java. Each function declares formal parameters and uses them. When the function is called, the caller binds actual values (in this case called connections) to the formal values.

CCL goes far beyond SQL in its concepts of modules and parameterized modules. Unlike CCL, SQL does not let you create a set of queries and then apply them to different tables.

What is a Workspace?

Workspaces are used to isolate different users or projects from one another within the Sybase CEP Engine. You and/or your system administrator decide exactly how many workspaces to use and how to use these. For example, you may decide that each user should get their own workspace, and that there should be a shared test workspace, a production workspace, and so on. By default, each Sybase CEP environment comes with one enabled workspace. This workspace is called Default. The Sybase CEP Studio allows you to create and destroy workspaces, and to connect or disconnect from workspaces. You may connect to a single workspace, or to multiple workspaces, running on the same or different Servers. For more information about working with workspaces in Studio, please see the Sybase CEP Studio Guide.

What is an Environment?

An environment contains the list of workspaces to which Studio users are connected. The environment configuration is stored in a .cce file. An environment is strictly a Studio feature, and does not exist on the Server. If you close Studio and then reopen it, it opens to the same environment, containing the same workspaces as it did before it was last closed.

How can I view streams to debug my application?

The Sybase CEP Studio allows you to view every stream in the system, including streams connected to main modules, or their submodules, input and output streams and so on. For instructions on viewing a stream, please see the Sybase CEP Studio Guide. A debugging feature is also available in the stream viewer. This feature allows you to "step through" the rows in a stream and determine what other rows in other streams arrived at the same time, or shortly before or after, the selected row. Debugging features are also discussed in the Sybase CEP Studio Guide.

How do I know whether a project is running if I don't open a stream viewer?

Look at the icon to determine the status of a project (a project contains your query or a submodule with your query). When the project is not running, its icon looks like this: . When the project is running with no problems, the icon looks like this: . If the project encounters a problem, its icon looks like this: . If a project is not running properly, select it, and look at the Studio Status View and Output View for information about its status. The Status View shows the project's status, while the Output View lists any errors encountered by the project.

What kinds of files does Sybase CEP Engine use and where are they located?

Sybase CEP uses several kinds of files:


.ccp, .ccl, and .ccs files reside on the same machine as your Sybase CEP Studio installation. These files may be checked into a source control system, if desired. The files are compiled by Sybase CEP Studio and sent to the Server automatically when you run a project.

Sybase CEP also uses two other kinds of files, although you do not need to modify these files in any way under normal circumstances.



Created March 8, 2010. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com