PutCassandraRecord

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, whether a property supports the NiFi Expression Language, and whether a property is considered "sensitive", meaning that its value will be encrypted. Before entering a value in a sensitive property, ensure that the nifi.properties file has an entry for the property nifi.sensitive.props.key.

NameDefault ValueAllowable ValuesDescription
Cassandra Connection ProviderController Service API:
CassandraSessionProviderService
Implementation: CassandraSessionProvider
Specifies the Cassandra connection providing controller service to be used to connect to Cassandra cluster.
Cassandra 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)
KeyspaceThe 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 nameThe 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 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 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 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 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.
UsernameUsername to access the Cassandra cluster
Supports Expression Language: true (will be evaluated using variable registry only)
PasswordPassword to access the Cassandra cluster
Sensitive Property: true
Supports Expression Language: true (will be evaluated using variable registry only)
Record ReaderController Service API:
RecordReaderFactory
Implementations: ScriptedReader
XMLReader
GrokReader
AvroReader
WindowsEventLogReader
JsonPathReader
ReaderLookup
CSVReader
Syslog5424Reader
SyslogReader
JsonTreeReader
ParquetReader
Specifies the type of Record Reader controller service to use for parsing the incoming data and determining the schema
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 LevelSERIAL
  • SERIAL
  • LOCAL_SERIAL
The strategy for how many replicas must respond before results are returned.
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 ServiceController Service API:
SSLContextService
Implementations: StandardSSLContextService
StandardRestrictedSSLContextService
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.