forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Sandesh Kumar <[email protected]>
- Loading branch information
1 parent
80a8ac9
commit e1898f1
Showing
7 changed files
with
235 additions
and
112 deletions.
There are no files selected for viewing
32 changes: 16 additions & 16 deletions
32
server/src/main/java/org/opensearch/search/aggregations/StarTreeBucketCollector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.search.aggregations; | ||
|
||
import java.io.IOException; | ||
|
||
public abstract class StarTreeBucketCollector extends LeafBucketCollector { | ||
|
||
public abstract void collectStarEntry(int starTreeEntry, long bucket) throws IOException; | ||
} | ||
/// * | ||
// * SPDX-License-Identifier: Apache-2.0 | ||
// * | ||
// * The OpenSearch Contributors require contributions made to | ||
// * this file be licensed under the Apache-2.0 license or a | ||
// * compatible open source license. | ||
// */ | ||
// | ||
// package org.opensearch.search.aggregations; | ||
// | ||
// import java.io.IOException; | ||
// | ||
// public abstract class StarTreeBucketCollector extends LeafBucketCollector { | ||
// | ||
// public abstract void collectStarEntry(int starTreeEntry, long bucket) throws IOException; | ||
// } |
118 changes: 59 additions & 59 deletions
118
server/src/main/java/org/opensearch/search/aggregations/StarTreeLeafBucketCollectorBase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,59 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
/* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
package org.opensearch.search.aggregations; | ||
|
||
import org.apache.lucene.search.Scorable; | ||
import org.opensearch.common.lucene.ScorerAware; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* A {@link LeafBucketCollector} that delegates all calls to the sub leaf | ||
* aggregator and sets the scorer on its source of values if it implements | ||
* {@link ScorerAware}. | ||
* | ||
* @opensearch.internal | ||
*/ | ||
public class StarTreeLeafBucketCollectorBase extends StarTreeBucketCollector { | ||
private final LeafBucketCollector sub; | ||
private final ScorerAware values; | ||
|
||
/** | ||
* @param sub The leaf collector for sub aggregations. | ||
* @param values The values. {@link ScorerAware#setScorer} will be called automatically on them if they implement {@link ScorerAware}. | ||
*/ | ||
public StarTreeLeafBucketCollectorBase(LeafBucketCollector sub, Object values) { | ||
this.sub = sub; | ||
if (values instanceof ScorerAware) { | ||
this.values = (ScorerAware) values; | ||
} else { | ||
this.values = null; | ||
} | ||
} | ||
|
||
@Override | ||
public void setScorer(Scorable s) throws IOException { | ||
sub.setScorer(s); | ||
if (values != null) { | ||
values.setScorer(s); | ||
} | ||
} | ||
|
||
@Override | ||
public void collect(int doc, long bucket) throws IOException { | ||
sub.collect(doc, bucket); | ||
} | ||
|
||
@Override | ||
public void collectStarEntry(int starTreeEntry, long bucket) throws IOException {} | ||
} | ||
/// * | ||
// * SPDX-License-Identifier: Apache-2.0 | ||
// * | ||
// * The OpenSearch Contributors require contributions made to | ||
// * this file be licensed under the Apache-2.0 license or a | ||
// * compatible open source license. | ||
// */ | ||
// | ||
/// * | ||
// * Modifications Copyright OpenSearch Contributors. See | ||
// * GitHub history for details. | ||
// */ | ||
// package org.opensearch.search.aggregations; | ||
// | ||
// import org.apache.lucene.search.Scorable; | ||
// import org.opensearch.common.lucene.ScorerAware; | ||
// | ||
// import java.io.IOException; | ||
// | ||
/// ** | ||
// * A {@link LeafBucketCollector} that delegates all calls to the sub leaf | ||
// * aggregator and sets the scorer on its source of values if it implements | ||
// * {@link ScorerAware}. | ||
// * | ||
// * @opensearch.internal | ||
// */ | ||
// public class StarTreeLeafBucketCollectorBase extends StarTreeBucketCollector { | ||
// private final LeafBucketCollector sub; | ||
// private final ScorerAware values; | ||
// | ||
// /** | ||
// * @param sub The leaf collector for sub aggregations. | ||
// * @param values The values. {@link ScorerAware#setScorer} will be called automatically on them if they implement {@link ScorerAware}. | ||
// */ | ||
// public StarTreeLeafBucketCollectorBase(LeafBucketCollector sub, Object values) { | ||
// this.sub = sub; | ||
// if (values instanceof ScorerAware) { | ||
// this.values = (ScorerAware) values; | ||
// } else { | ||
// this.values = null; | ||
// } | ||
// } | ||
// | ||
// @Override | ||
// public void setScorer(Scorable s) throws IOException { | ||
// sub.setScorer(s); | ||
// if (values != null) { | ||
// values.setScorer(s); | ||
// } | ||
// } | ||
// | ||
// @Override | ||
// public void collect(int doc, long bucket) throws IOException { | ||
// sub.collect(doc, bucket); | ||
// } | ||
// | ||
// @Override | ||
// public void collectStarEntry(int starTreeEntry, long bucket) throws IOException {} | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
server/src/main/java/org/opensearch/search/aggregations/metrics/StarTreeCollector.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.search.aggregations.metrics; | ||
|
||
import org.apache.lucene.index.LeafReaderContext; | ||
import org.opensearch.index.codec.composite.CompositeIndexFieldInfo; | ||
import org.opensearch.search.aggregations.bucket.terms.LongKeyedBucketOrds; | ||
|
||
import java.io.IOException; | ||
|
||
public interface StarTreeCollector { | ||
// public void collectStarEntry(int starTreeEntryBit, long bucket) throws IOException; | ||
|
||
public void preCompute(LeafReaderContext ctx, CompositeIndexFieldInfo starTree, LongKeyedBucketOrds bucketOrds) throws IOException; | ||
} |
Oops, something went wrong.