-
Notifications
You must be signed in to change notification settings - Fork 15.4k
KAFKA-5876: IQ should throw different exceptions for different errors(part 1) #8200
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 hidden or 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
...ms/src/main/java/org/apache/kafka/streams/errors/InvalidStateStorePartitionException.java
This file contains hidden or 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 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You 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 org.apache.kafka.streams.errors; | ||
|
|
||
| import org.apache.kafka.streams.KafkaStreams; | ||
|
|
||
| /** | ||
| * Indicates that the specific state store being queried via | ||
| * {@link org.apache.kafka.streams.StoreQueryParameters} used a partitioning that is not assigned to this instance. | ||
| * You can use {@link KafkaStreams#allMetadata()} to discover the correct instance that hosts the requested partition. | ||
| */ | ||
| public class InvalidStateStorePartitionException extends InvalidStateStoreException { | ||
|
|
||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| public InvalidStateStorePartitionException(final String message) { | ||
| super(message); | ||
| } | ||
|
|
||
| public InvalidStateStorePartitionException(final String message, final Throwable throwable) { | ||
| super(message, throwable); | ||
| } | ||
|
|
||
| } |
37 changes: 37 additions & 0 deletions
37
streams/src/main/java/org/apache/kafka/streams/errors/StateStoreMigratedException.java
This file contains hidden or 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,37 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You 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 org.apache.kafka.streams.errors; | ||
|
|
||
| /** | ||
| * Indicates that the state store being queried is closed although the Kafka Streams state is | ||
| * {@link org.apache.kafka.streams.KafkaStreams.State#RUNNING RUNNING} or | ||
| * {@link org.apache.kafka.streams.KafkaStreams.State#REBALANCING REBALANCING}. | ||
| * This could happen because the store moved to some other instance during a rebalance so | ||
| * rediscovery of the state store is required before retrying. | ||
| */ | ||
| public class StateStoreMigratedException extends InvalidStateStoreException { | ||
|
|
||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| public StateStoreMigratedException(final String message) { | ||
| super(message); | ||
| } | ||
|
|
||
| public StateStoreMigratedException(final String message, final Throwable throwable) { | ||
| super(message, throwable); | ||
| } | ||
| } |
37 changes: 37 additions & 0 deletions
37
streams/src/main/java/org/apache/kafka/streams/errors/StateStoreNotAvailableException.java
This file contains hidden or 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,37 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You 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 org.apache.kafka.streams.errors; | ||
|
|
||
| /** | ||
| * Indicates that the state store being queried is already closed. This could happen when Kafka Streams is in | ||
| * {@link org.apache.kafka.streams.KafkaStreams.State#PENDING_SHUTDOWN PENDING_SHUTDOWN} or | ||
| * {@link org.apache.kafka.streams.KafkaStreams.State#NOT_RUNNING NOT_RUNNING} or | ||
| * {@link org.apache.kafka.streams.KafkaStreams.State#ERROR ERROR} state. | ||
| */ | ||
| public class StateStoreNotAvailableException extends InvalidStateStoreException { | ||
|
|
||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| public StateStoreNotAvailableException(final String message) { | ||
| super(message); | ||
| } | ||
|
|
||
| public StateStoreNotAvailableException(final String message, final Throwable throwable) { | ||
| super(message, throwable); | ||
| } | ||
|
|
||
| } |
37 changes: 37 additions & 0 deletions
37
streams/src/main/java/org/apache/kafka/streams/errors/StreamsNotStartedException.java
This file contains hidden or 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,37 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You 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 org.apache.kafka.streams.errors; | ||
|
|
||
| import org.apache.kafka.streams.KafkaStreams; | ||
|
|
||
| /** | ||
| * Indicates that Kafka Streams is in state {@link KafkaStreams.State#CREATED CREATED} and thus state stores cannot be queries yet. | ||
| * To query state stores, it's required to first start Kafka Streams via {@link KafkaStreams#start()}. | ||
| * You can retry to query the state after the state transitioned to {@link KafkaStreams.State#RUNNING RUNNING}. | ||
| */ | ||
| public class StreamsNotStartedException extends InvalidStateStoreException { | ||
|
|
||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| public StreamsNotStartedException(final String message) { | ||
| super(message); | ||
| } | ||
|
|
||
| public StreamsNotStartedException(final String message, final Throwable throwable) { | ||
| super(message, throwable); | ||
| } | ||
| } |
35 changes: 35 additions & 0 deletions
35
streams/src/main/java/org/apache/kafka/streams/errors/StreamsRebalancingException.java
This file contains hidden or 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,35 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You 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 org.apache.kafka.streams.errors; | ||
|
|
||
| /** | ||
| * Indicates that Kafka Streams is in state {@link org.apache.kafka.streams.KafkaStreams.State#REBALANCING REBALANCING} and thus | ||
| * cannot be queried by default. You can retry to query after the rebalance finished. As an alternative, you can also query | ||
| * (potentially stale) state stores during a rebalance via {@link org.apache.kafka.streams.StoreQueryParameters#enableStaleStores()}. | ||
| */ | ||
| public class StreamsRebalancingException extends InvalidStateStoreException { | ||
|
|
||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| public StreamsRebalancingException(final String message) { | ||
| super(message); | ||
| } | ||
|
|
||
| public StreamsRebalancingException(final String message, final Throwable throwable) { | ||
| super(message, throwable); | ||
| } | ||
| } |
35 changes: 35 additions & 0 deletions
35
streams/src/main/java/org/apache/kafka/streams/errors/UnknownStateStoreException.java
This file contains hidden or 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,35 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You 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 org.apache.kafka.streams.errors; | ||
|
|
||
| /** | ||
| * Indicates that the state store being queried is unknown, i.e., the state store does either not exist in your topology | ||
| * or it is not queryable. | ||
| */ | ||
| public class UnknownStateStoreException extends InvalidStateStoreException { | ||
|
|
||
| private static final long serialVersionUID = 1L; | ||
|
|
||
| public UnknownStateStoreException(final String message) { | ||
| super(message); | ||
| } | ||
|
|
||
| public UnknownStateStoreException(final String message, final Throwable throwable) { | ||
| super(message, throwable); | ||
| } | ||
|
|
||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.