Return-Path: Delivered-To: apmail-lucene-hadoop-dev-archive@locus.apache.org Received: (qmail 7870 invoked from network); 29 Jun 2006 01:51:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Jun 2006 01:51:12 -0000 Received: (qmail 81735 invoked by uid 500); 29 Jun 2006 01:51:11 -0000 Delivered-To: apmail-lucene-hadoop-dev-archive@lucene.apache.org Received: (qmail 81674 invoked by uid 500); 29 Jun 2006 01:51:10 -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 81639 invoked by uid 99); 29 Jun 2006 01:51:09 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Jun 2006 18:51:09 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Jun 2006 18:51:08 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 991B7410008 for ; Thu, 29 Jun 2006 01:49:31 +0000 (GMT) Message-ID: <15481880.1151545771624.JavaMail.jira@brutus> Date: Thu, 29 Jun 2006 01:49:31 +0000 (GMT+00:00) From: "Konstantin Shvachko (JIRA)" To: hadoop-dev@lucene.apache.org Subject: [jira] Commented: (HADOOP-321) DatanodeInfo refactoring In-Reply-To: <20976373.1151024969902.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 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HADOOP-321?page=comments#action_12418366 ] Konstantin Shvachko commented on HADOOP-321: -------------------------------------------- In fact DatanodeDescriptor needs everything that it inherits from DatanodeInfo even the Writable.read() and Writable.write(). The last two are going to be used for logging and check pointing of DatanodeDescriptor-s. What is not used in DatanodeDescriptor is the Writable factory, because descriptors are not meant to be used in RPC communications. That is why the factory is defined for DatanodeInfo but not for the descriptor class. So if we go the composition way we will particularly need to implement Writable for DatanodeDescriptor, the only purpose of which would be to call the DatanodeInfo Writable methods. Why? With inheritance it is already there. And the same applies to all other methods. A few words about the bug that caused this discussion. I did not realize that RPC sends classes based on the actual object instances rather than on the type declarations. So DatanodeDescriptor was sent even though the variable was declared as DatanodeInfo. The receiving side then was not able to instantiate the received DatanodeDescriptor class because the factory is not defined for it. DatanodeInfo was expected to be received. > DatanodeInfo refactoring > ------------------------ > > Key: HADOOP-321 > URL: http://issues.apache.org/jira/browse/HADOOP-321 > Project: Hadoop > Type: Improvement > Components: dfs > Reporter: Konstantin Shvachko > Assignee: Konstantin Shvachko > Fix For: 0.5.0 > Attachments: DatanodeInfo_refactor.patch, DatanodeInfo_refactor3.patch > > I'm trying to refactor some name node classes, which seem to be similar. > So DatanodeInfo is a public api now for purely external ( to name node) use. > The name node class that stores information about data nodes including the > set of its blocks is called DatanodeDescriptor. > The DatanodeReport is removed since it was a variation of DatanodeInfo. > Previously DatanodeInfo and DatanodeDescriptor were the same class, and > DatanodeReport was used for reporting node statistics only. > This is a preparation step for HADOOP-306. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira