Apache Cassandra is a distributed NoSQL database that delivers continuous availability, high performance, and linear scalability that an application requires for its success. The CassandraDB component will be used to perform CRUD operations on Apache Cassandra.

Configuration

Attributes

The figure below shows the CassandraDB configurable properties with the Expert Properties option enabled.

Icon

The following properties are expert properties useful for advanced users:

  • Pre Processing XSL Configuration
  • Post Processing XSL Configuration
  • Process Message Based on Property
  • Target Namespace
  • Threadpool Configuration
  • Connection Pool Configuration

Refer to the respective sections in the Common Configurations page 


Figure 1: CassandraDB Component Configuration CPS

Validate Input

This property determines whether the input message has to be validated against the schema defined on the input ports.

Refer to the Validate Input section in the Common Configurations page.

Error Handling Configuration

The remedial actions to be taken when a particular error occurs can be configured here.

Please refer to the Error Handling section in Common Configurations page for documentation.

Cassandra Connection Configuration

The component will need to connect to Cassandra Cluster to perform operations on Cassandra. In this panel, the following details need to be provided to connect to Cassandra Cluster.


Figure 2: CassandraDB Connection Configuration dialog box

Access Point

The IP address of the system where Cassandra server is running.

Port

Port number of the cassandra running service.

Keyspace

Cluster name where the cassandra column family exists(Tables).

Cassandra Operation Configuration

In this panel, multiple configurations can be added/modified with each configuration pertaining to one query type.


Figure 3: CassandraDB Operation Configuration dialog box

Types of operations that can be configured are listed and explained below:

  • Insert
  • Select
  • Update
  • Delete


Figure 4: CassandraDB Operation types highlighted

Each operation configuration will have a query name followed by required fields which vary according to the query type.

Insert

Helps to insert column values to the table specified.

  • Select a table: Name of the table to insert the column values.
  • Specify Columns to Insert: When enabled, helps to specify the required columns to insert values.


Figure 5: INSERT Operation type options with sample values

Select

Helps to retrieve results set from a table as XML output or in JSON format.

  • Select a table: Name of the table to select the column values.
  • Specify Columns to Select: To specify the required columns to be retrieved from the table.
  • Specify Order Clause: To retrieve and sort column values in asc/desc order based on the column name selected.
  • Specify Group Clause: To group rows at the partition key level or at a clustering column level based on the column selected.(Accepts only primary key column names)
  • Specify Limit Clause: To limit the number of rows returned by a query. Accepts integer value.
  • Get JSON String as Output: Returns the select operation query output as JSON String or else will return XML output.
  • Specify Where Clause: To specify WHERE clause details. It helps to maximize read efficiency by identifying the location of the data. A WHERE clause details has three parts :
  • Column Name: Name of the column to specify the WHERE condition.
  • Column Type: Type of the column to provide the value at run time.
  • Operators: =, >=, >, <, <=, IN, Contains, Contains Key.
Icon

Contains and Contains key are used only for complex data types like Sets, Lists and Map.


Figure 6: SELECT Operation type options with sample values

Update 

Modifies one or more column values to a row in a table.

  • Select a table: Name of the table to Update the column values.
  • Specify Columns to Update: To specify the required columns to be modified in the table.
  • Specify Where Clause: To specify WHERE clause details. The WHERE clause specifies the row or rows to be updated. To specify a row, the WHERE clause must provide a value for each column of the row's primary key. To specify more than one row, you can use the IN keyword to introduce a list of possible values.

- A WHERE clause details has three parts :

  • Column Name: To specify in the WHERE condition
  • Column Type: Type of the column to provide the value at run time.
  • Operators : =, >=, >, <, <=, IN, Contains, Contains Key.
Icon

Contains and Contains key are used only for complex data types like Sets, Lists and Map.

  • Specify If Exist Clause: To validate before executing the query. One or more rows must match the query. If no rows match, the statement fails
  • Specify If Clause: To Test non-primary key columns on rows that match the query. Applies the update to rows that return true. If no rows match the query and the conditional statement tests for NULL, a new record is inserted. It has three parts namely:
  • Column NameName of the column to specify in If condition
  • Column Type: Type of the column to provide the value at run time.
  • Operators : =, >=, >, <, <=, IN, Contains, Contains Key.


Figure 7: UPDATE Operation type options with sample values

Delete

Removes data from one or more selected columns (data is replaced with null) or removes the entire row when no column is specified.

  • Select a table: Name of the table to Delete the column values.
  • Specify Columns to Delete: To specify the required columns to be deleted in the table.
  • Specify If Exist Clause: When enabled, it ensures that an operation is not performed if the specified row does not exist
  • Specify If Clause: To provide If Conditions. The IF condition limits the WHERE clause, allowing selection based on values in non-PRIMARY KEY columns. It has three parts namely:
  • Column Name: Name of the column to specify in the IF condition
  • Column Type: Type of the column to provide the value at run time.
  • Operators : =, >=, >, <, <=, IN, Contains, Contains Key
  • Specify Where Clause: When enabled helps to specify WHERE clause details. The WHERE clause specifies which row or rows to delete from a specified table.

- A WHERE clause details has three parts :

  • Column Name: Name of the column to specify in the WHERE condition
  • Column Type: Type of the column to provide the value at run time.
  • Operators : =, >=, >, <, <=, IN, Contains, Contains Key.
Icon
  • Contains and Contains key are used only for complex data types like Sets, Lists and Map. 
  • The IF Exist and IF Clauses can only be used along with the WHERE clause statement and cannot be used independently in UPDATE and DELETE operations.


Figure 8: DELETE Operation type options with sample values

Functional Demonstration

Connect Feeder and Display components to CassandraDB and configure each operation as set in the respective sections above with the inputs provided the samples below.

Icon

Each operation configured in the Operation Configuration panel generates its corresponding ports as well.


Figure 9: CassandraDB sample event process

Scenario 1 - SELECT operation

Input

Input XML Schema


Figure 10: Schema for SELECT input XML 

Configuration for XML output

Select a table and specify columns to select.


Figure 11: SELECT input configuration for XML output

XML Output


Figure 12: XML output

Configuration for JSON output

Enable the Get JSON String as Output property retaining the other properties as above (configuration for XML output).


Figure 13: SELECT input configuration for JSON output

JSON Output

Figure 14: JSON output

Scenario 2 - INSERT operation

Input

Output


Figure 15: Output message for INSERT operation

Scenario 3 - UPDATE operation

Input

Output


Figure 16: Output message for UPDATE operation

Scenario 4 - DELETE operation

Input

Output


Figure 17: Output message for DELETE operation

Adaptavist ThemeBuilder EngineAtlassian Confluence