Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
rgw_cors_s3.cc
rgw_dencoder.cc
rgw_env.cc
+ rgw_es_query.cc
rgw_formats.cc
rgw_frontend.cc
rgw_gc.cc
install(TARGETS radosgw-admin DESTINATION bin)
set(radosgw_es_srcs
- rgw_es_query.cc)
+ rgw_es_main.cc)
add_executable(radosgw-es ${radosgw_es_srcs})
target_link_libraries(radosgw-es rgw_a librados
cls_rgw_client cls_lock_client cls_refcount_client
--- /dev/null
+#include <list>
+#include <string>
+#include <iostream>
+
+#include "common/ceph_json.h"
+#include "rgw_es_query.h"
+
+using namespace std;
+
+int main(int argc, char *argv[])
+{
+ list<string> infix;
+
+ string expr;
+
+ if (argc > 1) {
+ expr = argv[1];
+ } else {
+ expr = "age >= 30";
+ }
+
+ ESQueryCompiler es_query(expr);
+
+ bool valid = es_query.compile();
+ if (!valid) {
+ cout << "invalid query, failed generating request json" << std::endl;
+ return EINVAL;
+ }
+
+ JSONFormatter f;
+ encode_json("root", es_query, &f);
+
+ f.flush(cout);
+
+ return 0;
+}
+
encode_json("query", *query_root, f);
}
-
-int main(int argc, char *argv[])
-{
- list<string> infix;
-
- string expr;
-
- if (argc > 1) {
- expr = argv[1];
- } else {
- expr = "age >= 30";
- }
-
- ESQueryCompiler es_query(expr);
-
- bool valid = es_query.compile();
- if (!valid) {
- cout << "invalid query, failed generating request json" << std::endl;
- return EINVAL;
- }
-
- JSONFormatter f;
- encode_json("root", es_query, &f);
-
- f.flush(cout);
-
- return 0;
-}
-