Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/helix


Project: http://git-wip-us.apache.org/repos/asf/helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/7fca871c
Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/7fca871c
Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/7fca871c

Branch: refs/heads/master
Commit: 7fca871c1c43e473be6b7b37b5619f9f1ebdbd4c
Parents: d5a4caf 300d27e
Author: Kanak Biscuitwala <[email protected]>
Authored: Wed Jan 22 14:52:01 2014 -0800
Committer: Kanak Biscuitwala <[email protected]>
Committed: Wed Jan 22 14:52:01 2014 -0800

----------------------------------------------------------------------
 README.md                                       |  19 +-
 helix-core/pom.xml                              |   8 +-
 .../controller/GenericHelixController.java      |  13 +-
 .../stages/ExternalViewComputeStage.java        |  26 +-
 .../DistClusterControllerElection.java          |   8 +-
 .../java/org/apache/helix/tools/ZkGrep.java     | 641 +++++++++++++++++++
 .../org/apache/helix/tools/ZkLogAnalyzer.java   | 444 -------------
 .../TestClusterStatusMonitorLifecycle.java      | 250 ++++++++
 hpost-review.sh                                 |   2 +-
 pom.xml                                         |  27 +-
 recipes/rabbitmq-consumer-group/README.md       |   2 +-
 .../src/site/markdown/Building.md               |   4 +-
 .../src/site/markdown/Quickstart.md             |   8 +-
 .../0.6.1-incubating/src/site/markdown/index.md |   2 +-
 .../src/site/markdown/recipes/lock_manager.md   |   4 +-
 .../markdown/recipes/rabbitmq_consumer_group.md |   6 +-
 .../recipes/rsync_replicated_file_store.md      |   4 +-
 .../site/markdown/recipes/service_discovery.md  |   4 +-
 .../site/markdown/recipes/task_dag_execution.md |   4 +-
 .../src/site/markdown/tutorial_messaging.md     |   2 +-
 .../src/site/markdown/tutorial_propstore.md     |   2 +-
 website/0.6.1-incubating/src/site/site.xml      |  10 +-
 .../src/site/xdoc/download.xml.vm               |   2 +-
 .../src/site/markdown/Building.md               |   4 +-
 .../src/site/markdown/Quickstart.md             |   8 +-
 .../0.6.2-incubating/src/site/markdown/index.md |   2 +-
 .../src/site/markdown/recipes/lock_manager.md   |   4 +-
 .../markdown/recipes/rabbitmq_consumer_group.md |   6 +-
 .../recipes/rsync_replicated_file_store.md      |   4 +-
 .../site/markdown/recipes/service_discovery.md  |   4 +-
 .../site/markdown/recipes/task_dag_execution.md |   4 +-
 .../src/site/markdown/tutorial_admin.md         |  10 +-
 .../src/site/markdown/tutorial_messaging.md     |   2 +-
 .../src/site/markdown/tutorial_propstore.md     |   2 +-
 .../src/site/markdown/tutorial_yaml.md          |   2 +-
 website/0.6.2-incubating/src/site/site.xml      |  10 +-
 .../src/site/xdoc/download.xml.vm               |   2 +-
 .../src/site/markdown/Building.md               |   4 +-
 .../src/site/markdown/Quickstart.md             |   8 +-
 .../0.7.0-incubating/src/site/markdown/index.md |   2 +-
 .../src/site/markdown/recipes/lock_manager.md   |   4 +-
 .../markdown/recipes/rabbitmq_consumer_group.md |   6 +-
 .../recipes/rsync_replicated_file_store.md      |   4 +-
 .../site/markdown/recipes/service_discovery.md  |   4 +-
 .../site/markdown/recipes/task_dag_execution.md |   4 +-
 .../markdown/recipes/user_def_rebalancer.md     |  16 +-
 .../src/site/markdown/tutorial_accessors.md     |  12 +-
 .../src/site/markdown/tutorial_admin.md         |  10 +-
 .../src/site/markdown/tutorial_messaging.md     |   2 +-
 .../src/site/markdown/tutorial_propstore.md     |   2 +-
 .../markdown/tutorial_user_def_rebalancer.md    |   4 +-
 .../src/site/markdown/tutorial_yaml.md          |   2 +-
 website/0.7.0-incubating/src/site/site.xml      |  10 +-
 .../src/site/xdoc/download.xml.vm               |   2 +-
 website/pom.xml                                 |   4 +-
 website/src/site/apt/releasing.apt              |  22 +-
 website/src/site/markdown/index.md              |  18 +-
 .../src/site/markdown/involved/contribdocs.md   |   4 +-
 website/src/site/markdown/sources.md            |   6 +-
 website/src/site/site.xml                       |   6 +-
 website/src/site/xdoc/download.xml.vm           |   2 +-
 website/trunk/src/site/markdown/Building.md     |   4 +-
 website/trunk/src/site/markdown/Quickstart.md   |   8 +-
 website/trunk/src/site/markdown/index.md        |   2 +-
 .../src/site/markdown/recipes/lock_manager.md   |   4 +-
 .../markdown/recipes/rabbitmq_consumer_group.md |   6 +-
 .../recipes/rsync_replicated_file_store.md      |   4 +-
 .../site/markdown/recipes/service_discovery.md  |   4 +-
 .../site/markdown/recipes/task_dag_execution.md |   4 +-
 .../markdown/recipes/user_def_rebalancer.md     |  16 +-
 .../src/site/markdown/tutorial_accessors.md     |  12 +-
 .../trunk/src/site/markdown/tutorial_admin.md   |  10 +-
 .../src/site/markdown/tutorial_messaging.md     |   2 +-
 .../src/site/markdown/tutorial_propstore.md     |   2 +-
 .../markdown/tutorial_user_def_rebalancer.md    |   4 +-
 .../trunk/src/site/markdown/tutorial_yaml.md    |   2 +-
 website/trunk/src/site/site.xml                 |  10 +-
 website/trunk/src/site/xdoc/download.xml.vm     |   2 +-
 78 files changed, 1130 insertions(+), 680 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/helix/blob/7fca871c/helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
----------------------------------------------------------------------
diff --cc 
helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
index 7b19574,b15627a..28a5b06
--- 
a/helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
+++ 
b/helix-core/src/main/java/org/apache/helix/controller/GenericHelixController.java
@@@ -549,26 -528,12 +544,34 @@@ public class GenericHelixController imp
      _lastSeenSessions.set(curSessions);
  
    }
 -  
 +
+   public void shutdownClusterStatusMonitor(String clusterName) {
+     if (_clusterStatusMonitor != null) {
+       logger.info("Shut down _clusterStatusMonitor for cluster " + 
clusterName);
 -       _clusterStatusMonitor.reset();
 -       _clusterStatusMonitor = null;
++      _clusterStatusMonitor.reset();
++      _clusterStatusMonitor = null;
++    }
++  }
++
 +  private class ClusterEventProcessor extends Thread {
 +    @Override
 +    public void run() {
 +      logger.info("START ClusterEventProcessor thread");
 +      while (!isInterrupted()) {
 +        try {
 +          ClusterEvent event = _eventQueue.take();
 +          handleEvent(event);
 +        } catch (InterruptedException e) {
 +          logger.warn("ClusterEventProcessor interrupted", e);
 +          interrupt();
 +        } catch (ZkInterruptedException e) {
 +          logger.warn("ClusterEventProcessor caught a ZK connection 
interrupt", e);
 +          interrupt();
 +        } catch (Throwable t) {
 +          logger.error("ClusterEventProcessor failed while running the 
controller pipeline", t);
 +        }
 +      }
 +      logger.info("END ClusterEventProcessor thread");
      }
    }
  }

http://git-wip-us.apache.org/repos/asf/helix/blob/7fca871c/helix-core/src/main/java/org/apache/helix/controller/stages/ExternalViewComputeStage.java
----------------------------------------------------------------------
diff --cc 
helix-core/src/main/java/org/apache/helix/controller/stages/ExternalViewComputeStage.java
index 977b661,dddb0c0..a15e6b3
--- 
a/helix-core/src/main/java/org/apache/helix/controller/stages/ExternalViewComputeStage.java
+++ 
b/helix-core/src/main/java/org/apache/helix/controller/stages/ExternalViewComputeStage.java
@@@ -113,19 -116,16 +116,18 @@@ public class ExternalViewComputeStage e
          }
        }
  
-       // TODO fix this
        // Update cluster status monitor mbean
-       // ClusterStatusMonitor clusterStatusMonitor =
-       // (ClusterStatusMonitor) event.getAttribute("clusterStatusMonitor");
-       // IdealState idealState = 
cache._idealStateMap.get(view.getResourceName());
-       // if (idealState != null) {
-       // if (clusterStatusMonitor != null
-       // && !idealState.getStateModelDefRef().equalsIgnoreCase(
-       // DefaultSchedulerMessageHandlerFactory.SCHEDULER_TASK_QUEUE)) {
-       // clusterStatusMonitor.onExternalViewChange(view,
-       // cache._idealStateMap.get(view.getResourceName()));
-       // }
-       // }
 -       ClusterStatusMonitor clusterStatusMonitor = (ClusterStatusMonitor) 
event.getAttribute("clusterStatusMonitor");
 -       Resource currentResource = 
cluster.getResourceMap().get(view.getResourceId());
 -       if (currentResource != null) {
 -         IdealState idealState = currentResource.getIdealState();
 -         if (clusterStatusMonitor != null && 
 -             
!idealState.getStateModelDefRef().equalsIgnoreCase(DefaultSchedulerMessageHandlerFactory.SCHEDULER_TASK_QUEUE))
 {
 -         clusterStatusMonitor.onExternalViewChange(view, idealState);
 -         }
 -       }
++      ClusterStatusMonitor clusterStatusMonitor =
++          (ClusterStatusMonitor) event.getAttribute("clusterStatusMonitor");
++      Resource currentResource = 
cluster.getResourceMap().get(view.getResourceId());
++      if (currentResource != null) {
++        IdealState idealState = currentResource.getIdealState();
++        if (clusterStatusMonitor != null
++            && !idealState.getStateModelDefRef().equalsIgnoreCase(
++                DefaultSchedulerMessageHandlerFactory.SCHEDULER_TASK_QUEUE)) {
++          clusterStatusMonitor.onExternalViewChange(view, idealState);
++        }
++      }
  
        // compare the new external view with current one, set only on different
        ExternalView curExtView = curExtViews.get(resourceId.stringify());

Reply via email to