-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Backport 2.x] Adding support for handling multiple transport protoco…
…ls (#12967) (#13125) * Adding support for handling multiple transport protocols (#12967) * Adding support for more than one protocol for transport Signed-off-by: Vacha Shah <[email protected]> * Adding CHANGELOG entry Signed-off-by: Vacha Shah <[email protected]> * Addressing comments Signed-off-by: Vacha Shah <[email protected]> * Addressing comments Signed-off-by: Vacha Shah <[email protected]> * Removing determineTransportProtocol Signed-off-by: Vacha Shah <[email protected]> * Determine transport protocol only on first byte reference Signed-off-by: Vacha Shah <[email protected]> * Making InboundBytesHandler closeable Signed-off-by: Vacha Shah <[email protected]> * Fixing close() for InboundPipeline Signed-off-by: Vacha Shah <[email protected]> * Adding DeprecatedAPI annotation to japicmp task Signed-off-by: Vacha Shah <[email protected]> * Fixing for detect breaking changes workflow Signed-off-by: Vacha Shah <[email protected]> * Fixing recursion Signed-off-by: Vacha Shah <[email protected]> --------- Signed-off-by: Vacha Shah <[email protected]> * Fixing precommit for 2.x Signed-off-by: Vacha Shah <[email protected]> --------- Signed-off-by: Vacha Shah <[email protected]>
- Loading branch information
Showing
19 changed files
with
1,011 additions
and
571 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
32 changes: 32 additions & 0 deletions
32
server/src/main/java/org/opensearch/transport/InboundBytesHandler.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,32 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.transport; | ||
|
||
import org.opensearch.common.bytes.ReleasableBytesReference; | ||
|
||
import java.io.Closeable; | ||
import java.io.IOException; | ||
import java.util.function.BiConsumer; | ||
|
||
/** | ||
* Interface for handling inbound bytes. Can be implemented by different transport protocols. | ||
*/ | ||
public interface InboundBytesHandler extends Closeable { | ||
|
||
public void doHandleBytes( | ||
TcpChannel channel, | ||
ReleasableBytesReference reference, | ||
BiConsumer<TcpChannel, ProtocolInboundMessage> messageHandler | ||
) throws IOException; | ||
|
||
public boolean canHandleBytes(ReleasableBytesReference reference); | ||
|
||
@Override | ||
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
Oops, something went wrong.