-
Notifications
You must be signed in to change notification settings - Fork 3
refactor: Extract split filter provider interface to improve flexibility for user customization. #46
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
refactor: Extract split filter provider interface to improve flexibility for user customization. #46
Changes from 28 commits
5582899
e51aa97
14e61d2
72cf371
1e5c256
2079250
bc6633e
13caaa5
df82f0f
53fc10d
36b2659
d639958
190afeb
aef56b4
854401f
da18503
eb70c70
0a9f83e
2e990ba
6586e25
860b06f
dc6f9fc
baf0053
d1f34bf
c302fbe
6925011
9289bd7
c72c0dc
bb68029
4efe0b1
528f5d0
ee4ea9b
5601349
df37d2a
1871733
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -29,11 +29,12 @@ public class ClpConfig | |||||||||||||||||||||||||||
| private String metadataDbName; | ||||||||||||||||||||||||||||
| private String metadataDbUser; | ||||||||||||||||||||||||||||
| private String metadataDbPassword; | ||||||||||||||||||||||||||||
| private String metadataFilterConfig; | ||||||||||||||||||||||||||||
| private String metadataTablePrefix; | ||||||||||||||||||||||||||||
| private long metadataRefreshInterval = 60; | ||||||||||||||||||||||||||||
| private long metadataExpireInterval = 600; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| private String splitFilterConfig; | ||||||||||||||||||||||||||||
| private SplitFilterProviderType splitFilterProviderType = SplitFilterProviderType.MYSQL; | ||||||||||||||||||||||||||||
| private SplitProviderType splitProviderType = SplitProviderType.MYSQL; | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| public boolean isPolymorphicTypeEnabled() | ||||||||||||||||||||||||||||
|
|
@@ -108,18 +109,6 @@ public ClpConfig setMetadataDbPassword(String metadataDbPassword) | |||||||||||||||||||||||||||
| return this; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| public String getMetadataFilterConfig() | ||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||
| return metadataFilterConfig; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| @Config("clp.metadata-filter-config") | ||||||||||||||||||||||||||||
| public ClpConfig setMetadataFilterConfig(String metadataFilterConfig) | ||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||
| this.metadataFilterConfig = metadataFilterConfig; | ||||||||||||||||||||||||||||
| return this; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| public String getMetadataTablePrefix() | ||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||
| return metadataTablePrefix; | ||||||||||||||||||||||||||||
|
|
@@ -162,6 +151,30 @@ public ClpConfig setMetadataExpireInterval(long metadataExpireInterval) | |||||||||||||||||||||||||||
| return this; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| public String getSplitFilterConfig() | ||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||
| return splitFilterConfig; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| @Config("clp.split-filter-config") | ||||||||||||||||||||||||||||
| public ClpConfig setSplitFilterConfig(String splitFilterConfig) | ||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||
| this.splitFilterConfig = splitFilterConfig; | ||||||||||||||||||||||||||||
| return this; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| public SplitFilterProviderType getSplitFilterProviderType() | ||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||
| return splitFilterProviderType; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| @Config("clp.split-filter-provider-type") | ||||||||||||||||||||||||||||
| public ClpConfig setSplitFilterProviderType(SplitFilterProviderType splitFilterProviderType) | ||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||
| this.splitFilterProviderType = splitFilterProviderType; | ||||||||||||||||||||||||||||
| return this; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
Comment on lines
+171
to
+176
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick (assertive) Add @ConfigDescription for provider type Clarify what values are accepted and what it controls. - @Config("clp.split-filter-provider-type")
+ @Config("clp.split-filter-provider-type")
+ @com.facebook.airlift.configuration.ConfigDescription("Split-filter provider type (e.g., MYSQL)")
public ClpConfig setSplitFilterProviderType(SplitFilterProviderType splitFilterProviderType)📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| public SplitProviderType getSplitProviderType() | ||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||
| return splitProviderType; | ||||||||||||||||||||||||||||
|
|
@@ -179,6 +192,11 @@ public enum MetadataProviderType | |||||||||||||||||||||||||||
| MYSQL | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| public enum SplitFilterProviderType | ||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||
| MYSQL | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| public enum SplitProviderType | ||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||
| MYSQL | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,8 +29,8 @@ public enum ClpErrorCode | |
| CLP_UNSUPPORTED_TYPE(3, EXTERNAL), | ||
| CLP_UNSUPPORTED_CONFIG_OPTION(4, EXTERNAL), | ||
|
|
||
| CLP_METADATA_FILTER_CONFIG_NOT_FOUND(10, USER_ERROR), | ||
| CLP_MANDATORY_METADATA_FILTER_NOT_VALID(11, USER_ERROR); | ||
| CLP_SPLIT_FILTER_CONFIG_NOT_FOUND(10, USER_ERROR), | ||
| CLP_MANDATORY_SPLIT_FILTER_NOT_VALID(11, USER_ERROR); | ||
|
||
|
|
||
| private final ErrorCode errorCode; | ||
|
|
||
|
|
||
This file was deleted.
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.
🧹 Nitpick (assertive)
Add @ConfigDescription to document the new config key
Annotate the setter to improve self-documentation and config help output.
If you prefer an explicit import, add:
🤖 Prompt for AI Agents