Return-Path: X-Original-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-mapreduce-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 D35479C6C for ; Wed, 30 Nov 2011 16:18:53 +0000 (UTC) Received: (qmail 53945 invoked by uid 500); 30 Nov 2011 16:18:52 -0000 Delivered-To: apmail-hadoop-mapreduce-user-archive@hadoop.apache.org Received: (qmail 53899 invoked by uid 500); 30 Nov 2011 16:18:52 -0000 Mailing-List: contact mapreduce-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mapreduce-user@hadoop.apache.org Delivered-To: mailing list mapreduce-user@hadoop.apache.org Received: (qmail 53891 invoked by uid 99); 30 Nov 2011 16:18:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Nov 2011 16:18:52 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [178.21.113.224] (HELO office.openindex.io) (178.21.113.224) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Nov 2011 16:18:43 +0000 Received: from localhost (localhost [127.0.0.1]) by office.openindex.io (Postfix) with ESMTP id 926112A214A for ; Wed, 30 Nov 2011 16:20:35 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at office.openindex.io Received: from office.openindex.io ([127.0.0.1]) by localhost (office.openindex.io [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lx6+NdV-0waY for ; Wed, 30 Nov 2011 16:20:26 +0000 (UTC) Received: from midas.localnet (D4B295B2.static.ziggozakelijk.nl [212.178.149.178]) (Authenticated sender: markus.jelsma@openindex.io) by office.openindex.io (Postfix) with ESMTPA id 86B602A2149 for ; Wed, 30 Nov 2011 16:20:26 +0000 (UTC) From: Markus Jelsma Reply-To: markus.jelsma@openindex.io Organization: Openindex To: mapreduce-user@hadoop.apache.org Subject: Re: Renaming WritableComparable and existing SequenceFiles Date: Wed, 30 Nov 2011 17:18:38 +0100 User-Agent: KMail/1.13.5 (Linux/2.6.32-35-generic; KDE/4.4.5; x86_64; ; ) References: <201111301644.49484.markus.jelsma@openindex.io> In-Reply-To: <201111301644.49484.markus.jelsma@openindex.io> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201111301718.38946.markus.jelsma@openindex.io> X-Virus-Checked: Checked by ClamAV on apache.org Solved! Another tool reading the same files expects various childs of WritableComparable and Writable, this of course won't throw a class cast exception. That same tool writes the using the new class. In essence, i already had a converter tool. Thanks On Wednesday 30 November 2011 16:44:49 Markus Jelsma wrote: > Hi, > > I've built some SequenceFiles using a custom WritableComparable. I also > decided to reorganize package structure and ended up renaming the whole > thing. Since the key and value classes are embedded in the file i cannot > read them because it either doesn't exist or cannot be cast in case the > same classname lives in another package name. > > I looked in the Job and SequenceFile and InputFormat API's but i cannot > find something to tell the reader that the class is somewhere else now. > Renaming using a hexeditor doesn't work as well because the package name's > length is different now, leading to a lot of bad exceptions such as > Unknown codec complaints. > > I can still load the file by keeping the original WritableComparable and > write back to disk using the new WritableComparable but that forces me to > write some temporary code. > > How can i tell the reader to use the new (but identical) class for > WritableComparable when loading a SequenceFile? Or do i have to write some > conversion code? > > Thanks -- Markus Jelsma - CTO - Openindex