You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by "Alex Li (Jira)" <ji...@apache.org> on 2020/06/03 06:47:00 UTC
[jira] [Created] (GOBBLIN-1179) Add a typed config to replace
properties
Alex Li created GOBBLIN-1179:
--------------------------------
Summary: Add a typed config to replace properties
Key: GOBBLIN-1179
URL: https://issues.apache.org/jira/browse/GOBBLIN-1179
Project: Apache Gobblin
Issue Type: Task
Reporter: Alex Li
Add a typed config to replace *_properties.get(“ini.file.userName”)_* with *config.userName*
The gobblin config file is an ini file. Java loads the ini file to a properties instance. The way to use the config information is to get from the properties.
|workUnitState.getPropAsBoolean(BULK_API_USE_QUERY_ALL)|
|workUnitState.getPropAsInt(FETCH_RETRY_LIMIT_KEY, DEFAULT_FETCH_RETRY_LIMIT)|
|Math.max(MIN_SIZE,Math.min(MAX_SIZE, workUnitState.getPropAsInt(PARTITION_SIZE, DEFAULT_SIZE)));
// partition size must be >= min and <= max, otherwise use default|
Problems
# No consistent key naming model
* A long dot-separated key string is used, easy to run into typos. The config code is pretty verbose: We use *properties.getProp(key, default)*
* Key collision if the same type is used in multiple places, e.g kafka.brokers
# No ownership management
* in gobblin connector package: We have multiple constant static classes. GobblinKeys, QueryBaseKeys, GaapKeys, and SalesforceConnectorKeys.We can even directly read config values by state.getProp(*“my.key”*) without creating any constant key.
# No static validation
* Required & default value
* Type check
* Date range
* Enum
# No dependency check
* If users set to *useGaap=true*, there must be *gaap.url* and *gaap.credential*. And this needs to be verified at both runtime and compile time.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)