forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding support for handling multiple transport protocols (opensearch-…
…project#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]> Signed-off-by: Shivansh Arora <[email protected]>
- Loading branch information
Showing
18 changed files
with
1,010 additions
and
570 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.