-
Notifications
You must be signed in to change notification settings - Fork 904
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1584 from real-logic/ingress_unknown_schema_id
[Java ] Delegate decision on unknown schema to consensus agent
- Loading branch information
Showing
9 changed files
with
352 additions
and
45 deletions.
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
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
62 changes: 62 additions & 0 deletions
62
aeron-cluster/src/main/java/io/aeron/cluster/ConsensusModuleExtension.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,62 @@ | ||
/* | ||
* Copyright 2014-2024 Real Logic Limited. | ||
* | ||
* 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 | ||
* | ||
* https://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.aeron.cluster; | ||
|
||
import org.agrona.DirectBuffer; | ||
|
||
import io.aeron.logbuffer.ControlledFragmentHandler; | ||
import io.aeron.logbuffer.Header; | ||
|
||
/** | ||
* Adapter for handling messages from external schemas unknown to core Aeron cluster code | ||
* thus providing an extension to the core ingress Consensus module behaviour | ||
*/ | ||
public interface ConsensusModuleExtension extends AutoCloseable | ||
{ | ||
/** | ||
* schema supported by this extension | ||
* | ||
* @return schema id | ||
*/ | ||
int supportedSchemaId(); | ||
|
||
/** | ||
* Callback for handling fragments of data being read from a log. | ||
* <p> | ||
* Within this callback reentrant calls to the {@link io.aeron.Aeron} client are not permitted and | ||
* will result in undefined behaviour. | ||
* | ||
* @param schemaId the schema id | ||
* @param templateId the message template id (already parsed from header) | ||
* @param buffer containing the data. | ||
* @param offset at which the data begins. | ||
* @param length of the data in bytes. | ||
* @param header representing the metadata for the data. | ||
* @return The action to be taken with regard to the stream position after the callback. | ||
*/ | ||
ControlledFragmentHandler.Action onMessage( | ||
int schemaId, | ||
int templateId, | ||
DirectBuffer buffer, | ||
int offset, | ||
int length, | ||
Header header); | ||
|
||
@Override | ||
default void close() | ||
{ | ||
} | ||
} |
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
Oops, something went wrong.