Original commit message

ChangeScribe message

cleanup of aggregations api

			-
			add javadocs
			-
			remove Iterable from all multi-bucket aggregations
			-
			all single-bucket aggregations should have getDocCount() and
			getAggregations()
			-
			all multi-bucket aggregations should have getBuckets() that
			returns Collection
			-
			every multi-bucket aggregation should have these methods:
			 -
			getBuckets() : Collection
			 -
			getBucketByKey(String) : Bucket
			 -
			getBucketByKey(Number) : Bucket (only for numeric buckets)
			 -
			getBucketByKey(DateTime) : Bucket (only for date buckets)
			 -
			getBucketByKey(GeoPoint) : Bucket (only for geohash_grid)
			-
			every bucket in all multi-bucket aggregations should have these
			methods:
			 -
			getKey() : String
			 -
			getKeyAsText() : Text
			 -
			getKeyAsNumber() : Number (if the key can be numeric value, eg.
			range & histograms)
			 -
			getKeyAsGeoPoint() : GeoPoint (in case of the geohash_grid agg)
			

			 Closes
			#4922

BUG - FEATURE: <type-ID>


This is a degenerate modifier commit: this change set is composed of empty, incidental, and abstract methods. These methods indicate that a new feature is planned. This change set is mainly composed of:


1. Changes to package org.elasticsearch.search.aggregations.bucket.histogram:


1.1. Modifications to Histogram.java:


1.1.1. Modify javadoc at Histogram interface

1.1.2. Add parent interface MultiBucketsAggregation

1.1.3. Remove parent interface HistogramBase<Histogram.Bucket>

1.1.4. Add javadoc at Bucket interface

1.1.5. Add parent interface MultiBucketsAggregation.Bucket

1.1.6. Remove parent interface HistogramBase.Bucket

1.1.7. Add a functionality to get bucket by key

1.1.8. Add a functionality to get buckets


The added/removed methods triggered changes to InternalDateHistogram class, StringTermsTests class, RandomTests class, DateHistogramTests class, MinDocCountTests class, ShardReduceTests class, InternalHistogram class, DateRangeTests class, DoubleTermsTests class, FilterTests class, GeoDistanceTests class, IPv4RangeTests class, LongTermsTests class, MissingTests class, NestedTests class, AvgTests class, ExtendedStatsTests class, MaxTests class, MinTests class, SumTests class


1.2. Modifications to InternalOrder.java:


1.2.1. Modify javadoc at InternalOrder class

1.2.2. Modify the parent class HistogramBase.Order with Histogram.Order

1.2.3. Modify parameterized type Comparator<HistogramBase.Bucket> with Comparator<InternalHistogram.Bucket> for comparator() method

1.2.4. Modify constructor invocation super(ID, key(aggName, valueName), asc, new Bucket.SubAggregationComparator<HistogramBase.Bucket>(aggName, valueName, asc)); at Aggregation(String,String,boolean) method

1.2.5. Modify constructor invocation super(ID, key, asc, new Bucket.SubAggregationComparator<HistogramBase.Bucket>(key, asc)); at Aggregation(String,boolean) method

1.2.6. Type's comparato paramater change of Comparator<HistogramBase.Bucket> to Comparator<InternalHistogram.Bucket> for InternalOrder(byte,String,boolean,Comparator<InternalHistogram.Bucket>) method

1.2.7. Change attribute type of comparator with Comparator<InternalHistogram.Bucket>


2. Changes to package org.elasticsearch.search.aggregations.bucket.terms:


2.1. Modifications to InternalOrder.java:


2.1.1. Modify arguments list when calling writeBoolean method at writeOrder(InternalOrder,StreamOutput) method

2.1.2. Modify arguments list when calling writeString method at writeOrder(InternalOrder,StreamOutput) method

2.1.3. Modify variable declaration hasValueName

2.1.4. Modify constructor invocation super(ID, key(aggName, metricName), asc, new Bucket.SubAggregationComparator<Terms.Bucket>(aggName, metricName, asc)); at Aggregation(String,String,boolean) method

2.1.5. Modify constructor invocation super(ID, key, asc, new Bucket.SubAggregationComparator<Terms.Bucket>(key, asc)); at Aggregation(String,boolean) method


2.2. Modifications to Terms.java:


2.2.1. Add javadoc at Terms interface

2.2.2. Remove parent interface Iterable<Terms.Bucket>

2.2.3. Modify the parent interface Aggregation with MultiBucketsAggregation

2.2.4. Add javadoc at Bucket class

2.2.5. Add parent interface MultiBucketsAggregation.Bucket

2.2.6. Remove parent interface org.elasticsearch.search.aggregations.bucket.Bucket

2.2.7. Remove an unused functionality to get key

2.2.8. Rename buckets method with getBuckets

2.2.9. Rename getByTerm method with getBucketByKey


The added/removed methods triggered changes to InternalTerms class, DoubleTermsTests class, GeoDistanceTests class, LongTermsTests class, MinDocCountTests class, ShardSizeTermsTests class, StringTermsTests class