Class ElasticsearchJson
- java.lang.Object
-
- org.apache.calcite.adapter.elasticsearch.ElasticsearchJson
-
final class ElasticsearchJson extends java.lang.Object
Internal objects (and deserializers) used to parse Elasticsearch results (which are in JSON format).Since we're using basic row-level rest client http response has to be processed manually using JSON (jackson) library.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static interface
ElasticsearchJson.Aggregation
Identifies all aggregations(package private) static class
ElasticsearchJson.Aggregations
ElasticsearchJson.Aggregation
container.(package private) static class
ElasticsearchJson.AggregationsDeserializer
Allows to de-serialize nested aggregation structures.(package private) static class
ElasticsearchJson.Bucket
A bucket represents a criteria to which all documents that fall in it adhere to.(package private) static class
ElasticsearchJson.GroupValue
Distinguishes fromElasticsearchJson.MultiValue
.(package private) static interface
ElasticsearchJson.HasAggregations
Allows traversing aggregations tree(package private) static class
ElasticsearchJson.MultiBucketsAggregation
An aggregation that returns multiple buckets(package private) static class
ElasticsearchJson.MultiValue
Multi value aggregatoin like Stats(package private) static class
ElasticsearchJson.Result
Response from Elasticprivate static class
ElasticsearchJson.RowKey
Identifies a calcite row (as in relational algebra)(package private) static class
ElasticsearchJson.SearchHit
Concrete result record which matched the query.(package private) static class
ElasticsearchJson.SearchHits
Similar toSearchHits
in ES.
-
Constructor Summary
Constructors Modifier Constructor Description private
ElasticsearchJson()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static void
visitMappingProperties(com.fasterxml.jackson.databind.node.ObjectNode mapping, java.util.function.BiConsumer<java.lang.String,java.lang.String> consumer)
Visits Elasticsearch mapping properties and calls consumer for eachfield / type
pair.private static void
visitMappingProperties(java.util.Deque<java.lang.String> path, com.fasterxml.jackson.databind.node.ObjectNode mapping, java.util.function.BiConsumer<java.lang.String,java.lang.String> consumer)
private static void
visitValueNodes(ElasticsearchJson.Aggregation aggregation, java.util.List<ElasticsearchJson.Bucket> parents, java.util.function.BiConsumer<ElasticsearchJson.RowKey,ElasticsearchJson.MultiValue> consumer)
(package private) static void
visitValueNodes(ElasticsearchJson.Aggregations aggregations, java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.Object>> consumer)
Visits leaves of the aggregation where all values are stored.
-
-
-
Method Detail
-
visitValueNodes
static void visitValueNodes(ElasticsearchJson.Aggregations aggregations, java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.Object>> consumer)
Visits leaves of the aggregation where all values are stored.
-
visitMappingProperties
static void visitMappingProperties(com.fasterxml.jackson.databind.node.ObjectNode mapping, java.util.function.BiConsumer<java.lang.String,java.lang.String> consumer)
Visits Elasticsearch mapping properties and calls consumer for eachfield / type
pair. Nested fields are represented asfoo.bar.qux
.
-
visitMappingProperties
private static void visitMappingProperties(java.util.Deque<java.lang.String> path, com.fasterxml.jackson.databind.node.ObjectNode mapping, java.util.function.BiConsumer<java.lang.String,java.lang.String> consumer)
-
visitValueNodes
private static void visitValueNodes(ElasticsearchJson.Aggregation aggregation, java.util.List<ElasticsearchJson.Bucket> parents, java.util.function.BiConsumer<ElasticsearchJson.RowKey,ElasticsearchJson.MultiValue> consumer)
-
-