Return-Path: X-Original-To: apmail-incubator-hama-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-hama-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AB36298C1 for ; Thu, 15 Mar 2012 12:15:59 +0000 (UTC) Received: (qmail 74560 invoked by uid 500); 15 Mar 2012 12:15:59 -0000 Delivered-To: apmail-incubator-hama-dev-archive@incubator.apache.org Received: (qmail 74498 invoked by uid 500); 15 Mar 2012 12:15:59 -0000 Mailing-List: contact hama-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hama-dev@incubator.apache.org Delivered-To: mailing list hama-dev@incubator.apache.org Received: (qmail 74484 invoked by uid 99); 15 Mar 2012 12:15:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Mar 2012 12:15:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Mar 2012 12:15:58 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 48B7A21125 for ; Thu, 15 Mar 2012 12:15:38 +0000 (UTC) Date: Thu, 15 Mar 2012 12:15:38 +0000 (UTC) From: "Edward J. Yoon (Commented) (JIRA)" To: hama-dev@incubator.apache.org Message-ID: <1892711006.18736.1331813738299.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1576816078.809.1328144753168.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (HAMA-499) Refactor clearZKNodes() in BSPMaster MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HAMA-499?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13230097#comment-13230097 ] Edward J. Yoon commented on HAMA-499: ------------------------------------- Sorry, I can't check right now. But, if I remember correctly, depth 2 (or 3) nodes won't deleted. So I wrote 3 nested for loop. And remained nodes in memory were really problematic. > Refactor clearZKNodes() in BSPMaster > ------------------------------------ > > Key: HAMA-499 > URL: https://issues.apache.org/jira/browse/HAMA-499 > Project: Hama > Issue Type: Improvement > Components: bsp > Affects Versions: 0.4.0 > Reporter: Edward J. Yoon > Labels: newbie > Fix For: 0.5.0 > > Attachments: HAMA-499.patch, HAMA-499_2.patch, move.sh > > > As you know, Hama uses ZooKeepr for a barrier synchronization. User can use Hama ZK, or their own existing ZK cluster. To avoid some potential problems, BSPMaster calls clearZKNodes() to delete all remained sub-nodes of 'bspRoot' at initialization stage. That code is here and very ugly: > {code} > public void clearZKNodes() { > try { > for (String node : zk.getChildren(bspRoot, this)) { > for (String subnode : zk.getChildren(bspRoot + "/" + node, this)) { > for (String subnode2 : zk.getChildren(bspRoot + "/" + node, this)) { > for (String subnode3 : zk.getChildren(bspRoot + "/" + node + "/" + subnode2, this)) { > zk.delete(bspRoot + "/" + node + "/" + subnode + "/" + subnode2 + "/" + subnode3, 0); > } > zk.delete(bspRoot + "/" + node + "/" + subnode + "/" + subnode2, 0); > } > zk.delete(bspRoot + "/" + node + "/" + subnode, 0); > } > zk.delete(bspRoot + "/" + node, 0); > } > } catch (KeeperException e) { > } catch (InterruptedException e) { > } > } > {code} > In this issue, we'll refactor this method. For example, you can delete recursively. > P.S., must use '-1' to delete all version of each node like this: > {code} > zk.delete(node, -1); > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira