hadoop 使用mapr实现请求

a11xaf1n  于 2023-08-03  发布在  Hadoop
关注(0)|答案(1)|浏览(153)

我有以下Java代码片段:

import org.ojai.Document;

public class JsonRepository {

    public Object jsonStore; // what type should be this Object 

    public Document createDocument()
    {
     ....
    }
}

import org.ojai.Document;
import org.ojai.DocumentStream;
import org.ojai.store.QueryCondition;

@Repository
public class accountRepository extends JsonRepository {

         public DocumentStream accountsAsStream(List<String> ids) {
              QueryCondition condition = jsonStore.getQueryCondition().in(123, ids);

              ......
              List<Document> documents = jsonStore.query(condition);
              .......

             return jsonStore.queryAsStream(condition);
         }

         public DocumentStream accountIdsAsStream() {
             return jsonStore.getAllDocumentsAsStream("id");
         }
}

字符串
我找不到什么类型的变量应该是jsonStore。它需要支持这些方法:queryAsStreamqueryqueryAsStreamgetAllDocumentsAsStream等你知道怎么找到这个吗?

hwazgwia

hwazgwia1#

这段代码看起来有点过时。
有没有可能您不想使用queryAsStream方法,而宁愿使用DocumentStore.find()
返回QueryResult,它是DocumentStream的子类。
如果这是有意义的,那么jsonStore的类型应该是DocumentStore
参见https://www.ojai.io/javadocs/latest/

相关问题