hadoop 使用mapr实现请求

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

我有以下Java代码片段:

  1. import org.ojai.Document;
  2. public class JsonRepository {
  3. public Object jsonStore; // what type should be this Object
  4. public Document createDocument()
  5. {
  6. ....
  7. }
  8. }
  9. import org.ojai.Document;
  10. import org.ojai.DocumentStream;
  11. import org.ojai.store.QueryCondition;
  12. @Repository
  13. public class accountRepository extends JsonRepository {
  14. public DocumentStream accountsAsStream(List<String> ids) {
  15. QueryCondition condition = jsonStore.getQueryCondition().in(123, ids);
  16. ......
  17. List<Document> documents = jsonStore.query(condition);
  18. .......
  19. return jsonStore.queryAsStream(condition);
  20. }
  21. public DocumentStream accountIdsAsStream() {
  22. return jsonStore.getAllDocumentsAsStream("id");
  23. }
  24. }

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

hwazgwia

hwazgwia1#

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

相关问题