Hello Attila Bukor, Kudu Jenkins, Andrew Wong, Adar Dembo, Grant Henke,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/14329
to look at the new patch set (#15).
Change subject: [java] KUDU-2971: process communicates via protobuf-based
protocol
......................................................................
[java] KUDU-2971: process communicates via protobuf-based protocol
This commit adds a java tool that can communicate over a stdin/stdout
pipe via protobuf-based protocol. It is useful in cases a Kudu process
(e.g. master) needs to talk to third-party libraries written in Java.
This tool has:
1) a single reader thread that continuously reads protobuf-based
messages from the standard input and puts the messages to a FIFO
blocking queue;
2) multiple writer threads that continuously retrieve the messages
from the queue, process them and write the responses to the standard
output.
IOException is fatal and causes the program to exit, e.g. I/O errors
when reading/writing to the pipe, and parsing malformed protobuf messages.
If encounter InterruptedException during placing/getting messages to/from
the queue, we consider it to be a signal to shutdown the task which
cause the program to exit as well.
To support a new protobuf message type, simply extend the 'ProtocolProcessor'
interface and add the specific ProcessorMain class (similar to
'EchoProcessorMain')
for the message type.
Change-Id: Iaf9ad24dbc9acc681284b6433836271b5b4c7982
---
A java/kudu-subprocess/build.gradle
A
java/kudu-subprocess/src/main/java/org/apache/kudu/subprocess/EchoProtocolHandler.java
A
java/kudu-subprocess/src/main/java/org/apache/kudu/subprocess/EchoSubprocessMain.java
A
java/kudu-subprocess/src/main/java/org/apache/kudu/subprocess/KuduSubprocessException.java
A java/kudu-subprocess/src/main/java/org/apache/kudu/subprocess/MessageIO.java
A
java/kudu-subprocess/src/main/java/org/apache/kudu/subprocess/MessageReader.java
A
java/kudu-subprocess/src/main/java/org/apache/kudu/subprocess/MessageWriter.java
A
java/kudu-subprocess/src/main/java/org/apache/kudu/subprocess/ProtocolHandler.java
A
java/kudu-subprocess/src/main/java/org/apache/kudu/subprocess/SubprocessConfiguration.java
A
java/kudu-subprocess/src/main/java/org/apache/kudu/subprocess/SubprocessExecutor.java
A
java/kudu-subprocess/src/main/java/org/apache/kudu/subprocess/SubprocessOutputStream.java
A java/kudu-subprocess/src/main/resources/log4j2.properties
A
java/kudu-subprocess/src/test/java/org/apache/kudu/subprocess/MessageTestUtil.java
A
java/kudu-subprocess/src/test/java/org/apache/kudu/subprocess/TestEchoSubprocess.java
A
java/kudu-subprocess/src/test/java/org/apache/kudu/subprocess/TestMessageIO.java
M java/settings.gradle
16 files changed, 1,410 insertions(+), 0 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/29/14329/15
--
To view, visit http://gerrit.cloudera.org:8080/14329
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iaf9ad24dbc9acc681284b6433836271b5b4c7982
Gerrit-Change-Number: 14329
Gerrit-PatchSet: 15
Gerrit-Owner: Hao Hao <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Andrew Wong <[email protected]>
Gerrit-Reviewer: Attila Bukor <[email protected]>
Gerrit-Reviewer: Grant Henke <[email protected]>
Gerrit-Reviewer: Hao Hao <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)