-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Added self documentation to the KSQL config public config variables. #422
Merged
hjafarpour
merged 10 commits into
confluentinc:4.0.x
from
hjafarpour:KSQLConfig-selfdocumentation
Nov 8, 2017
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
db38492
Added self documentation to the KSQL config publis config variables.
hjafarpour 17de98e
Added examples to the descriptions.
hjafarpour 34f2231
Merge remote-tracking branch 'upstream/4.0.x' into KSQLConfig-selfdoc…
hjafarpour b155a65
Renamed some KSQL config props and used ConfigDef for populating the …
hjafarpour 94cc2db
Merge remote-tracking branch 'upstream/4.0.x' into KSQLConfig-selfdoc…
hjafarpour 02a2f32
Only update ksqlStreamConfigProps since ksqlConfigProps is populated …
hjafarpour b3438c6
More details on a config value doc.
hjafarpour 5104828
Merge remote-tracking branch 'upstream/4.0.x' into KSQLConfig-selfdoc…
hjafarpour 7026f77
Created a new KsqlConstants file to hold constants such as property n…
hjafarpour ae5689a
Minor config doc fix.
hjafarpour File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
ksql-common/src/main/java/io/confluent/ksql/util/KsqlConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* Copyright 2017 Confluent Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
**/ | ||
|
||
package io.confluent.ksql.util; | ||
|
||
public class KsqlConstants { | ||
|
||
public static final String SINK_NUMBER_OF_PARTITIONS = "PARTITIONS"; | ||
public static final String SINK_NUMBER_OF_REPLICAS = "REPLICAS"; | ||
|
||
public static final String SINK_WINDOW_CHANGE_LOG_ADDITIONAL_RETENTION = | ||
"WINDOW_CHANGE_LOG_ADDITIONAL_RETENTION"; | ||
public static final String SINK_TIMESTAMP_COLUMN_NAME = "TIMESTAMP"; | ||
|
||
public static int defaultSinkNumberOfPartitions = 4; | ||
public static short defaultSinkNumberOfReplications = 1; | ||
// TODO: Find out the best default value. | ||
public static long defaultSinkWindowChangeLogAdditionalRetention = 1000000; | ||
|
||
public static String defaultAutoOffsetRestConfig = "latest"; | ||
public static long defaultCommitIntervalMsConfig = 2000; | ||
public static long defaultCacheMaxBytesBufferingConfig = 10000000; | ||
public static int defaultNumberOfStreamsThreads = 4; | ||
|
||
} |
45 changes: 45 additions & 0 deletions
45
ksql-common/src/test/java/io/confluent/ksql/util/KsqlConfigTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* Copyright 2017 Confluent Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
**/ | ||
|
||
package io.confluent.ksql.util; | ||
|
||
import org.apache.kafka.streams.StreamsConfig; | ||
import org.junit.Test; | ||
import static org.hamcrest.CoreMatchers.equalTo; | ||
import static org.hamcrest.MatcherAssert.assertThat; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class KsqlConfigTest { | ||
|
||
@Test | ||
public void shouldSetInitialValuesCorrectly() { | ||
Map<String, Object> initialProps = new HashMap<>(); | ||
initialProps.put(KsqlConfig.SINK_NUMBER_OF_PARTITIONS_PROPERTY, 10); | ||
initialProps.put(KsqlConfig.SINK_NUMBER_OF_REPLICAS_PROPERTY, (short) 3); | ||
initialProps.put(StreamsConfig.COMMIT_INTERVAL_MS_CONFIG, 800); | ||
initialProps.put(StreamsConfig.NUM_STREAM_THREADS_CONFIG, 5); | ||
|
||
KsqlConfig ksqlConfig = new KsqlConfig(initialProps); | ||
|
||
assertThat(ksqlConfig.get(KsqlConfig.SINK_NUMBER_OF_PARTITIONS_PROPERTY), equalTo(10)); | ||
assertThat(ksqlConfig.get(KsqlConfig.SINK_NUMBER_OF_REPLICAS_PROPERTY), equalTo((short) 3)); | ||
|
||
} | ||
|
||
|
||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Thanks for updating the example. It makes sense now!