Return-Path: X-Original-To: apmail-helix-commits-archive@minotaur.apache.org Delivered-To: apmail-helix-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DD368D8BF for ; Fri, 8 Mar 2013 04:39:49 +0000 (UTC) Received: (qmail 91398 invoked by uid 500); 8 Mar 2013 04:39:48 -0000 Delivered-To: apmail-helix-commits-archive@helix.apache.org Received: (qmail 91365 invoked by uid 500); 8 Mar 2013 04:39:48 -0000 Mailing-List: contact commits-help@helix.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@helix.incubator.apache.org Delivered-To: mailing list commits@helix.incubator.apache.org Received: (qmail 91352 invoked by uid 99); 8 Mar 2013 04:39:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Mar 2013 04:39:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Mar 2013 04:39:44 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 33B692388C64; Fri, 8 Mar 2013 04:38:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1454247 [17/23] - in /incubator/helix/site-content: ./ apidocs/reference/ apidocs/reference/org/apache/helix/ apidocs/reference/org/apache/helix/messaging/handling/ apidocs/reference/org/apache/helix/tools/ apidocs/reference/org/apache/hel... Date: Fri, 08 Mar 2013 04:38:26 -0000 To: commits@helix.incubator.apache.org From: kishoreg@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130308043838.33B692388C64@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: incubator/helix/site-content/xref-test/org/apache/helix/integration/TestAutoRebalancePartitionLimit.html URL: http://svn.apache.org/viewvc/incubator/helix/site-content/xref-test/org/apache/helix/integration/TestAutoRebalancePartitionLimit.html?rev=1454247&r1=1454246&r2=1454247&view=diff ============================================================================== --- incubator/helix/site-content/xref-test/org/apache/helix/integration/TestAutoRebalancePartitionLimit.html (original) +++ incubator/helix/site-content/xref-test/org/apache/helix/integration/TestAutoRebalancePartitionLimit.html Fri Mar 8 04:38:16 2013 @@ -111,173 +111,174 @@ 101 startResult = 102 TestHelper.startDummyProcess(ZK_ADDR, CLUSTER_NAME, instanceName); 103 _startCMResultMap.put(instanceName, startResult); -104 Thread.sleep(1000); +104 Thread.sleep(2000); 105 boolean result = -106 ClusterStateVerifier.verifyByZkCallback(new ExternalViewBalancedVerifier(_zkClient, +106 ClusterStateVerifier.verifyByZkCallback(new ExternalViewBalancedVerifier(_zkClient, 107 CLUSTER_NAME, TEST_DB)); 108 Assert.assertTrue(result); 109 ExternalView ev = manager.getHelixDataAccessor().getProperty(accessor.keyBuilder().externalView(TEST_DB)); -110 if(i < 3) -111 { -112 Assert.assertEquals(ev.getPartitionSet().size(), 25*(i+1)); -113 } -114 else -115 { -116 Assert.assertEquals(ev.getPartitionSet().size(), 100); -117 } -118 } -119 } -120 -121 boolean result = -122 ClusterStateVerifier.verifyByZkCallback(new ExternalViewBalancedVerifier(_zkClient, -123 CLUSTER_NAME, TEST_DB)); -124 -125 Assert.assertTrue(result); -126 } -127 -128 @Test() -129 public void testAutoRebalanceWithMaxPartitionPerNode() throws Exception -130 { -131 String controllerName = CONTROLLER_PREFIX + "_0"; -132 HelixManager manager = _startCMResultMap.get(controllerName)._manager; -133 // kill 1 node -134 String instanceName = PARTICIPANT_PREFIX + "_" + (START_PORT + 0); -135 _startCMResultMap.get(instanceName)._manager.disconnect(); -136 Thread.currentThread().sleep(1000); -137 _startCMResultMap.get(instanceName)._thread.interrupt(); -138 -139 //verifyBalanceExternalView(); -140 boolean result = -141 ClusterStateVerifier.verifyByZkCallback(new ExternalViewBalancedVerifier(_zkClient, -142 CLUSTER_NAME, TEST_DB)); -143 Assert.assertTrue(result); -144 HelixDataAccessor accessor = manager.getHelixDataAccessor(); -145 ExternalView ev = manager.getHelixDataAccessor().getProperty(accessor.keyBuilder().externalView(TEST_DB)); -146 Assert.assertEquals(ev.getPartitionSet().size(), 100); -147 -148 instanceName = PARTICIPANT_PREFIX + "_" + (START_PORT + 1); -149 _startCMResultMap.get(instanceName)._manager.disconnect(); -150 Thread.currentThread().sleep(1000); -151 _startCMResultMap.get(instanceName)._thread.interrupt(); -152 -153 //verifyBalanceExternalView(); -154 result = -155 ClusterStateVerifier.verifyByZkCallback(new ExternalViewBalancedVerifier(_zkClient, -156 CLUSTER_NAME, TEST_DB)); -157 Assert.assertTrue(result); -158 ev = manager.getHelixDataAccessor().getProperty(accessor.keyBuilder().externalView(TEST_DB)); -159 Assert.assertEquals(ev.getPartitionSet().size(), 75); -160 -161 // add 2 nodes -162 for (int i = 0; i < 2; i++) -163 { -164 String storageNodeName = PARTICIPANT_PREFIX + ":" + (1000 + i); -165 _setupTool.addInstanceToCluster(CLUSTER_NAME, storageNodeName); -166 -167 StartCMResult resultx = -168 TestHelper.startDummyProcess(ZK_ADDR, CLUSTER_NAME, storageNodeName.replace(':', '_')); -169 _startCMResultMap.put(storageNodeName, resultx); -170 } -171 Thread.sleep(1000); -172 result = -173 ClusterStateVerifier.verifyByZkCallback(new ExternalViewBalancedVerifier(_zkClient, -174 CLUSTER_NAME, TEST_DB)); -175 Assert.assertTrue(result); -176 } -177 -178 static boolean verifyBalanceExternalView(ZNRecord externalView, int partitionCount, String masterState, int replica, int instances, int maxPerInstance) -179 { -180 Map<String, Integer> masterPartitionsCountMap = new HashMap<String, Integer>(); -181 for(String partitionName : externalView.getMapFields().keySet()) -182 { -183 Map<String, String> assignmentMap = externalView.getMapField(partitionName); -184 //Assert.assertTrue(assignmentMap.size() >= replica); -185 for(String instance : assignmentMap.keySet()) -186 { -187 if(assignmentMap.get(instance).equals(masterState)) -188 { -189 if(!masterPartitionsCountMap.containsKey(instance)) -190 { -191 masterPartitionsCountMap.put(instance, 0); -192 } -193 masterPartitionsCountMap.put(instance, masterPartitionsCountMap.get(instance) + 1); -194 } -195 } -196 } -197 -198 int perInstancePartition = partitionCount / instances; -199 -200 int totalCount = 0; -201 for(String instanceName : masterPartitionsCountMap.keySet()) -202 { -203 int instancePartitionCount = masterPartitionsCountMap.get(instanceName); -204 totalCount += instancePartitionCount; -205 if(!(instancePartitionCount == perInstancePartition || instancePartitionCount == perInstancePartition +1 || instancePartitionCount == maxPerInstance)) -206 { -207 return false; -208 } -209 if(instancePartitionCount == maxPerInstance) -210 { -211 continue; -212 } -213 if(instancePartitionCount == perInstancePartition +1) -214 { -215 if(partitionCount % instances == 0) -216 { -217 return false; -218 } -219 } -220 } -221 if(totalCount == maxPerInstance * instances) -222 { -223 return true; -224 } -225 if(partitionCount != totalCount ) -226 { -227 return false; -228 } -229 return true; -230 -231 } -232 -233 public static class ExternalViewBalancedVerifier implements ZkVerifier -234 { -235 ZkClient _client; -236 String _clusterName; -237 String _resourceName; -238 -239 public ExternalViewBalancedVerifier(ZkClient client, String clusterName, String resourceName) -240 { -241 _client = client; -242 _clusterName = clusterName; -243 _resourceName = resourceName; -244 } -245 @Override -246 public boolean verify() -247 { -248 HelixDataAccessor accessor = new ZKHelixDataAccessor( _clusterName, new ZkBaseDataAccessor(_client)); -249 Builder keyBuilder = accessor.keyBuilder(); -250 int numberOfPartitions = accessor.getProperty(keyBuilder.idealStates(_resourceName)).getRecord().getListFields().size(); -251 ClusterDataCache cache = new ClusterDataCache(); -252 cache.refresh(accessor); -253 String masterValue = cache.getStateModelDef(cache.getIdealState(_resourceName).getStateModelDefRef()).getStatesPriorityList().get(0); -254 int replicas = Integer.parseInt(cache.getIdealState(_resourceName).getReplicas()); -255 return verifyBalanceExternalView(accessor.getProperty(keyBuilder.externalView(_resourceName)).getRecord(), numberOfPartitions, masterValue, replicas, cache.getLiveInstances().size(),cache.getIdealState(_resourceName).getMaxPartitionsPerInstance()); -256 } -257 -258 @Override -259 public ZkClient getZkClient() -260 { -261 return _client; -262 } -263 -264 @Override -265 public String getClusterName() -266 { -267 return _clusterName; -268 } +110 System.out.println(ev.getPartitionSet().size()); +111 if(i < 3) +112 { +113 Assert.assertEquals(ev.getPartitionSet().size(), 25*(i+1)); +114 } +115 else +116 { +117 Assert.assertEquals(ev.getPartitionSet().size(), 100); +118 } +119 } +120 } +121 +122 boolean result = +123 ClusterStateVerifier.verifyByZkCallback(new ExternalViewBalancedVerifier(_zkClient, +124 CLUSTER_NAME, TEST_DB)); +125 +126 Assert.assertTrue(result); +127 } +128 +129 @Test() +130 public void testAutoRebalanceWithMaxPartitionPerNode() throws Exception +131 { +132 String controllerName = CONTROLLER_PREFIX + "_0"; +133 HelixManager manager = _startCMResultMap.get(controllerName)._manager; +134 // kill 1 node +135 String instanceName = PARTICIPANT_PREFIX + "_" + (START_PORT + 0); +136 _startCMResultMap.get(instanceName)._manager.disconnect(); +137 Thread.currentThread().sleep(1000); +138 _startCMResultMap.get(instanceName)._thread.interrupt(); +139 +140 //verifyBalanceExternalView(); +141 boolean result = +142 ClusterStateVerifier.verifyByZkCallback(new ExternalViewBalancedVerifier(_zkClient, +143 CLUSTER_NAME, TEST_DB)); +144 Assert.assertTrue(result); +145 HelixDataAccessor accessor = manager.getHelixDataAccessor(); +146 ExternalView ev = manager.getHelixDataAccessor().getProperty(accessor.keyBuilder().externalView(TEST_DB)); +147 Assert.assertEquals(ev.getPartitionSet().size(), 100); +148 +149 instanceName = PARTICIPANT_PREFIX + "_" + (START_PORT + 1); +150 _startCMResultMap.get(instanceName)._manager.disconnect(); +151 Thread.currentThread().sleep(1000); +152 _startCMResultMap.get(instanceName)._thread.interrupt(); +153 +154 //verifyBalanceExternalView(); +155 result = +156 ClusterStateVerifier.verifyByZkCallback(new ExternalViewBalancedVerifier(_zkClient, +157 CLUSTER_NAME, TEST_DB)); +158 Assert.assertTrue(result); +159 ev = manager.getHelixDataAccessor().getProperty(accessor.keyBuilder().externalView(TEST_DB)); +160 Assert.assertEquals(ev.getPartitionSet().size(), 75); +161 +162 // add 2 nodes +163 for (int i = 0; i < 2; i++) +164 { +165 String storageNodeName = PARTICIPANT_PREFIX + ":" + (1000 + i); +166 _setupTool.addInstanceToCluster(CLUSTER_NAME, storageNodeName); +167 +168 StartCMResult resultx = +169 TestHelper.startDummyProcess(ZK_ADDR, CLUSTER_NAME, storageNodeName.replace(':', '_')); +170 _startCMResultMap.put(storageNodeName, resultx); +171 } +172 Thread.sleep(1000); +173 result = +174 ClusterStateVerifier.verifyByZkCallback(new ExternalViewBalancedVerifier(_zkClient, +175 CLUSTER_NAME, TEST_DB)); +176 Assert.assertTrue(result); +177 } +178 +179 static boolean verifyBalanceExternalView(ZNRecord externalView, int partitionCount, String masterState, int replica, int instances, int maxPerInstance) +180 { +181 Map<String, Integer> masterPartitionsCountMap = new HashMap<String, Integer>(); +182 for(String partitionName : externalView.getMapFields().keySet()) +183 { +184 Map<String, String> assignmentMap = externalView.getMapField(partitionName); +185 //Assert.assertTrue(assignmentMap.size() >= replica); +186 for(String instance : assignmentMap.keySet()) +187 { +188 if(assignmentMap.get(instance).equals(masterState)) +189 { +190 if(!masterPartitionsCountMap.containsKey(instance)) +191 { +192 masterPartitionsCountMap.put(instance, 0); +193 } +194 masterPartitionsCountMap.put(instance, masterPartitionsCountMap.get(instance) + 1); +195 } +196 } +197 } +198 +199 int perInstancePartition = partitionCount / instances; +200 +201 int totalCount = 0; +202 for(String instanceName : masterPartitionsCountMap.keySet()) +203 { +204 int instancePartitionCount = masterPartitionsCountMap.get(instanceName); +205 totalCount += instancePartitionCount; +206 if(!(instancePartitionCount == perInstancePartition || instancePartitionCount == perInstancePartition +1 || instancePartitionCount == maxPerInstance)) +207 { +208 return false; +209 } +210 if(instancePartitionCount == maxPerInstance) +211 { +212 continue; +213 } +214 if(instancePartitionCount == perInstancePartition +1) +215 { +216 if(partitionCount % instances == 0) +217 { +218 return false; +219 } +220 } +221 } +222 if(totalCount == maxPerInstance * instances) +223 { +224 return true; +225 } +226 if(partitionCount != totalCount ) +227 { +228 return false; +229 } +230 return true; +231 +232 } +233 +234 public static class ExternalViewBalancedVerifier implements ZkVerifier +235 { +236 ZkClient _client; +237 String _clusterName; +238 String _resourceName; +239 +240 public ExternalViewBalancedVerifier(ZkClient client, String clusterName, String resourceName) +241 { +242 _client = client; +243 _clusterName = clusterName; +244 _resourceName = resourceName; +245 } +246 @Override +247 public boolean verify() +248 { +249 HelixDataAccessor accessor = new ZKHelixDataAccessor( _clusterName, new ZkBaseDataAccessor(_client)); +250 Builder keyBuilder = accessor.keyBuilder(); +251 int numberOfPartitions = accessor.getProperty(keyBuilder.idealStates(_resourceName)).getRecord().getListFields().size(); +252 ClusterDataCache cache = new ClusterDataCache(); +253 cache.refresh(accessor); +254 String masterValue = cache.getStateModelDef(cache.getIdealState(_resourceName).getStateModelDefRef()).getStatesPriorityList().get(0); +255 int replicas = Integer.parseInt(cache.getIdealState(_resourceName).getReplicas()); +256 return verifyBalanceExternalView(accessor.getProperty(keyBuilder.externalView(_resourceName)).getRecord(), numberOfPartitions, masterValue, replicas, cache.getLiveInstances().size(),cache.getIdealState(_resourceName).getMaxPartitionsPerInstance()); +257 } +258 +259 @Override +260 public ZkClient getZkClient() +261 { +262 return _client; +263 } +264 +265 @Override +266 public String getClusterName() +267 { +268 return _clusterName; 269 } -270 } +270 } +271 }
Added: incubator/helix/site-content/xref-test/org/apache/helix/integration/TestGroupMessage.html URL: http://svn.apache.org/viewvc/incubator/helix/site-content/xref-test/org/apache/helix/integration/TestGroupMessage.html?rev=1454247&view=auto ============================================================================== --- incubator/helix/site-content/xref-test/org/apache/helix/integration/TestGroupMessage.html (added) +++ incubator/helix/site-content/xref-test/org/apache/helix/integration/TestGroupMessage.html Fri Mar 8 04:38:16 2013 @@ -0,0 +1,226 @@ + + + + +TestGroupMessage xref + + + +
+
+1   package org.apache.helix.integration;
+2   
+3   /*
+4    * Licensed to the Apache Software Foundation (ASF) under one
+5    * or more contributor license agreements.  See the NOTICE file
+6    * distributed with this work for additional information
+7    * regarding copyright ownership.  The ASF licenses this file
+8    * to you under the Apache License, Version 2.0 (the
+9    * "License"); you may not use this file except in compliance
+10   * with the License.  You may obtain a copy of the License at
+11   *
+12   *   http://www.apache.org/licenses/LICENSE-2.0
+13   *
+14   * Unless required by applicable law or agreed to in writing,
+15   * software distributed under the License is distributed on an
+16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+17   * KIND, either express or implied.  See the License for the
+18   * specific language governing permissions and limitations
+19   * under the License.
+20   */
+21  
+22  import java.util.Date;
+23  import java.util.List;
+24  
+25  import org.I0Itec.zkclient.IZkChildListener;
+26  import org.apache.helix.TestHelper;
+27  import org.apache.helix.ZNRecord;
+28  import org.apache.helix.PropertyKey.Builder;
+29  import org.apache.helix.manager.zk.ZKHelixDataAccessor;
+30  import org.apache.helix.manager.zk.ZkBaseDataAccessor;
+31  import org.apache.helix.mock.controller.ClusterController;
+32  import org.apache.helix.mock.participant.MockParticipant;
+33  import org.apache.helix.model.IdealState;
+34  import org.apache.helix.tools.ClusterStateVerifier;
+35  import org.apache.helix.tools.ClusterStateVerifier.BestPossAndExtViewZkVerifier;
+36  import org.testng.Assert;
+37  import org.testng.annotations.Test;
+38  
+39  
+40  public class TestGroupMessage extends ZkIntegrationTestBase
+41  {
+42    class TestZkChildListener implements IZkChildListener
+43    {
+44      int _maxNbOfChilds = 0;
+45      
+46      @Override
+47      public void handleChildChange(String parentPath, List<String> currentChilds) throws Exception
+48      {
+49        System.out.println(parentPath + " has " + currentChilds.size() + " messages");
+50        if (currentChilds.size() > _maxNbOfChilds)
+51        {
+52          _maxNbOfChilds = currentChilds.size();
+53        }
+54      }
+55      
+56    }
+57    
+58    @Test
+59    public void testBasic() throws Exception
+60    {
+61      // Logger.getRootLogger().setLevel(Level.INFO);
+62      String className = TestHelper.getTestClassName();
+63      String methodName = TestHelper.getTestMethodName();
+64      String clusterName = className + "_" + methodName;
+65      int n = 2;
+66  
+67      System.out.println("START " + clusterName + " at "
+68          + new Date(System.currentTimeMillis()));
+69  
+70      TestHelper.setupCluster(clusterName, ZK_ADDR, 12918, // participant port
+71                              "localhost", // participant name prefix
+72                              "TestDB", // resource name prefix
+73                              1, // resources
+74                              32, // partitions per resource
+75                              n, // number of nodes
+76                              2, // replicas
+77                              "MasterSlave",
+78                              true); // do rebalance
+79      
+80      // enable group message
+81      ZKHelixDataAccessor accessor = new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_gZkClient));
+82      Builder keyBuilder = accessor.keyBuilder();
+83      IdealState idealState = accessor.getProperty(keyBuilder.idealStates("TestDB0"));
+84      idealState.setGroupMessageMode(true);
+85      accessor.setProperty(keyBuilder.idealStates("TestDB0"), idealState);
+86  
+87      // registry a message listener so we know how many message generated
+88      TestZkChildListener listener = new TestZkChildListener();
+89      _gZkClient.subscribeChildChanges(keyBuilder.messages("localhost_12918").getPath(), listener);
+90  
+91      
+92      ClusterController controller =
+93          new ClusterController(clusterName, "controller_0", ZK_ADDR);
+94      controller.syncStart();
+95  
+96      // start participants
+97      MockParticipant[] participants = new MockParticipant[n];
+98      for (int i = 0; i < n; i++)
+99      {
+100       String instanceName = "localhost_" + (12918 + i);
+101 
+102       participants[i] = new MockParticipant(clusterName, instanceName, ZK_ADDR, null);
+103       participants[i].syncStart();
+104     }
+105 
+106     boolean result =
+107         ClusterStateVerifier.verifyByZkCallback(new BestPossAndExtViewZkVerifier(ZK_ADDR,
+108                                                                                  clusterName));
+109     Assert.assertTrue(result);
+110     Assert.assertTrue(listener._maxNbOfChilds <= 2, "Should get no more than 2 messages (O->S and S->M)");
+111     
+112     // clean up
+113     // wait for all zk callbacks done
+114     Thread.sleep(1000);
+115     controller.syncStop();
+116     for (int i = 0; i < n; i++)
+117     {
+118       participants[i].syncStop();
+119     }
+120 
+121     System.out.println("END " + clusterName + " at "
+122         + new Date(System.currentTimeMillis()));
+123   }
+124   
+125   // a non-group-message run followed by a group-message-enabled run
+126   @Test
+127   public void testChangeGroupMessageMode() throws Exception
+128   {
+129     // Logger.getRootLogger().setLevel(Level.INFO);
+130     String className = TestHelper.getTestClassName();
+131     String methodName = TestHelper.getTestMethodName();
+132     String clusterName = className + "_" + methodName;
+133     int n = 2;
+134 
+135     System.out.println("START " + clusterName + " at "
+136         + new Date(System.currentTimeMillis()));
+137 
+138     TestHelper.setupCluster(clusterName, ZK_ADDR, 12918, // participant port
+139                             "localhost", // participant name prefix
+140                             "TestDB", // resource name prefix
+141                             1, // resources
+142                             32, // partitions per resource
+143                             n, // number of nodes
+144                             2, // replicas
+145                             "MasterSlave",
+146                             true); // do rebalance
+147     
+148     ClusterController controller =
+149         new ClusterController(clusterName, "controller_0", ZK_ADDR);
+150     controller.syncStart();
+151 
+152     // start participants
+153     MockParticipant[] participants = new MockParticipant[n];
+154     for (int i = 0; i < n; i++)
+155     {
+156       String instanceName = "localhost_" + (12918 + i);
+157 
+158       participants[i] = new MockParticipant(clusterName, instanceName, ZK_ADDR, null);
+159       participants[i].syncStart();
+160     }
+161 
+162     boolean result =
+163         ClusterStateVerifier.verifyByZkCallback(new BestPossAndExtViewZkVerifier(ZK_ADDR,
+164                                                                                  clusterName));
+165     Assert.assertTrue(result);
+166     
+167     // stop all participants
+168     Thread.sleep(1000);
+169     for (int i = 0; i < n; i++)
+170     {
+171       participants[i].syncStop();
+172     }
+173     
+174     // enable group message
+175     ZKHelixDataAccessor accessor = new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_gZkClient));
+176     Builder keyBuilder = accessor.keyBuilder();
+177     IdealState idealState = accessor.getProperty(keyBuilder.idealStates("TestDB0"));
+178     idealState.setGroupMessageMode(true);
+179     accessor.setProperty(keyBuilder.idealStates("TestDB0"), idealState);
+180 
+181     // registry a message listener so we know how many message generated
+182     TestZkChildListener listener = new TestZkChildListener();
+183     _gZkClient.subscribeChildChanges(keyBuilder.messages("localhost_12918").getPath(), listener);
+184 
+185     // restart all participants
+186     for (int i = 0; i < n; i++)
+187     {
+188       String instanceName = "localhost_" + (12918 + i);
+189 
+190       participants[i] = new MockParticipant(clusterName, instanceName, ZK_ADDR, null);
+191       participants[i].syncStart();
+192     }
+193     
+194     result =
+195         ClusterStateVerifier.verifyByZkCallback(new BestPossAndExtViewZkVerifier(ZK_ADDR,
+196                                                                                  clusterName));
+197     Assert.assertTrue(result);
+198     Assert.assertTrue(listener._maxNbOfChilds <= 2, "Should get no more than 2 messages (O->S and S->M)");
+199 
+200     
+201     // clean up
+202     // wait for all zk callbacks done
+203     Thread.sleep(1000);
+204     controller.syncStop();
+205     for (int i = 0; i < n; i++)
+206     {
+207       participants[i].syncStop();
+208     }
+209 
+210     System.out.println("END " + clusterName + " at "
+211         + new Date(System.currentTimeMillis()));
+212   }
+213 }
+
+
+ Modified: incubator/helix/site-content/xref-test/org/apache/helix/integration/package-frame.html URL: http://svn.apache.org/viewvc/incubator/helix/site-content/xref-test/org/apache/helix/integration/package-frame.html?rev=1454247&r1=1454246&r2=1454247&view=diff ============================================================================== --- incubator/helix/site-content/xref-test/org/apache/helix/integration/package-frame.html (original) +++ incubator/helix/site-content/xref-test/org/apache/helix/integration/package-frame.html Fri Mar 8 04:38:16 2013 @@ -22,7 +22,7 @@ ErrTransitionWithResetCnt
  • - ExternalViewBalancedVerifier + ExternalViewBalancedVerifier
  • IntegrationTest Modified: incubator/helix/site-content/xref-test/org/apache/helix/integration/package-summary.html URL: http://svn.apache.org/viewvc/incubator/helix/site-content/xref-test/org/apache/helix/integration/package-summary.html?rev=1454247&r1=1454246&r2=1454247&view=diff ============================================================================== --- incubator/helix/site-content/xref-test/org/apache/helix/integration/package-summary.html (original) +++ incubator/helix/site-content/xref-test/org/apache/helix/integration/package-summary.html Fri Mar 8 04:38:16 2013 @@ -47,7 +47,7 @@ - ExternalViewBalancedVerifier + ExternalViewBalancedVerifier Modified: incubator/helix/site-content/xref/allclasses-frame.html URL: http://svn.apache.org/viewvc/incubator/helix/site-content/xref/allclasses-frame.html?rev=1454247&r1=1454246&r2=1454247&view=diff ============================================================================== --- incubator/helix/site-content/xref/allclasses-frame.html (original) +++ incubator/helix/site-content/xref/allclasses-frame.html Fri Mar 8 04:38:16 2013 @@ -306,7 +306,7 @@ CurrentStateResource
  • - CurrentStateUpdate + CurrentStateUpdate
  • CurrentStatesResource @@ -1164,7 +1164,7 @@ Tuple
  • - Type + Type
  • Verifier Modified: incubator/helix/site-content/xref/org/apache/helix/NotificationContext.html URL: http://svn.apache.org/viewvc/incubator/helix/site-content/xref/org/apache/helix/NotificationContext.html?rev=1454247&r1=1454246&r2=1454247&view=diff ============================================================================== --- incubator/helix/site-content/xref/org/apache/helix/NotificationContext.html (original) +++ incubator/helix/site-content/xref/org/apache/helix/NotificationContext.html Fri Mar 8 04:38:16 2013 @@ -44,7 +44,7 @@ 34 private Map<String, Object> _map; 35 36 private HelixManager _manager; -37 private Type _type; +37 private Type _type; 38 private String _pathChanged; 39 private String _eventName; 40 @@ -74,7 +74,7 @@ 64 return _map; 65 } 66 -67 public Type getType() +67 public Type getType() 68 { 69 return _type; 70 } @@ -94,7 +94,7 @@ 84 this._map = map; 85 } 86 -87 public void setType(Type type) +87 public void setType(Type type) 88 { 89 this._type = type; 90 } @@ -104,7 +104,7 @@ 94 return _map.get(key); 95 } 96 -97 public enum Type +97 public enum Type 98 { 99 INIT, CALLBACK, FINALIZE 100 }