PutCassandraRecord

Deprecation notice:

DataStax 3 driver for Cassandra is no longer the current version and requires new components.

Please consider using one the following alternatives: No alternative components suggested.

Description:

This is a record aware processor that reads the content of the incoming FlowFile as individual records using the configured 'Record Reader' and writes them to Apache Cassandra using native protocol version 3 or higher.

Tags:

cassandra, cql, put, insert, update, set, record

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
Cassandra Connection Providercassandra-connection-providerController Service API:
CassandraSessionProviderService
Implementation: CassandraSessionProvider
Specifies the Cassandra connection providing controller service to be used to connect to Cassandra cluster.
Cassandra Contact PointsCassandra Contact PointsContact points are addresses of Cassandra nodes. The list of contact points should be comma-separated and in hostname:port format. Example node1:port,node2:port,.... The default client port for Cassandra is 9042, but the port(s) must be explicitly specified.
Supports Expression Language: true (will be evaluated using variable registry only)
KeyspaceKeyspaceThe Cassandra Keyspace to connect to. If no keyspace is specified, the query will need to include the keyspace name before any table reference, in case of 'query' native processors or if the processor exposes the 'Table' property, the keyspace name has to be provided with the table name in the form of <KEYSPACE>.<TABLE>
Supports Expression Language: true (will be evaluated using variable registry only)
Table nameput-cassandra-record-tableThe name of the Cassandra table to which the records have to be written.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Statement Typeput-cassandra-record-statement-typeINSERT
  • UPDATE Use an UPDATE statement.
  • INSERT Use an INSERT statement.
  • Use cql.statement.type Attribute The value of the cql.statement.type Attribute will be used to determine which type of statement (UPDATE, INSERT) will be generated and executed
Specifies the type of CQL Statement to generate.
Update Keysput-cassandra-record-update-keysA comma-separated list of column names that uniquely identifies a row in the database for UPDATE statements. If the Statement Type is UPDATE and this property is not set, the conversion to CQL will fail. This property is ignored if the Statement Type is not UPDATE.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Update Methodput-cassandra-record-update-methodSet
  • Increment Use an increment operation (+=) for the Update statement.
  • Decrement Use a decrement operation (-=) for the Update statement.
  • Set Use a set operation (=) for the Update statement.
  • Use cql.update.method Attribute The value of the cql.update.method Attribute will be used to determine which operation (Set, Increment, Decrement) will be used to generate and execute the Update statement.
Specifies the method to use to SET the values. This property is used if the Statement Type is UPDATE and ignored otherwise.
Client AuthClient AuthREQUIRED
  • WANT
  • REQUIRED
  • NONE
Client authentication policy when connecting to secure (TLS/SSL) cluster. Possible values are REQUIRED, WANT, NONE. This property is only used when an SSL Context has been defined and enabled.
UsernameUsernameUsername to access the Cassandra cluster
Supports Expression Language: true (will be evaluated using variable registry only)
PasswordPasswordPassword to access the Cassandra cluster
Sensitive Property: true
Supports Expression Language: true (will be evaluated using variable registry only)
Record Readerput-cassandra-record-readerController Service API:
RecordReaderFactory
Implementations: JsonPathReader
Syslog5424Reader
CSVReader
JsonTreeReader
GrokReader
ExcelReader
ParquetReader
ReaderLookup
CEFReader
WindowsEventLogReader
ProtobufReader
SyslogReader
AvroReader
XMLReader
ScriptedReader
YamlTreeReader
Specifies the type of Record Reader controller service to use for parsing the incoming data and determining the schema
Batch sizeput-cassandra-record-batch-size100Specifies the number of 'Insert statements' to be grouped together to execute as a batch (BatchStatement)
Supports Expression Language: true (will be evaluated using variable registry only)
Consistency LevelConsistency LevelSERIAL
  • SERIAL
  • LOCAL_SERIAL
The strategy for how many replicas must respond before results are returned.
Batch Statement Typeput-cassandra-record-batch-statement-typeLOGGED
  • LOGGED Use a LOGGED batch statement
  • UNLOGGED Use an UNLOGGED batch statement
  • COUNTER Use a COUNTER batch statement
  • Use cql.batch.statement.type Attribute The value of the cql.batch.statement.type Attribute will be used to determine which type of batch statement (LOGGED, UNLOGGED or COUNTER) will be used to generate and execute the Update statement.
Specifies the type of 'Batch Statement' to be used.
SSL Context ServiceSSL Context ServiceController Service API:
SSLContextService
Implementations: StandardRestrictedSSLContextService
StandardSSLContextService
The SSL Context Service used to provide client certificate information for TLS/SSL connections.

Relationships:

NameDescription
successA FlowFile is transferred to this relationship if the operation completed successfully.
failureA FlowFile is transferred to this relationship if the operation failed.

Reads Attributes:

NameDescription
cql.statement.typeIf 'Use cql.statement.type Attribute' is selected for the Statement Type property, the value of the cql.statement.type Attribute will be used to determine which type of statement (UPDATE, INSERT) will be generated and executed
cql.update.methodIf 'Use cql.update.method Attribute' is selected for the Update Method property, the value of the cql.update.method Attribute will be used to determine which operation (Set, Increment, Decrement) will be used to generate and execute the Update statement. Ignored if the Statement Type property is not set to UPDATE
cql.batch.statement.typeIf 'Use cql.batch.statement.type Attribute' is selected for the Batch Statement Type property, the value of the cql.batch.statement.type Attribute will be used to determine which type of batch statement (LOGGED, UNLOGGED, COUNTER) will be generated and executed

Writes Attributes:

None specified.

State management:

This component does not store state.

Restricted:

This component is not restricted.

Input requirement:

This component requires an incoming relationship.

System Resource Considerations:

None specified.