-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make index creator provision pluggable #7885
make index creator provision pluggable #7885
Conversation
d42823d
to
4cc35e3
Compare
Codecov Report
@@ Coverage Diff @@
## master #7885 +/- ##
=============================================
- Coverage 71.34% 27.65% -43.70%
=============================================
Files 1587 1583 -4
Lines 82071 81996 -75
Branches 12267 12241 -26
=============================================
- Hits 58553 22675 -35878
- Misses 19550 57261 +37711
+ Partials 3968 2060 -1908
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
4cc35e3
to
a28f516
Compare
...in/java/org/apache/pinot/segment/local/segment/creator/impl/DefaultIndexCreatorProvider.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/pinot/segment/local/segment/creator/impl/DefaultIndexCreatorProvider.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. With this we can easily plug in out own index creators
pinot-core/src/main/java/org/apache/pinot/core/minion/RawIndexConverter.java
Outdated
Show resolved
Hide resolved
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/creator/IndexCreatorProvider.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/pinot/segment/local/segment/creator/impl/DefaultIndexCreatorProvider.java
Outdated
Show resolved
Hide resolved
874335b
to
989f68b
Compare
989f68b
to
d4a8970
Compare
...in/java/org/apache/pinot/segment/local/segment/creator/impl/DefaultIndexCreatorProvider.java
Outdated
Show resolved
Hide resolved
b9344ef
to
24b64ff
Compare
@richardstartin just seeing this. I will review it today. Looks like the design doc link was intended to be an issue but it is linking to this PR ? |
pinot-core/src/main/java/org/apache/pinot/core/minion/RawIndexConverter.java
Outdated
Show resolved
Hide resolved
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/creator/IndexCreatorProvider.java
Show resolved
Hide resolved
...segment-spi/src/main/java/org/apache/pinot/segment/spi/creator/TextIndexCreatorProvider.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/pinot/segment/local/segment/creator/impl/DefaultIndexCreatorProvider.java
Show resolved
Hide resolved
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/creator/IndexCreationContext.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/pinot/segment/local/segment/creator/impl/DefaultIndexCreatorProvider.java
Show resolved
Hide resolved
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/creator/IndexCreatorProviders.java
Show resolved
Hide resolved
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/creator/IndexCreationContext.java
Outdated
Show resolved
Hide resolved
bb122fc
to
d9c38cf
Compare
...segment-spi/src/main/java/org/apache/pinot/segment/spi/creator/TextIndexCreatorProvider.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/pinot/segment/local/segment/creator/impl/SegmentColumnarIndexCreator.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/pinot/segment/local/segment/creator/impl/DefaultIndexCreatorProvider.java
Outdated
Show resolved
Hide resolved
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/creator/IndexCreationContext.java
Outdated
Show resolved
Hide resolved
If needed in future, would it be possible to extend these interfaces to allow for creation of multiple indices on a column or would it lead to breaking existing index plugins? For example, I could create an H3 index and a quad-tree index on a geospatial column, or a flat index and a tree index on a JSON column and then depending upon the type of query being evaluated, pick one out of the two available indices to evaluate the query. |
great question. No, the ability to create multiple indexes on a column is not limited by this PR: that logic stays in SegmentColumnarIndexCreator. |
.../org/apache/pinot/segment/local/segment/index/loader/invertedindex/InvertedIndexHandler.java
Show resolved
Hide resolved
81495a5
to
02aa71d
Compare
ea56de2
to
9dfc034
Compare
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/creator/IndexCreationContext.java
Outdated
Show resolved
Hide resolved
1cf8942
to
ca18760
Compare
@siddharthteotia there is now only one method for creating text indexes now. |
ca18760
to
1b3eb5a
Compare
2b42bc9
to
21140ba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for addressing comments
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/creator/IndexCreationContext.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM otherwise
} | ||
|
||
class Text extends Wrapper { | ||
private final boolean _commitOnClose; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not really required as it only applies to mutable index (for consuming segment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, it was hardcoded to be always true, with a comment to name it. Now it has a variable to give it a name and declare its purpose.
* The responsibility for ensuring that the correct parameters for a particular | ||
* index type lies with the caller. | ||
*/ | ||
public interface IndexCreationContext { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some index independent properties that can be moved to the common: min
, max
, sortedUniqueValues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They can be added later if they're ever necessary. It's always easier to add things than take them away.
This allows index creation to be intercepted, so that the current static logic in
SegmentIndexCreator
can be extended or overridden. This is achieved by introducing a new interfaceIndexCreatorProvider
which provides various new index creators from anIndexCreationContext
which bundles all information about index creation. External users can register a decorator which can enhance or entirely replace the default index creator provision logic. Typically, a registered decorator should pattern match theIndexCreatorContext
for very specific cases, and return a custom implementation only in those cases, and merely delegate to the default provisioning logic otherwise.Design doc at #7895