Github user DT-Priyanka commented on a diff in the pull request:
https://github.com/apache/apex-malhar/pull/295#discussion_r68182365
--- 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 --
I will remove this method for now, if we want to keep it I will have to
provide method implementation for setStatementParameters and call
"getUpdateStatement" from within setStatementParameters. That means I can't
mark setStatementParameters as abstract.
We are anyway removing AbstractCassandraTransactionableOutputOperatorPS.
Also the class is marked as evolving. So I guess it would be okay to remove
"getUpdateStatement" method.
@PramodSSImmaneni @tweise please revert with right option to avoid
backword compatibility issues.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---