Return-Path: X-Original-To: apmail-storm-user-archive@minotaur.apache.org Delivered-To: apmail-storm-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BC79D10500 for ; Wed, 8 Jan 2014 07:25:34 +0000 (UTC) Received: (qmail 82189 invoked by uid 500); 8 Jan 2014 07:25:30 -0000 Delivered-To: apmail-storm-user-archive@storm.apache.org Received: (qmail 81896 invoked by uid 500); 8 Jan 2014 07:25:24 -0000 Mailing-List: contact user-help@storm.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@storm.incubator.apache.org Delivered-To: mailing list user@storm.incubator.apache.org Received: (qmail 81888 invoked by uid 99); 8 Jan 2014 07:25:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Jan 2014 07:25:22 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of churylin@gmail.com designates 74.125.82.53 as permitted sender) Received: from [74.125.82.53] (HELO mail-wg0-f53.google.com) (74.125.82.53) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Jan 2014 07:25:18 +0000 Received: by mail-wg0-f53.google.com with SMTP id k14so1081852wgh.20 for ; Tue, 07 Jan 2014 23:24:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=D5PcsVM0dc+axbhIQoJ76H+lt7rmxv0oiyC4Wc5Psu4=; b=fXomQLJxXFQxx4zO/z9O4MM9B1oGryZzBAg7NQD3ePZXDmnmwEcPgG+baDBRRHP178 wmD/IQp7WyaTmdFOFiGCN66PNqlD7RCnyRCq2ph171LbbKwUTGYIu9/biJNC0aWochBY yhqBpzICSUT3XmlZn9N4WJB1YJ4ssbMlh+aYWQ2EGQ6zQzEfOCLuC9pY9avODFW6OruG ReB0VuPiqhe3uci7wxT5YBbpWs0KPgCt5RxPXutXtKyzF5i3S3jhlPcYBIEyVe+xtcn9 CsjaZY2OvcTr7b7/ezmDwPpV7qjXM2XvcAEPicJwE0D0OnIYqhkjrXKHq8xIJhrN7wsg IsxA== MIME-Version: 1.0 X-Received: by 10.180.21.166 with SMTP id w6mr9701720wie.31.1389165896954; Tue, 07 Jan 2014 23:24:56 -0800 (PST) Received: by 10.216.12.129 with HTTP; Tue, 7 Jan 2014 23:24:56 -0800 (PST) Date: Wed, 8 Jan 2014 15:24:56 +0800 Message-ID: Subject: questions about multilang bolt's STDIN&STDOUT From: churly lin To: user Content-Type: multipart/alternative; boundary=047d7b6d9a86d277fa04ef706396 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b6d9a86d277fa04ef706396 Content-Type: text/plain; charset=ISO-8859-1 Hi all, I am trying to write a topology with a KafkaSpout and a ShellBolt(implemented by python ). According to the Multilang-protocol, multilang uses json messages over stdin/stdout to communicate with the subprocess. Specially, *both ends of this protocol use a line-reading mechanism. *Does it mean that, in multilang, we could not emit message as byte array? If not, how to read a byte array tuple in a python bolt ? the json which was read by python bolt is look like: { "command": "emit", // The id for the tuple. Leave this out for an unreliable emit. The id can // be a string or a number. "id": "1231231", // The id of the stream this tuple was emitted to. Leave this empty to emit to default stream. "stream": "1", // If doing an emit direct, indicate the task to send the tuple to "task": 9, // All the values in this tuple "tuple": ["field1", 2, 3]} This example shows that, the "tuple" can be String("field1") and number(2, 3). Could it be a byte array? --047d7b6d9a86d277fa04ef706396 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi all,
I am trying to write a topology with a Kafka= Spout and a ShellBolt(implemented by python ).
According to the=A0Multilang-pro= tocol, multilang=A0uses json messages over stdin/stdout to communicate with the subprocess. S= pecially, both ends of this protocol use a line-reading mechanism. D= oes it mean that, in multilang, we could not emit message as byte array? If= not, how to read a byte array tuple in a python bolt ?
the json which was read by python bolt is look like= :
{
        "command": =
"emit",
        // The id =
for the tuple. Leave this out for an unreliable emit. The id can
    // be a string=
 or a number.
        "id": "=
;1231231",
        // The id =
of the stream this tuple was emitted to. Leave this empty to emit to defaul=
t stream.
        "stream": &=
quot;1",
        // If doin=
g an emit direct, indicate the task to send the tuple to
        "task": 9,
        // All the=
 values in this tuple
        "tuple": [&=
quot;field1", 2, 3]}
This example shows that, the &quo= t;tuple" can be String("field1") and number(2, 3). Could it = be a byte array?
--047d7b6d9a86d277fa04ef706396--