You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by GitBox <gi...@apache.org> on 2021/06/16 07:59:13 UTC

[GitHub] [brooklyn-server] jcabrerizo commented on a change in pull request #1188: Basic functionality for logstore interface

jcabrerizo commented on a change in pull request #1188:
URL: https://github.com/apache/brooklyn-server/pull/1188#discussion_r652445218



##########
File path: core/src/main/java/org/apache/brooklyn/util/core/logbook/opensearch/BrooklynOpenSearchModel.java
##########
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.util.core.logbook.opensearch;
+
+import org.apache.brooklyn.util.core.logbook.BrooklynLogEntry;
+
+import java.util.List;
+
+class BrooklynOpenSearchModel {
+    OpenSearchHitsWrapper hits;
+    Integer took;
+    Boolean timed_out;
+
+    public OpenSearchHitsWrapper getHits() {
+        return hits;
+    }
+
+    public void setHits(OpenSearchHitsWrapper hits) {
+        this.hits = hits;
+    }
+
+    public Integer getTook() {
+        return took;
+    }
+
+    public void setTook(Integer took) {
+        this.took = took;
+    }
+
+    public Boolean getTimed_out() {
+        return timed_out;
+    }
+
+    public void setTimed_out(Boolean timed_out) {
+        this.timed_out = timed_out;
+    }
+
+    static class OpenSearchHitsWrapper {
+        List<OpenSearchHit> hits;
+
+        public List<OpenSearchHit> getHits() {
+            return hits;
+        }
+
+        public void setHits(List<OpenSearchHit> hits) {
+            this.hits = hits;
+        }
+    }
+
+    static class OpenSearchHit {
+        String _index;
+        String _type;

Review comment:
       I use the same field name returned by elastic search. Alternatively the fields can be annotated with ` @JsonProperty("class")` but I preferred to keep it as it is unless it's not clear enough 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org