[
https://issues.apache.org/jira/browse/STORM-1075?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15024741#comment-15024741
]
ASF GitHub Bot commented on STORM-1075:
---------------------------------------
Github user fhussonnois commented on the pull request:
https://github.com/apache/storm/pull/827#issuecomment-159316692
@satishd, @harshach ok perfect. So I will refactor API to remove
Insert/Update builder.
Then I add a simple interface to map tuples to columns :
```java
public interface CqlMapper extends Serializable {
List<Column> getColumns(ITuple tuple);
}
```
In addition, I will implement a SimpleStatementMapper to build query as
follows :
```java
new CassandraWriterBolt(
async(
simpleQuery("INSERT INTO weather.temperature (weatherstation_id,
event_time, temperature) VALUES(?,?,?)"),with(field("weatherstation_id"),
field("event_time").now(), field("temperature")));
)
);
```
Same Bolt could be write with QueryBuilder :
```java
new CassandraWriterBolt(
async(
simple(
QueryBuilder.insertInto("weather", "temperature")
.value("weatherstation_id", "?")
.value("event_time", "?")
.value("temperature", "?")
,
with(field("weatherstation_id"), field("event_time").now(),
field("temperature")));
)
);
```
What do you think about that ?
> Storm Cassandra connector
> -------------------------
>
> Key: STORM-1075
> URL: https://issues.apache.org/jira/browse/STORM-1075
> Project: Apache Storm
> Issue Type: Improvement
> Components: storm-core
> Reporter: Sriharsha Chintalapani
> Assignee: Satish Duggana
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)