-
Notifications
You must be signed in to change notification settings - Fork 15.1k
KAFKA-20329: Test headers dsl.store.format further (3/N) #21820
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
base: trunk
Are you sure you want to change the base?
Changes from 1 commit
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 |
|---|---|---|
|
|
@@ -28,7 +28,6 @@ | |
| import org.apache.kafka.common.serialization.StringSerializer; | ||
| import org.apache.kafka.common.utils.Bytes; | ||
| import org.apache.kafka.server.util.MockTime; | ||
| import org.apache.kafka.streams.GroupProtocol; | ||
| import org.apache.kafka.streams.KafkaStreams; | ||
| import org.apache.kafka.streams.StreamsBuilder; | ||
| import org.apache.kafka.streams.StreamsConfig; | ||
|
|
@@ -149,10 +148,10 @@ private Admin createAdminClient() { | |
| return Admin.create(adminClientConfig); | ||
| } | ||
|
|
||
| private void configureStreams(final boolean streamsProtocolEnabled, final String appID) { | ||
| private void configureStreams(final boolean withHeaders, final String appID) { | ||
|
||
| streamsProp.put(StreamsConfig.APPLICATION_ID_CONFIG, appID); | ||
| if (streamsProtocolEnabled) { | ||
| streamsProp.put(StreamsConfig.GROUP_PROTOCOL_CONFIG, GroupProtocol.STREAMS.name().toLowerCase(Locale.getDefault())); | ||
| if (withHeaders) { | ||
| streamsProp.put(StreamsConfig.DSL_STORE_FORMAT_CONFIG, StreamsConfig.DSL_STORE_FORMAT_HEADERS); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -162,9 +161,9 @@ private void configureStreams(final boolean streamsProtocolEnabled, final String | |
| */ | ||
| @ParameterizedTest | ||
| @ValueSource(booleans = {true, false}) | ||
| public void shouldGetToRunningWithWindowedTableInFKJ(final boolean streamsProtocolEnabled) throws Exception { | ||
| final String appID = APP_ID + "-windowed-FKJ-" + streamsProtocolEnabled; | ||
| configureStreams(streamsProtocolEnabled, appID); | ||
| public void shouldGetToRunningWithWindowedTableInFKJ(final boolean withHeaders) throws Exception { | ||
| final String appID = APP_ID + "-windowed-FKJ-" + withHeaders; | ||
| configureStreams(withHeaders, appID); | ||
|
|
||
| final StreamsBuilder streamsBuilder = new StreamsBuilder(); | ||
| final KStream<String, String> inputTopic = streamsBuilder.stream(DEFAULT_INPUT_TOPIC); | ||
|
|
@@ -192,9 +191,9 @@ public void shouldGetToRunningWithWindowedTableInFKJ(final boolean streamsProtoc | |
|
|
||
| @ParameterizedTest | ||
| @ValueSource(booleans = {true, false}) | ||
| public void shouldCompactTopicsForKeyValueStoreChangelogs(final boolean streamsProtocolEnabled) throws Exception { | ||
| final String appID = APP_ID + "-compact-" + streamsProtocolEnabled; | ||
| configureStreams(streamsProtocolEnabled, appID); | ||
| public void shouldCompactTopicsForKeyValueStoreChangelogs(final boolean withHeaders) throws Exception { | ||
| final String appID = APP_ID + "-compact-" + withHeaders; | ||
| configureStreams(withHeaders, appID); | ||
|
|
||
| // | ||
| // Step 1: Configure and start a simple word count topology | ||
|
|
@@ -230,9 +229,9 @@ public void shouldCompactTopicsForKeyValueStoreChangelogs(final boolean streamsP | |
|
|
||
| @ParameterizedTest | ||
| @ValueSource(booleans = {true, false}) | ||
| public void shouldCompactAndDeleteTopicsForWindowStoreChangelogs(final boolean streamsProtocolEnabled) throws Exception { | ||
| final String appID = APP_ID + "-compact-delete-" + streamsProtocolEnabled; | ||
| configureStreams(streamsProtocolEnabled, appID); | ||
| public void shouldCompactAndDeleteTopicsForWindowStoreChangelogs(final boolean withHeaders) throws Exception { | ||
| final String appID = APP_ID + "-compact-delete-" + withHeaders; | ||
| configureStreams(withHeaders, appID); | ||
|
|
||
| // | ||
| // Step 1: Configure and start a simple word count topology | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,6 @@ | |
| import org.apache.kafka.common.serialization.StringSerializer; | ||
| import org.apache.kafka.common.utils.Bytes; | ||
| import org.apache.kafka.common.utils.MockTime; | ||
| import org.apache.kafka.streams.GroupProtocol; | ||
| import org.apache.kafka.streams.KafkaStreams; | ||
| import org.apache.kafka.streams.KafkaStreams.State; | ||
| import org.apache.kafka.streams.KeyValue; | ||
|
|
@@ -59,7 +58,6 @@ | |
| import java.util.ArrayList; | ||
| import java.util.Collections; | ||
| import java.util.List; | ||
| import java.util.Locale; | ||
| import java.util.Properties; | ||
| import java.util.stream.Collectors; | ||
|
|
||
|
|
@@ -344,9 +342,9 @@ private void closeApplication() throws Exception { | |
|
|
||
| @ParameterizedTest | ||
| @ValueSource(booleans = {true, false}) | ||
| public void shouldAddMetricsOnAllLevels(final boolean streamsProtocolEnabled) throws Exception { | ||
| if (streamsProtocolEnabled) { | ||
|
Member
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. Same question? Also below. |
||
| streamsConfiguration.put(StreamsConfig.GROUP_PROTOCOL_CONFIG, GroupProtocol.STREAMS.name().toLowerCase(Locale.getDefault())); | ||
| public void shouldAddMetricsOnAllLevels(final boolean withHeaders) throws Exception { | ||
| if (withHeaders) { | ||
| streamsConfiguration.put(StreamsConfig.DSL_STORE_FORMAT_CONFIG, StreamsConfig.DSL_STORE_FORMAT_HEADERS); | ||
| } | ||
|
|
||
| builder.stream(STREAM_INPUT, Consumed.with(Serdes.Integer(), Serdes.String())) | ||
|
|
@@ -383,9 +381,9 @@ public void shouldAddMetricsOnAllLevels(final boolean streamsProtocolEnabled) th | |
|
|
||
| @ParameterizedTest | ||
| @ValueSource(booleans = {true, false}) | ||
| public void shouldAddMetricsForWindowStoreAndSuppressionBuffer(final boolean streamsProtocolEnabled) throws Exception { | ||
| if (streamsProtocolEnabled) { | ||
| streamsConfiguration.put(StreamsConfig.GROUP_PROTOCOL_CONFIG, GroupProtocol.STREAMS.name().toLowerCase(Locale.getDefault())); | ||
| public void shouldAddMetricsForWindowStoreAndSuppressionBuffer(final boolean withHeaders) throws Exception { | ||
| if (withHeaders) { | ||
| streamsConfiguration.put(StreamsConfig.DSL_STORE_FORMAT_CONFIG, StreamsConfig.DSL_STORE_FORMAT_HEADERS); | ||
| } | ||
|
|
||
| final Duration windowSize = Duration.ofMillis(50); | ||
|
|
@@ -416,9 +414,9 @@ public void shouldAddMetricsForWindowStoreAndSuppressionBuffer(final boolean str | |
|
|
||
| @ParameterizedTest | ||
| @ValueSource(booleans = {true, false}) | ||
| public void shouldAddMetricsForSessionStore(final boolean streamsProtocolEnabled) throws Exception { | ||
| if (streamsProtocolEnabled) { | ||
| streamsConfiguration.put(StreamsConfig.GROUP_PROTOCOL_CONFIG, GroupProtocol.STREAMS.name().toLowerCase(Locale.getDefault())); | ||
| public void shouldAddMetricsForSessionStore(final boolean withHeaders) throws Exception { | ||
| if (withHeaders) { | ||
| streamsConfiguration.put(StreamsConfig.DSL_STORE_FORMAT_CONFIG, StreamsConfig.DSL_STORE_FORMAT_HEADERS); | ||
| } | ||
|
|
||
| final Duration inactivityGap = Duration.ofMillis(50); | ||
|
|
||
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.
Should we add a withHeader parameter to startStreams() for reducing the repeat code ?