]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: move code around
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 21 Mar 2017 21:47:33 +0000 (14:47 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 30 May 2017 20:24:40 +0000 (13:24 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/CMakeLists.txt
src/rgw/rgw_es_main.cc [new file with mode: 0644]
src/rgw/rgw_es_query.cc

index 3fa36995666438f1460f6ca2eed3a771dabf0c81..7a94c9df73f68c4c7272fa91fde2d53eb309de17 100644 (file)
@@ -55,6 +55,7 @@ set(rgw_a_srcs
   rgw_cors_s3.cc
   rgw_dencoder.cc
   rgw_env.cc
+  rgw_es_query.cc
   rgw_formats.cc
   rgw_frontend.cc
   rgw_gc.cc
@@ -196,7 +197,7 @@ target_link_libraries(radosgw-admin rgw_a librados
 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
diff --git a/src/rgw/rgw_es_main.cc b/src/rgw/rgw_es_main.cc
new file mode 100644 (file)
index 0000000..a419481
--- /dev/null
@@ -0,0 +1,37 @@
+#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;
+}
+
index e89d261d1d67a914ae0027e29c893609b29bb6da..dd4a2c57416f31a589e217987d9bed81166b61c0 100644 (file)
@@ -473,32 +473,3 @@ void ESQueryCompiler::dump(Formatter *f) const {
   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;
-}
-