本文整理了Java中io.druid.query.Query.run
方法的一些代码示例,展示了Query.run
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.run
方法的具体详情如下:
包路径:io.druid.query.Query
类名称:Query
方法名:run
暂无
代码示例来源:origin: stackoverflow.com
Query query = database.createAllDocumentsQuery();
QueryEnumerator result = query.run();
for (Iterator<QueryRow> it = result; it.hasNext(); ) {
QueryRow row = it.next();
Log.w("MYAPP", "document ID: %s", row.getDocumentId()); // or QueryRow also has a way to get its source document.
}
代码示例来源:origin: stackoverflow.com
Observable<Query> users = db.createQuery("users", "SELECT * FROM users");
users.subscribe(new Action1<Query>() {
@Override public void call(Query query) {
Cursor cursor = query.run();
// TODO parse data...
}
});
代码示例来源:origin: stackoverflow.com
public void showAllDocuments(Database myDb) throws CouchbaseLiteException{
Query all = myDb.createAllDocumentsQuery(); // return a Query object which is configured to retrieve all documents
QueryEnumerator qe = all.run();
for (Iterator<QueryRow> it = qe; it.hasNext(); ) {
QueryRow row = it.next();
System.out.println("documents " + row.getDocument().getProperties());
}
}
代码示例来源:origin: stackoverflow.com
Query query = new GetPersonQuery(Database database);
query.run(); // or whatever
代码示例来源:origin: stackoverflow.com
//Get the latest sequence number of the document replicated
lastSeq = rep.getLastSequence();
Query query = database.createAllDocumentsQuery();
QueryEnumerator rowEnum = query.run();
for (Iterator<QueryRow> it = rowEnum; it.hasNext();) {
QueryRow row = it.next();
if(lastSequence!=null)
{
if(Long.parseLong(lastSequence)>=row.getSequenceNumber())
{
purgeDoc = row.getDocument();
purgeDoc.purge();
}
}
}
代码示例来源:origin: stackoverflow.com
View userView= database.getView("User");
userView.setMap(new Mapper() {
@Override
public void map(Map<String, Object> document, Emitter emitter) {
// Your Logic here
String Id = document.get("Id").toString();
if (Id != null && Id.contains("John")) {
emitter.emit(Id, document);
}
}
}, "1");
Query query = userView.createQuery();
QueryEnumerator result = query.run();
for (Iterator<QueryRow> it = result; it.hasNext(); ) {
QueryRow row = it.next();
Log.e("myDocument", row.getDocument().toString())
}
代码示例来源:origin: stackoverflow.com
final View allDocumentsView = couchDatabase.getView("allDocumentsView");
if (allDocumentsView.getMap() == null) {
allDocumentsView.setMap(
new Mapper() {
@Override
public void map(Map<String, Object> document, Emitter emitter) {
if (doc != null) {
emitter.emit((String) document.get("_id"), document);
}
}
}, "1"
);
}
final Query allDocumentsQuery = allDocumentsView.createQuery();
try {
for (Iterator<QueryRow> iterator = allDocumentsQuery.run(); iterator.hasNext();) {
iterator.next().getDocument().delete();
}
} catch (Exception e) {
Log.e("Error", "Error deleting document.", e);
}
代码示例来源:origin: com.n3twork.druid/druid-server
Sequence<?> results = query.run(texasRanger);
内容来源于网络,如有侵权,请联系作者删除!