-
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
Move table config into pinot-spi #5194
Conversation
a6fc4e9
to
1e05504
Compare
0e719fc
to
8ea3f80
Compare
Motivation: - Table config should be moved to pinot-spi so that user interface can access it (e.g. segment generation spec) Changes: - Make all configs POJO like, and Json serializable for backward-compatibility - De-couple the Helix properties and utils from the configs - Add the TableConfigSerDeTest to check all the serialization/de-serialization Side changes: - Refactor DataSizeUtils (from DataSize), integrate StorageQuotaChecker and HelixExternalViewBasedQueryQuotaManager with the POJO like QuotaConfig - TextIndexConfigValidator is integrated into `TableConfigUtils.validate(TableConfig tableConfig)` BACKWARD-INCOMPATIBILITY: - TableConfig no longer support de-serialization from json string of nested json string (i.e. no `\"` inside the json)
8ea3f80
to
0e3bdaf
Compare
Codecov Report
@@ Coverage Diff @@
## master #5194 +/- ##
============================================
- Coverage 65.95% 65.83% -0.13%
Complexity 12 12
============================================
Files 1052 1055 +3
Lines 54170 54096 -74
Branches 8078 8047 -31
============================================
- Hits 35729 35615 -114
- Misses 15795 15834 +39
- Partials 2646 2647 +1
Continue to review full report at Codecov.
|
quotaConfig.getMaxQueriesPerSecond(), tableNameWithType); | ||
return; | ||
} | ||
double overallRate = Double.parseDouble(quotaConfig.getMaxQueriesPerSecond()); |
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.
parseDouble would throw NumberFormatException
if the the input string isn't a valid number.
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.
Already fixed
@@ -83,11 +84,11 @@ public void setUp() | |||
.addTime(TIME_COLUMN_NAME, TimeUnit.DAYS, FieldSpec.DataType.INT).build(); | |||
_helixResourceManager.addSchema(schema, true); | |||
TableConfig offlineTableConfig = | |||
new TableConfig.Builder(TableType.OFFLINE).setTableName(RAW_TABLE_NAME).setTimeColumnName(TIME_COLUMN_NAME) | |||
new TableConfigBuilder(TableType.OFFLINE).setTableName(RAW_TABLE_NAME).setTimeColumnName(TIME_COLUMN_NAME) |
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.
Why does the builder need to be a public class instead of an inner class?
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.
To keep the config class clean and maintain the builder as an util class. There are multiple ways to get the table config: using a builder; deserialize from json; construct from ZNRecord.
@@ -184,7 +185,7 @@ public void run() | |||
|
|||
private TableConfig getTableConfig(String tableName) | |||
throws Exception { | |||
return TableConfig.fromZnRecord( | |||
return TableConfigUtils.fromZNRecord( |
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 multiple ways to convert to TableConfig
, like TableConfigUtils
and Builder
. Can they be unified to one class?
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.
No because ZNRecord is a Helix specific concept which should not be pulled into the pinot-spi.
Motivation:
Changes:
Side changes:
TableConfigUtils.validate(TableConfig tableConfig)
BACKWARD-INCOMPATIBILITY:
\"
inside the json)