Return-Path: Delivered-To: apmail-hadoop-core-dev-archive@www.apache.org Received: (qmail 44004 invoked from network); 18 Sep 2008 14:45:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Sep 2008 14:45:38 -0000 Received: (qmail 76615 invoked by uid 500); 18 Sep 2008 14:45:33 -0000 Delivered-To: apmail-hadoop-core-dev-archive@hadoop.apache.org Received: (qmail 76330 invoked by uid 500); 18 Sep 2008 14:45:32 -0000 Mailing-List: contact core-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-dev@hadoop.apache.org Delivered-To: mailing list core-dev@hadoop.apache.org Received: (qmail 76309 invoked by uid 99); 18 Sep 2008 14:45:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Sep 2008 07:45:32 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Sep 2008 14:44:41 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 78561234C1E1 for ; Thu, 18 Sep 2008 07:44:44 -0700 (PDT) Message-ID: <161835833.1221749084491.JavaMail.jira@brutus> Date: Thu, 18 Sep 2008 07:44:44 -0700 (PDT) From: "Tom White (JIRA)" To: core-dev@hadoop.apache.org Subject: [jira] Commented: (HADOOP-3788) Add serialization for Protocol Buffers In-Reply-To: <1835532878.1216378952154.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HADOOP-3788?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12632229#action_12632229 ] Tom White commented on HADOOP-3788: ----------------------------------- bq. the OutputStream when serializing would need meta data included in it I don't think we want to invent a new format here - this issue is to make serialization work with existing formats, such as SequenceFile (or the new TFile, or HADOOP-4065). As an experiment, I modified PBDeserializer to have a deserialize method that takes a length (+in+ is now a CodedInputStream): {code} public T deserialize(T t, int length) throws IOException { t = (t == null) ? (T) newInstance() : t; int limit = in.pushLimit(length); Message result = t.newBuilderForType().mergeFrom(in).build(); in.popLimit(limit); return (T) result; } {code} I then modified TestPBSerializationIsolated to serialize two strings to the stream. When using the deserialize method that doesn't take a length the test failed, but when I passed the length the test succeeded. So, I think we can do this without modifying Protocol Buffers. The change needed is the new method on Deserializer (and Serializer?) that takes a length, and then changes in the framework to call the new method when appropriate. > Add serialization for Protocol Buffers > -------------------------------------- > > Key: HADOOP-3788 > URL: https://issues.apache.org/jira/browse/HADOOP-3788 > Project: Hadoop Core > Issue Type: Wish > Components: examples, mapred > Affects Versions: 0.19.0 > Reporter: Tom White > Assignee: Alex Loddengaard > Fix For: 0.19.0 > > Attachments: hadoop-3788-v1.patch, hadoop-3788-v2.patch, protobuf-java-2.0.1.jar > > > Protocol Buffers (http://code.google.com/p/protobuf/) are a way of encoding data in a compact binary format. This issue is to write a ProtocolBuffersSerialization to support using Protocol Buffers types in MapReduce programs, including an example program. This should probably go into contrib. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.