Specifications
Application Development CHAPTER 8 151
Server database must adapt to the schema of the table that it queries. Instead, you provide
the table schema in a conguration specication when the adapter is bound to the query.
Conversely, an untyped output adapter receives the event type description, which contains
a list of elds, when the query starts. The untyped output adapter must then map the event
type to the schema of the destination data source, typically in a conguration specication.
Adapters
Input and output adapters provide transformation interfaces between event sources, event
consumers, and the CEP server. Event sources can push events to event consumers, or event
consumers can pull events from event sources. Either way, the CEP application operates
between these two points and intercepts the events for processing. The input adapter reads
events from the source, transforms them into a format recognizable by the CEP server, and
provides the transformed events to a standing query. As the CEP server processes the event
stream, the output adapter receives the resulting new events, transforms them for the event
consumers, and then delivers the transformed events.
Before you can begin developing an adapter, you must know whether you are building
an input or output adapter. You must also know the event type, which in this context means
you must understand the structure of the event payload and how the application timestamps
affect stream processing. The .NET class or structure of the event type provides you with
information about the event payload if you are building a typed adapter. The information
necessary for the management of stream processing, known as event metadata, comes from
an interface in the adapter API when it creates an event. In addition to knowing the event
payload and event metadata, you must also know whether the shape of the event is a point,
interval, or edge model. Having this information available allows you to choose the applicable
base class. The adapter base classes are listed in Table 8-1.
TABLE 8-1 Adapter base classes
ADAPTER TYPE
AND EVENT MODEL
INPUT ADAPTER
BASE CLASS
OUTPUT ADAPTER
BASE CLASS
Typed point TypedPointInputAdapter TypedPointOutputAdapter
Untyped point PointInputAdapter PointOutputAdapter
Typed interval TypedIntervalInputAdapter TypedIntervalOutputAdapter
Untyped interval IntervalInputAdapter IntervalOutputAdapter
Typed edge TypedEdgeInputAdapter TypedEdgeOutputAdapter
Untyped edge EdgeInputAdapter EdgeOutputAdapter
If you are developing an untyped input adapter, you must ensure that it can use the con-
guration specication during query bind time to determine the event’s eld types by infer-
ence from the query’s SELECT statement. You must also add code to the adapter to populate