[ 
https://issues.apache.org/jira/browse/STORM-1211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15038144#comment-15038144
 ] 

ASF GitHub Bot commented on STORM-1211:
---------------------------------------

Github user satishd commented on a diff in the pull request:

    https://github.com/apache/storm/pull/915#discussion_r46581840
  
    --- Diff: 
external/storm-cassandra/src/main/java/org/apache/storm/cassandra/trident/state/TridentResultSetValuesMapper.java
 ---
    @@ -0,0 +1,63 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + * http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package org.apache.storm.cassandra.trident.state;
    +
    +import backtype.storm.tuple.Fields;
    +import backtype.storm.tuple.ITuple;
    +import backtype.storm.tuple.Values;
    +import com.datastax.driver.core.ResultSet;
    +import com.datastax.driver.core.Row;
    +import com.datastax.driver.core.Session;
    +import com.datastax.driver.core.Statement;
    +import org.apache.storm.cassandra.query.CQLResultSetValuesMapper;
    +
    +import java.util.ArrayList;
    +import java.util.LinkedList;
    +import java.util.List;
    +
    +/**
    + *
    + */
    +public class TridentResultSetValuesMapper implements 
CQLResultSetValuesMapper {
    +    private Fields outputDeclaredFields;
    +
    +    public TridentResultSetValuesMapper(Fields outputDeclaredFields) {
    +        this.outputDeclaredFields = outputDeclaredFields;
    +    }
    +
    +    @Override
    +    public List<List<Values>> map(Session session, Statement statement, 
ITuple tuple) {
    +        List<List<Values>> list = new ArrayList<>();
    +        ResultSet resultSet = session.execute(statement);
    --- End diff --
    
    Pl check the javadoc of Session which says "@return the result of the 
query. That result will never be null but can be empty"


> Add trident state and query support for cassandra connector
> -----------------------------------------------------------
>
>                 Key: STORM-1211
>                 URL: https://issues.apache.org/jira/browse/STORM-1211
>             Project: Apache Storm
>          Issue Type: Improvement
>            Reporter: Satish Duggana
>            Assignee: Satish Duggana
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to