Cassandra Statement Executor Component
The Cassandra Statement Executor component allows for the execution of DDL and DML statements as part of the execution of a blueprint. The component is configured with a Resource that defines the database the statements will be executed against, and a list of statements to execute.
Once all the statements have successfully executed, a SignalData object is output on the success output channel. If any of the statements fail, an error is reported on the error output channel. Since Cassandra doesn’t support transactions, an error may result in the execution of some of the statements.
The component is triggered either by a SignalData on the trigger input channel, or a SimpleMappedData on the queryParameters input channel. The trigger input channel will cause the statements to be executed exactly as provided. This is useful if the statements are fully specified and ready to execute. The queryParmaeters input channel will use the data inside the SimpleMappedData object to do substitutions into the statements before they are executed. The substitution process is the same as that used for the Cassandra Parameterized Reader.
Note: Because Cassandra propagates schema updates passively, it is possible that schema changes may not propagate through the Cassandra cluster before the deployment invokes subsequent components that rely on the updated schema. To avoid issues, there should be a delay between when the Statement Executor that modifies the schema is invoked, and any other Cassandra Readers or Writers that rely on the updated schema. This can be accomplished using a Delayed Trigger.
Input Channels
trigger — Receives a SignalData Object that causes the component to execute the statements exactly as specified.
queryParameters — Receives a SimpleMappedData Object and execute the statements after substituting values into the statements.
Output Channels
success — Returns a SignalData object to indicate that the statements were successfully executed.
error — Outputs an ErrorOutput object when an error occurs communicating with the database or executing the statements.
Parameters
resource — (CassandraResource) The resource defining the service to which this component should connect
statements — (String) The statements to execute when the component is invoked. Multiple statements are separated by semicolons. The statements may include placeholders that will be replaced with corresponding values from the SimpleMappedData input before execution. The parameter uses placeholders of the form :variable, where the name of the variable matches the name of an entry in the SimpleMappedData object received on the queryParameters input channel.
consistencyLevel — (String, default: ONE) The Consistency level to use when executing the query.
requestTimeout — (int, default: 2) Maximum time, in seconds, before the request times out.