Return-Path: Delivered-To: apmail-hadoop-hbase-dev-archive@locus.apache.org Received: (qmail 84911 invoked from network); 23 Jul 2008 16:41:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Jul 2008 16:41:23 -0000 Received: (qmail 65810 invoked by uid 500); 23 Jul 2008 16:41:23 -0000 Delivered-To: apmail-hadoop-hbase-dev-archive@hadoop.apache.org Received: (qmail 65694 invoked by uid 500); 23 Jul 2008 16:41:22 -0000 Mailing-List: contact hbase-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hbase-dev@hadoop.apache.org Delivered-To: mailing list hbase-dev@hadoop.apache.org Received: (qmail 65580 invoked by uid 99); 23 Jul 2008 16:41:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Jul 2008 09:41:22 -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; Wed, 23 Jul 2008 16:40:36 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D60AA234C177 for ; Wed, 23 Jul 2008 09:40:31 -0700 (PDT) Message-ID: <965440703.1216831231875.JavaMail.jira@brutus> Date: Wed, 23 Jul 2008 09:40:31 -0700 (PDT) From: "Jean-Daniel Cryans (JIRA)" To: hbase-dev@hadoop.apache.org Subject: [jira] Commented: (HBASE-765) Adding basic Spring support to IndexConfiguration class. In-Reply-To: <1186764590.1216830992317.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/HBASE-765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12616153#action_12616153 ] Jean-Daniel Cryans commented on HBASE-765: ------------------------------------------ See http://wiki.apache.org/hadoop/Hbase/HowToContribute on how to make a patch. > Adding basic Spring support to IndexConfiguration class. > -------------------------------------------------------- > > Key: HBASE-765 > URL: https://issues.apache.org/jira/browse/HBASE-765 > Project: Hadoop HBase > Issue Type: Improvement > Components: mapred > Affects Versions: 0.16.0, 0.1.0, 0.1.1, 0.1.2, 0.1.3 > Environment: n/a > Reporter: Ryan Smith > Fix For: 0.2.0, 0.2.1, 0.3.0, 0.1.4 > > Original Estimate: 0.33h > Remaining Estimate: 0.33h > > Spring can configure classes/object graphs via xml. I am pretty much able to configure the entire MR object graph to launch MR jobs via spring except class IndexConfiguration.java. So instead of only using addFromXML() to configure IndexConfiguration, it would be nice to add support so Spring could set all class variables needed for initialization in IndexConfiguration without invoking addFromXML(). > Since the class IndexConfiguration already has setters and getters for almost all its members, it's almost compliant for a spring configuration bean except one issue: no ability to configure columnMap outside of calling addFromXML(). The easiest way i can figure is to allow a setter for the column map and put any logic for checking the map integrity there. By adding these 2 methods to IndexConfiguration.java , it should solve the issue. > public void setColumnConfs(List columnConfList) { > setColumnConfs(columnConfList, true); > } > > public void setColumnConfs(List columnConfList, boolean override) { > for (ColumnConf columnConf: columnConfList) { > if (columnConf.getProperty(HBASE_COLUMN_NAME) != null) { > if (getColumnMap().containsKey(columnConf.getProperty(HBASE_COLUMN_NAME)) ) { > if (override) { > log.info("overwriting an exisitng column name map."); > this.columnMap.put(columnConf.getProperty(HBASE_COLUMN_NAME), columnConf); > } > } else { > log.info("adding columnConf for: " + columnConf.getProperty(HBASE_COLUMN_NAME)); > this.columnMap.put(columnConf.getProperty(HBASE_COLUMN_NAME), columnConf); > } > } else { > log.warn("bad column conf: name not specified"); > } > } > } > We could possibly also have addFromXML() reference these new methods to add config to columnMap or refactor out logic into another method so addFromXML and setColumnConfs share the same logic. > Ive never submitted a patch via JIRA before so if i need to do something else, please met me know. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.