diff --git hcatalog/streaming/src/java/org/apache/hive/hcatalog/streaming/StreamingConnection.java hcatalog/streaming/src/java/org/apache/hive/hcatalog/streaming/StreamingConnection.java index 8785a21..a8f4089 100644 --- hcatalog/streaming/src/java/org/apache/hive/hcatalog/streaming/StreamingConnection.java +++ hcatalog/streaming/src/java/org/apache/hive/hcatalog/streaming/StreamingConnection.java @@ -22,6 +22,8 @@ /** * Represents a connection to a HiveEndPoint. Used to acquire transaction batches. + * Note: the expectation is that there is at most 1 TransactionBatch outstanding for any given + * StreamingConnection. Violating this may result in "out of sequence response". */ public interface StreamingConnection { diff --git hcatalog/streaming/src/java/org/apache/hive/hcatalog/streaming/TransactionBatch.java hcatalog/streaming/src/java/org/apache/hive/hcatalog/streaming/TransactionBatch.java index 3c8670d..b7b31db 100644 --- hcatalog/streaming/src/java/org/apache/hive/hcatalog/streaming/TransactionBatch.java +++ hcatalog/streaming/src/java/org/apache/hive/hcatalog/streaming/TransactionBatch.java @@ -24,8 +24,12 @@ /** * Represents a set of Transactions returned by Hive. Supports opening, writing to * and commiting/aborting each transaction. The interface is designed to ensure - * transactions in a batch are used up sequentially. Multiple transaction batches can be - * used (initialized with separate RecordWriters) for concurrent streaming + * transactions in a batch are used up sequentially. To stream to the same HiveEndPoint + * concurrently, create separate StreamingConnections. + * + * Note on thread safety: At most 2 threads can run through a given TransactionBatch at the same + * time. One thread may call {@link #heartbeat()} and the other all other methods. + * Violating this may result in "out of sequence response". * */ public interface TransactionBatch {