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.
Signed-off-by: Rishabh Maurya <[email protected]>
- Loading branch information
1 parent
e472e7e
commit cccfa05
Showing
4 changed files
with
45 additions
and
17 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
35 changes: 35 additions & 0 deletions
35
libs/arrow-spi/src/main/java/org/opensearch/arrow/spi/StreamTicketFactory.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,35 @@ | ||
/* | ||
* 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.arrow.spi; | ||
|
||
import org.opensearch.common.annotation.ExperimentalApi; | ||
|
||
/** | ||
* Factory interface for creating and managing StreamTicket instances. | ||
* This factory provides methods to create and deserialize StreamTickets, | ||
* ensuring consistent ticket creation. | ||
*/ | ||
@ExperimentalApi | ||
public interface StreamTicketFactory { | ||
/** | ||
* Generates a new StreamTicket | ||
* | ||
* @return A new StreamTicket instance | ||
*/ | ||
StreamTicket generateTicket(); | ||
|
||
/** | ||
* Deserializes a StreamTicket from its byte representation. | ||
* | ||
* @param bytes The byte array containing the serialized ticket data | ||
* @return A StreamTicket instance reconstructed from the byte array | ||
* @throws IllegalArgumentException if bytes is null or invalid | ||
*/ | ||
StreamTicket fromBytes(byte[] bytes); | ||
} |