Datastax Cassandra Java驱动程序,未来的结果集似乎以一致的数据返回

Datastax Cassandra Java驱动程序,未来的结果集似乎以一致的数据返回,java,cassandra,datastax,datastax-java-driver,Java,Cassandra,Datastax,Datastax Java Driver,我使用的是Cassandra驱动程序3.0。当我异步读取数据时,我得到的数据是一致的 例如:在给定的员工ID列表[id1,id2]中,我请求id1和id2的数据。我正在获取id1和id2的数据,有时还有id1和id1。这是不一致的。我提供了下面的代码。你能帮忙吗 public List<Employee> getEmployeeShortProfile(List<String> employeeIds) throws InterruptedException,

我使用的是Cassandra驱动程序3.0。当我异步读取数据时,我得到的数据是一致的

例如:在给定的员工ID列表[id1,id2]中,我请求id1和id2的数据。我正在获取id1和id2的数据,有时还有id1和id1。这是不一致的。我提供了下面的代码。你能帮忙吗

public List<Employee> getEmployeeShortProfile(List<String> employeeIds) throws InterruptedException,
        ExecutionException {
    List<ResultSetFuture> rsFutureList = new ArrayList<ResultSetFuture>();
    List<Employee> EmployeeList = new ArrayList<Employee>();


    for (String EmployeeId : EmployeeIds) {

    //Please NOTE
    //preparedStatement.getbStGetShortProfileById() below in the code returns  the following prepared statement
    //client.getSession().prepare(
    //"select employee_id, company_name, company_icon_url, product_icon_image, company_display_name, employee_information, detail_description from samplekeysapce.tbl_master_employees where employee_id = ? limit 15");
    // FYI, I did not set the consistency level in the execute.

        BoundStatement bStGetShortProfileById = preparedStatement.getbStGetShortProfileById();

        logger.debug("... setting the short profile id ..."+EmployeeId);
        bStGetShortProfileById.bind(EmployeeId);
        Session session = client.getSession();
        ResultSetFuture rs = session.executeAsync(bStGetShortProfileById);
        rsFutureList.add(rs);
    }


    for(ResultSetFuture rsF : rsFutureList){
        ResultSet rs = rsF.getUninterruptibly();
        Iterator<Row> rowIterator = rs.iterator();
        Employee c = extractEmployee(rowIterator);
        if(c!= null){
            EmployeeList.add(c);

        }


    }
    return EmployeeList;
}
public List getEmployeeShortProfile(List employeeId)抛出InterruptedException,
执行例外{
List rsFutureList=newarraylist();
List EmployeeList=新建ArrayList();
for(字符串EmployeeId:EmployeeId){
//请注意
//代码中下面的getbStGetShortProfileById()返回以下准备好的语句
//client.getSession().prepare(
//“从samplekeysapce.tbl_master_employees中选择员工id、公司名称、公司图标url、产品图标图像、公司显示名称、员工信息、详细信息描述,其中员工id=?限制15”);
//仅供参考,我没有在执行中设置一致性级别。
BoundStatement bStGetShortProfileById=preparedStatement.getbStGetShortProfileById();
logger.debug(“…设置短配置文件id…”+EmployeeId);
bStGetShortProfileById.bind(EmployeeId);
Session Session=client.getSession();
ResultSetFuture rs=session.executeAsync(bStGetShortProfileById);
rsFutureList.add(rs);
}
对于(结果未来rsF:rsFutureList){
ResultSet rs=rsF.getUnterruptibly();
迭代器rowIterator=rs.Iterator();
Employee c=提取器Employee(行迭代器);
如果(c!=null){
雇员名单。添加(c);
}
}
返回员工名单;
}

Datastax团队()的Olivier Michallat能够帮助我们指出,BoundStatement每次都需要不同的实例

我们验证了代码,没有返回不同的BoundStatement实例。我们更正了代码,问题就解决了

我们和税务团队的对话就在这里

谢谢
对于支持。

来自Datastax团队()的Olivier Michallat能够帮助我们指出BoundStatement每次都需要不同的实例

我们验证了代码,没有返回不同的BoundStatement实例。我们更正了代码,问题就解决了

我们和税务团队的对话就在这里

谢谢
支持。

用于交叉引用的相关jira票据:谢谢Sotirios Delimanolis用于交叉引用的相关jira票据:谢谢Sotirios Delimanolis