Package org.apache.blur.manager.clusterstatus

Examples of org.apache.blur.manager.clusterstatus.ZookeeperClusterStatus


    final ZooKeeper zooKeeper = ZkUtils.newZooKeeper(zkConnectionStr, sessionTimeout);

    BlurUtil.setupZookeeper(zooKeeper, configuration.get(BLUR_CLUSTER_NAME));

    final ZookeeperClusterStatus clusterStatus = new ZookeeperClusterStatus(zooKeeper, configuration);

    final BlurIndexRefresher refresher = new BlurIndexRefresher();
    refresher.init();

    BlurFilterCache filterCache = getFilterCache(configuration);
View Full Code Here


    final ZooKeeper zooKeeper = ZkUtils.newZooKeeper(zkConnectionStr, sessionTimeout);

    //@TODO this is confusing because controllers are in a cluster by default, but they see all the shards clusters.
    BlurUtil.setupZookeeper(zooKeeper, BlurConstants.BLUR_CLUSTER);

    final ZookeeperClusterStatus clusterStatus = new ZookeeperClusterStatus(zooKeeper, configuration);

    int timeout = configuration.getInt(BLUR_CONTROLLER_SHARD_CONNECTION_TIMEOUT, 60000);
    BlurControllerServer.BlurClient client = new BlurControllerServer.BlurClientRemote(timeout);

    final BlurControllerServer controllerServer = new BlurControllerServer();
View Full Code Here

    job.setNumReduceTasks(getNumReducers(configuration));
    return job;
  }

  private void checkTable() throws IOException {
    ZookeeperClusterStatus status = new ZookeeperClusterStatus(_zooKeeper);
    // check if table exists
    String cluster = _tableDescriptor.cluster;
    String table = _tableDescriptor.name;
    if (!status.exists(false, cluster, table)) {
      throw new RuntimeException("Table [" + table + "] in cluster [" + cluster + "] does not exist.");
    }
    // check if table is locked
    try {
      List<String> children = _zooKeeper.getChildren(ZookeeperPathConstants.getLockPath(cluster, table), false);
View Full Code Here

    final ZooKeeper zooKeeper = ZkUtils.newZooKeeper(zkConnectionStr, sessionTimeout);

    BlurUtil.setupZookeeper(zooKeeper, null);

    final ZookeeperClusterStatus clusterStatus = new ZookeeperClusterStatus(zooKeeper, configuration);

    int timeout = configuration.getInt(BLUR_CONTROLLER_SHARD_CONNECTION_TIMEOUT, 60000);
    BlurControllerServer.BlurClient client = new BlurControllerServer.BlurClientRemote(timeout);

    final BlurControllerServer controllerServer = new BlurControllerServer();
View Full Code Here

    final ZooKeeper zooKeeper = ZkUtils.newZooKeeper(zkConnectionStr, sessionTimeout);

    String cluster = configuration.get(BLUR_CLUSTER_NAME, BLUR_CLUSTER);
    BlurUtil.setupZookeeper(zooKeeper, cluster);

    final ZookeeperClusterStatus clusterStatus = new ZookeeperClusterStatus(zooKeeper, configuration);

    final BlurIndexRefresher refresher = new BlurIndexRefresher();

    BlurFilterCache filterCache = getFilterCache(configuration);
    BlurIndexWarmup indexWarmup = BlurIndexWarmup.getIndexWarmup(configuration);
View Full Code Here

    } else { // in dev mode
      blurConfig = new BlurConfiguration(false);
      setDevelopmentZookeeperConnection();
      setDevelopmentProperties();
    }
    zk = new ZookeeperClusterStatus(blurConfig.get("blur.zookeeper.connection"), blurConfig);
    blurConnection = buildConnectionString();
    port = blurConfig.getInt("blur.console.port", DEFAULT_PORT);
    parseSecurity();
    setupProvider();
  }
View Full Code Here

public class NodeUtil {

  @SuppressWarnings("unchecked")
  public static Map<String, Object> getControllerStatus() throws IOException {
    ZookeeperClusterStatus zk = Config.getZookeeper();

    List<String> allControllers = new ArrayList<String>();
    List<String> oControllers = new ArrayList<String>();
    allControllers = zk.getOnlineControllerList();
    oControllers = zk.getControllerServerList();

    Collection<String> onlineControllers = CollectionUtils.intersection(allControllers, oControllers);
    Collection<String> offlineControllers = CollectionUtils.subtract(allControllers, oControllers);

    Map<String, Object> data = new HashMap<String, Object>();
View Full Code Here

    return data;
  }

  public static List<Map<String, Object>> getClusterStatus() throws IOException {
    ZookeeperClusterStatus zk = Config.getZookeeper();

    List<Map<String, Object>> data = new ArrayList<Map<String, Object>>();
    List<String> clusters = zk.getClusterList(false);

    for (String cluster : clusters) {
      Map<String, Object> clusterObj = new HashMap<String, Object>();
      clusterObj.put("name", cluster);

      List<String> offlineShardServers = zk.getOfflineShardServers(false, cluster);
      List<String> onlineShardServers = zk.getOnlineShardServers(false, cluster);

      clusterObj.put("online", onlineShardServers);
      clusterObj.put("offline", offlineShardServers);

      data.add(clusterObj);
View Full Code Here

TOP

Related Classes of org.apache.blur.manager.clusterstatus.ZookeeperClusterStatus

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.