-
Notifications
You must be signed in to change notification settings - Fork 594
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
113 additions
and
67 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
31 changes: 31 additions & 0 deletions
31
src/main/java/org/broadinstitute/hellbender/utils/runtime/StreamingToolConstants.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,31 @@ | ||
package org.broadinstitute.hellbender.utils.runtime; | ||
|
||
/** | ||
* Various constants used by StreamingProcessController that require synchronized equivalents in | ||
* the companion process, i.e., if the streaming process is written in Python, there must be | ||
* equivalent Python constants for use by the Python code. | ||
* | ||
* See the equivalents for Python in toolcontants.py. | ||
*/ | ||
public class StreamingToolConstants { | ||
/** | ||
* Command acknowledgement messages used to signal positive acknowledgement ('ack'), | ||
* negative acknowledgement ('nck'), and negative acknowledgement with an accompanying | ||
* message ('nkm'). | ||
*/ | ||
public static String STREAMING_ACK_MESSAGE = "ack"; | ||
public static String STREAMING_NCK_MESSAGE = "nck"; | ||
public static String STREAMING_NCK_WITH_MESSAGE_MESSAGE = "nkm"; | ||
|
||
// This is only used by Java, but is kept here since it represents the length of the constant | ||
// strings defined above. | ||
protected static int STREAMING_ACK_MESSAGE_SIZE = 3; // "ack", "nck", or "nkm" | ||
|
||
/** | ||
* Number of characters used to represent the length of the serialized message, fixed at a constant | ||
* 4 characters to ensure we can deterministically know how much input to wait for when looking for | ||
* a message length in the incoming stream. | ||
*/ | ||
public static int STREAMING_NCK_WITH_MESSAGE_MESSAGE_LEN_SIZE = 4; | ||
public static int STREAMING_NCK_WITH_MESSAGE_MAX_MESSAGE_LENGTH = 9999; | ||
} |
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
22 changes: 22 additions & 0 deletions
22
src/main/python/org/broadinstitute/hellbender/gatktool/toolconstants.py
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,22 @@ | ||
""" | ||
Constants that must remain in sync with the companion StreamingProcessController Java | ||
code in GATK. See StreamingToolConstants.java. | ||
""" | ||
|
||
""" | ||
Command acknowledgement messages used to signal positive acknowledgement ('ack', | ||
negative acknowledgement ('nck'), and negative acknowledgement with an accompanying | ||
message ('nkm'). | ||
""" | ||
_ackString = "ack" | ||
_nackString = "nck" | ||
_nkmString = "nkm" | ||
|
||
|
||
""" | ||
The length of a message written with a negative ack (nkm) must be 4 bytes long when | ||
serialized as a string, and cannot have a value > 9999. | ||
""" | ||
_nckMessageLengthSerializedSize = 4 | ||
_nckMaxMessageLength = 9999 |
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