[
https://issues.apache.org/jira/browse/APEXMALHAR-1966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15345854#comment-15345854
]
ASF GitHub Bot commented on APEXMALHAR-1966:
--------------------------------------------
Github user bhupeshchawda commented on a diff in the pull request:
https://github.com/apache/apex-malhar/pull/295#discussion_r68180348
--- Diff:
contrib/src/main/java/com/datatorrent/contrib/cassandra/AbstractCassandraTransactionableOutputOperator.java
---
@@ -48,29 +54,58 @@
* @param <T>type of tuple</T>
* @since 1.0.2
*/
-public abstract class AbstractCassandraTransactionableOutputOperator<T>
extends AbstractBatchTransactionableStoreOutputOperator<T,
CassandraTransactionalStore> {
+public abstract class AbstractCassandraTransactionableOutputOperator<T>
extends AbstractBatchTransactionableStoreOutputOperator<T,
CassandraTransactionalStore> implements
ActivationListener<Context.OperatorContext>
+{
+ private transient PreparedStatement updateCommand;
- public AbstractCassandraTransactionableOutputOperator(){
- super();
+ @Override
+ public void activate(OperatorContext context)
+ {
+ updateCommand = getUpdateCommand();
}
/**
+ * Gets the statement which insert/update the table in the database.
+ *
+ * @return the cql statement to update a tuple in the database.
+ */
+ @Nonnull
+ protected abstract PreparedStatement getUpdateCommand();
+
+ /**
* Sets the parameter of the insert/update statement with values from
the tuple.
*
* @param tuple tuple
* @return statement The statement to execute
* @throws DriverException
+ *
+ * @deprecated since 3.5.0.0 use {@link
#setStatementParameters(PreparedStatement, T)} instead.<br/>
*/
+ @Deprecated
protected abstract Statement getUpdateStatement(T tuple) throws
DriverException;
--- End diff --
Will removing this cause any issues with backward compatibility. Keeping
this (even deprecated) may require us to ensure that calls to
```getUpdateStatement()``` are successful.
@PramodSSImmaneni What is the right way to get rid of this method?
> Cassandra output operator improvements
> --------------------------------------
>
> Key: APEXMALHAR-1966
> URL: https://issues.apache.org/jira/browse/APEXMALHAR-1966
> Project: Apache Apex Malhar
> Issue Type: Improvement
> Reporter: Priyanka Gugale
> Assignee: Priyanka Gugale
>
> Update existing Cassandra output operator to:
> 1. Accept use defined parameterized queries, the queries could be for update,
> insert or delete.
> 2. Add error port to emit tuples which couldn't be written to database.
> 3. Add metrics
> 4. Provide a way to restrict batch size
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)