Package org.apache.hdt.core.internal.model

Examples of org.apache.hdt.core.internal.model.ZooKeeperServer


  /**
   * @param zkServerName
   * @param uri
   */
  public ZooKeeperServer createServer(String zkServerName, String zkServerLocation) {
    ZooKeeperServer zkServer = HadoopFactory.eINSTANCE.createZooKeeperServer();
    zkServer.setName(zkServerName);
    zkServer.setUri(zkServerLocation);
    getServers().add(zkServer);
    HadoopManager.INSTANCE.saveServers();
    return zkServer;
  }
View Full Code Here


      @SuppressWarnings("rawtypes")
      Iterator itr = sSelection.iterator();
      while (itr.hasNext()) {
        Object object = itr.next();
        if (object instanceof ZooKeeperServer) {
          ZooKeeperServer r = (ZooKeeperServer) object;
          if (logger.isDebugEnabled())
            logger.debug("Deleting: " + r);
          try {
            ZooKeeperManager.INSTANCE.disconnect(r);
          } finally {
View Full Code Here

      Iterator itr = sSelection.iterator();
      while (itr.hasNext()) {
        Object object = itr.next();
        enabled = false;
        if (object instanceof ZooKeeperServer) {
          ZooKeeperServer server = (ZooKeeperServer) object;
          enabled = server != null;
        } else if (object instanceof ZNode) {
          ZNode zkn = (ZNode) object;
          enabled = zkn != null;
        }
View Full Code Here

      @SuppressWarnings("rawtypes")
      Iterator itr = sSelection.iterator();
      while (itr.hasNext()) {
        Object object = itr.next();
        if (object instanceof ZooKeeperServer) {
          ZooKeeperServer zks = (ZooKeeperServer) object;
          enabled = zks.getStatusCode() == ServerStatus.CONNECTED_VALUE;
        } else
          enabled = object instanceof ZNode;
      }
    } else
      enabled = false;
View Full Code Here

   * .Object, org.eclipse.jface.viewers.IDecoration)
   */
  @Override
  public void decorate(Object element, IDecoration decoration) {
    if (element instanceof ZooKeeperServer) {
      ZooKeeperServer zks = (ZooKeeperServer) element;

      // Image decorations
      if (zks.getStatusCode() == ServerStatus.DISCONNECTED_VALUE)
        decoration.addOverlay(org.apache.hdt.ui.Activator.IMAGE_OFFLINE_OVR);
      else
        decoration.addOverlay(org.apache.hdt.ui.Activator.IMAGE_ONLINE_OVR);

      // Text decorations
      decoration.addSuffix("  " + zks.getUri());
    } else if (element instanceof ZNode) {
      ZNode zkn = (ZNode) element;
      if (zkn.getVersion() > -1) {
        decoration.addSuffix("  [v=" + zkn.getVersion() + "]");
      }
View Full Code Here

      @SuppressWarnings("rawtypes")
      Iterator itr = sSelection.iterator();
      while (itr.hasNext()) {
        Object object = itr.next();
        if (object instanceof ZooKeeperServer) {
          ZooKeeperServer r = (ZooKeeperServer) object;
          if(logger.isDebugEnabled())
            logger.debug("Reconnecting: "+r);
          ZooKeeperManager.INSTANCE.reconnect(r);
          if(logger.isDebugEnabled())
            logger.debug("Reconnected: "+r);
View Full Code Here

      @SuppressWarnings("rawtypes")
      Iterator itr = sSelection.iterator();
      while (itr.hasNext()) {
        Object object = itr.next();
        if (object instanceof ZooKeeperServer) {
          ZooKeeperServer server = (ZooKeeperServer) object;
          try {
            enabled = server == null ? false : server.getStatusCode() == ServerStatus.DISCONNECTED_VALUE;
          } catch (Throwable t) {
            enabled = false;
          }
        } else
          enabled = false;
View Full Code Here

  }

  @Override
  public String getText(Object element) {
    if (element instanceof ZooKeeperServer) {
      ZooKeeperServer zks = (ZooKeeperServer) element;
      return zks.getName();
    }
    if (element instanceof ZNode)
      return ((ZNode) element).getNodeName();
    return null;
  }
View Full Code Here

      @SuppressWarnings("rawtypes")
      Iterator itr = sSelection.iterator();
      while (itr.hasNext()) {
        Object object = itr.next();
        if (object instanceof ZooKeeperServer) {
          ZooKeeperServer r = (ZooKeeperServer) object;
          if(logger.isDebugEnabled())
            logger.debug("Disconnecting: "+r);
          ZooKeeperManager.INSTANCE.disconnect(r);
          if(logger.isDebugEnabled())
            logger.debug("Disconnected: "+r);
View Full Code Here

      @SuppressWarnings("rawtypes")
      Iterator itr = sSelection.iterator();
      while (itr.hasNext()) {
        Object object = itr.next();
        if (object instanceof ZooKeeperServer) {
          ZooKeeperServer server = (ZooKeeperServer) object;
          try {
            enabled = server == null ? false : server.getStatusCode() != ServerStatus.DISCONNECTED_VALUE;
          } catch (Throwable t) {
            enabled = false;
          }
        } else
          enabled = false;
View Full Code Here

TOP

Related Classes of org.apache.hdt.core.internal.model.ZooKeeperServer

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.