Skip to content
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

Merged
merged 1 commit into from Mar 30, 2020

Conversation

Jackie-Jiang
Copy link
Contributor

@Jackie-Jiang Jackie-Jiang commented Mar 27, 2020

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)

@Jackie-Jiang Jackie-Jiang force-pushed the table_config_spi branch 4 times, most recently from 0e719fc to 8ea3f80 Compare March 29, 2020 01:43
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)
@codecov-io
Copy link

codecov-io commented Mar 29, 2020

Codecov Report

Merging #5194 into master will decrease coverage by 0.12%.
The diff coverage is 71.66%.

Impacted file tree graph

@@             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     
Impacted Files Coverage Δ Complexity Δ
...e/pinot/broker/api/resources/PinotBrokerDebug.java 76.66% <ø> (ø) 0.00 <0.00> (ø)
.../BrokerResourceOnlineOfflineStateModelFactory.java 55.81% <ø> (ø) 0.00 <0.00> (ø)
.../pinot/broker/broker/helix/HelixBrokerStarter.java 71.97% <ø> (ø) 0.00 <0.00> (ø)
...thandler/SingleConnectionBrokerRequestHandler.java 92.68% <ø> (ø) 0.00 <0.00> (ø)
...rg/apache/pinot/broker/routing/RoutingManager.java 80.00% <ø> (+1.15%) 0.00 <0.00> (ø)
...ting/instanceselector/InstanceSelectorFactory.java 71.42% <ø> (ø) 0.00 <0.00> (ø)
...er/routing/segmentpruner/SegmentPrunerFactory.java 83.33% <ø> (ø) 0.00 <0.00> (ø)
...outing/segmentselector/SegmentSelectorFactory.java 60.00% <ø> (ø) 0.00 <0.00> (ø)
...oker/routing/timeboundary/TimeBoundaryManager.java 87.50% <ø> (ø) 0.00 <0.00> (ø)
...mmon/assignment/InstanceAssignmentConfigUtils.java 72.50% <ø> (ø) 0.00 <0.00> (?)
... and 164 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1f1baf8...0e3bdaf. Read the comment docs.

quotaConfig.getMaxQueriesPerSecond(), tableNameWithType);
return;
}
double overallRate = Double.parseDouble(quotaConfig.getMaxQueriesPerSecond());
Copy link
Contributor

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.

Copy link
Contributor Author

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)
Copy link
Contributor

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?

Copy link
Contributor Author

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(
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@Jackie-Jiang Jackie-Jiang merged commit 00fcb1d into apache:master Mar 30, 2020
@Jackie-Jiang Jackie-Jiang deleted the table_config_spi branch March 30, 2020 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants