Examples of ZkClient


Examples of org.apache.helix.manager.zk.ZkClient

  {
    try
    {
      String clusterName = (String) getRequest().getAttributes().get("clusterName");
      String instanceName = (String) getRequest().getAttributes().get("instanceName");
      ZkClient zkClient =
          (ZkClient) getContext().getAttributes().get(RestAdminApplication.ZKCLIENT);

      ClusterSetup setupTool = new ClusterSetup(zkClient);
      setupTool.dropInstanceFromCluster(clusterName, instanceName);
      getResponse().setStatus(Status.SUCCESS_OK);
View Full Code Here

Examples of org.apache.helix.manager.zk.ZkClient

 
  StringRepresentation getSchedulerTasksRepresentation() throws JsonGenerationException, JsonMappingException, IOException
  {
    String clusterName = (String)getRequest().getAttributes().get("clusterName");
    String instanceName = (String)getRequest().getAttributes().get("instanceName");
    ZkClient zkClient = (ZkClient)getContext().getAttributes().get(RestAdminApplication.ZKCLIENT);
    ClusterSetup setupTool = new ClusterSetup(zkClient);
    List<String> instances = setupTool.getClusterManagementTool().getInstancesInCluster(clusterName);
   
    HelixDataAccessor accessor = ClusterRepresentationUtil.getClusterDataAccessor(zkClient, clusterName);
    LiveInstance liveInstance = accessor.getProperty(accessor.keyBuilder().liveInstance(instanceName));
View Full Code Here

Examples of org.apache.helix.manager.zk.ZkClient

  {
    try
    {
      String clusterName = (String)getRequest().getAttributes().get("clusterName");
      Form form = new Form(entity);
      ZkClient zkClient = (ZkClient)getContext().getAttributes().get(RestAdminApplication.ZKCLIENT);
     
      String msgTemplateString = ClusterRepresentationUtil.getFormJsonParameterString(form, MESSAGETEMPLATE);
      if(msgTemplateString == null)
      {
        throw new HelixException("SchedulerTasksResource need to have MessageTemplate specified.");
View Full Code Here

Examples of org.apache.helix.manager.zk.ZkClient

  StringRepresentation getControllerRepresentation(String clusterName) throws JsonGenerationException,
      JsonMappingException,
      IOException
  {
    Builder keyBuilder = new PropertyKey.Builder(clusterName);
    ZkClient zkClient =
        (ZkClient) getContext().getAttributes().get(RestAdminApplication.ZKCLIENT);

    ZKHelixDataAccessor accessor =
        new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(zkClient));
View Full Code Here

Examples of org.apache.helix.manager.zk.ZkClient

  public void acceptRepresentation(Representation entity)
  {
    try
    {
      String clusterName = (String) getRequest().getAttributes().get("clusterName");
      ZkClient zkClient =
          (ZkClient) getContext().getAttributes().get(RestAdminApplication.ZKCLIENT);
      ClusterSetup setupTool = new ClusterSetup(zkClient);

      JsonParameters jsonParameters = new JsonParameters(entity);
      String command = jsonParameters.getCommand();
View Full Code Here

Examples of org.apache.helix.manager.zk.ZkClient

    return presentation;
  }

  StringRepresentation getInstanceErrorsRepresentation( String clusterName, String instanceName) throws JsonGenerationException, JsonMappingException, IOException
  {
    ZkClient zkClient = (ZkClient)getContext().getAttributes().get(RestAdminApplication.ZKCLIENT);
    String instanceSessionId = ClusterRepresentationUtil.getInstanceSessionId(zkClient, clusterName, instanceName);
   
    String message = ClusterRepresentationUtil.getInstancePropertyNameListAsString(zkClient, clusterName, instanceName, PropertyType.CURRENTSTATES, instanceSessionId, MediaType.APPLICATION_JSON);

    StringRepresentation representation = new StringRepresentation(message, MediaType.APPLICATION_JSON);
View Full Code Here

Examples of org.apache.helix.manager.zk.ZkClient

    options.addOption(uSuffix);
  }

  public ZKDumper(String zkAddress)
  {
    client = new ZkClient(zkAddress, ZkClient.DEFAULT_CONNECTION_TIMEOUT);
    ZkSerializer zkSerializer = new ZkSerializer()
    {

      @Override
      public byte[] serialize(Object arg0) throws ZkMarshallingError
View Full Code Here

Examples of org.apache.helix.manager.zk.ZkClient

    try
    {
      JsonParameters jsonParameters = new JsonParameters(entity);
      String command = jsonParameters.getCommand();

      ZkClient zkClient =
          (ZkClient) getContext().getAttributes().get(RestAdminApplication.ZKCLIENT);
     
      if (command.equalsIgnoreCase(JsonParameters.ZK_DELETE_CHILDREN))
      {
        List<String> childNames = zkClient.getChildren(zkPath);
        if (childNames != null)
        {
          for (String childName : childNames)
          {
            String childPath = zkPath.equals("/")? "/" + childName : zkPath + "/" + childName;
            zkClient.deleteRecursive(childPath);
          }
        }
      }
      else
      {
View Full Code Here

Examples of org.apache.helix.manager.zk.ZkClient

    StringRepresentation presentation = null;
    String zkPath = getZKPath();

    try
    {
      ZkClient zkClient =
          (ZkClient) getContext().getAttributes().get(RestAdminApplication.ZKCLIENT);
      ZNRecord result = readZkDataStatAndChild(zkPath, zkClient);

      presentation =
          new StringRepresentation(ClusterRepresentationUtil.ZNRecordToJson(result),
View Full Code Here

Examples of org.apache.helix.manager.zk.ZkClient

  public void removeRepresentations()
  {
    String zkPath = getZKPath();
    try
    {
      ZkClient zkClient =
          (ZkClient) getContext().getAttributes().get(RestAdminApplication.ZKCLIENT);
      zkClient.deleteRecursive(zkPath);
     
      getResponse().setStatus(Status.SUCCESS_OK);
    }
    catch (Exception e)
    {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.