Return-Path: Delivered-To: apmail-lucene-hadoop-dev-archive@locus.apache.org Received: (qmail 68341 invoked from network); 11 May 2007 01:29:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 May 2007 01:29:36 -0000 Received: (qmail 18842 invoked by uid 500); 11 May 2007 01:29:42 -0000 Delivered-To: apmail-lucene-hadoop-dev-archive@lucene.apache.org Received: (qmail 18808 invoked by uid 500); 11 May 2007 01:29:42 -0000 Mailing-List: contact hadoop-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hadoop-dev@lucene.apache.org Delivered-To: mailing list hadoop-dev@lucene.apache.org Received: (qmail 18795 invoked by uid 99); 11 May 2007 01:29:42 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 May 2007 18:29:42 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 May 2007 18:29:35 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 8D72D714064 for ; Thu, 10 May 2007 18:29:15 -0700 (PDT) Message-ID: <14047308.1178846955576.JavaMail.jira@brutus> Date: Thu, 10 May 2007 18:29:15 -0700 (PDT) From: "David Bowen (JIRA)" To: hadoop-dev@lucene.apache.org Subject: [jira] Assigned: (HADOOP-558) Adding versioning to Writable classes In-Reply-To: <5591974.1159223030146.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-558?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] David Bowen reassigned HADOOP-558: ---------------------------------- Assignee: Owen O'Malley (was: David Bowen) I'm told that we don't want to do this any more. > Adding versioning to Writable classes > ------------------------------------- > > Key: HADOOP-558 > URL: https://issues.apache.org/jira/browse/HADOOP-558 > Project: Hadoop > Issue Type: Improvement > Components: io > Affects Versions: 0.6.2 > Reporter: Owen O'Malley > Assigned To: Owen O'Malley > > We currently don't have a way to support versioned Writables, which among other problems means that it is very difficult to change the serialization of any types. (A recent example is that we can't change any of the Writables that currently use UTF8.writeString to use Text.writeString with out breaking everything.) Just changing the file version doesn't work because you can't read the old versions. > Therefore, I propose adding a new interface: > public interface VersionMapWritable extends Writable { > /** > * Destructively read into this object from in based on the version map. > * @param versionMap a map from each class to its version in the DataInput (version 0 classes are omitted) > */ > public void readFields(DataInput in, Map, int> versionMap) throws IOException; > /** > * Classes with non-zero versions should register themselves in static blocks. > */ > public static void registerCurrentVersion(Class class, int version) {...} > /** > * If a version map includes the parent type, always include the child type as well. > */ > public static void addDependence(Class parent, Class child) { ... } > /** > * Build a version map for a given list of classes, including any dependent types. > */ > public static Map, int> > buildVersionMap(Set> classes) {...} > /** > * Add the types in the parameter/result types to the list of classes. > * Recursively adds the field types for any new types that are added to the set. > */ > public static void addMethodTypes(Set> result, > Class protocol) {...} > /** > * Add the non-transient fields to the list of classes. > */ > public static void addFieldTypes(Set> result, Class writable) {...} > public static Map, int> readVersionMap(DataInput in) throws IOException { ... } > public static void writeVersionMap(DataOutput out, > Map versionMap) throws IOException {...} > } > VersionedWritable, which stored a version byte within each object, will be depriciated. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.