Package org.apache.helix.manager.zk

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


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

    String message =
        ClusterRepresentationUtil.getClusterPropertyAsString(zkClient,
                                                             clusterName,
View Full Code Here


  {
    try
    {
      String clusterName = (String) getRequest().getAttributes().get("clusterName");
      String resourceName = (String) getRequest().getAttributes().get("resourceName");
      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

    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);
View Full Code Here

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

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

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

  public void removeRepresentations()
  {
    String zkPath = getZKPath();
    try
    {
      ZkClient zkClient =
          (ZkClient) getContext().getAttributes().get(RestAdminApplication.ZKCLIENT);
     
      List<String> childNames = zkClient.getChildren(zkPath);
      if (childNames != null)
      {
        for (String childName : childNames)
        {
          String childPath = zkPath.equals("/")? "/" + childName : zkPath + "/" + childName;
          zkClient.deleteRecursive(childPath);
        }
      }
     
      getResponse().setStatus(Status.SUCCESS_OK);
    }
View Full Code Here

      public void run()
      {
        try
        {
          Thread.sleep(3000);
          final ZkClient zkClient = new ZkClient(ZK_ADDR);
          zkClient.setZkSerializer(new ZNRecordSerializer());
          zkClient.createPersistent(pathChild1, true);
          zkClient.writeData(pathChild1, record);
        }
        catch (InterruptedException e)
        {
          // TODO Auto-generated catch block
          e.printStackTrace();
View Full Code Here

  public void beforeClass()
  {
    System.out.println("START " + getShortClassName() + " at "
        + new Date(System.currentTimeMillis()));

    _zkClient = new ZkClient(ZK_ADDR);
    _zkClient.setZkSerializer(new ZNRecordSerializer());
    if (_zkClient.exists(PREFIX))
    {
      _zkClient.deleteRecursive(PREFIX);
    }
View Full Code Here

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

    String message =
        ClusterRepresentationUtil.getClusterPropertyAsString(zkClient,
                                                             clusterName,
View Full Code Here

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

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

  ZkClient _zkClient;

  @BeforeClass
  public void beforeClass()
  {
    _zkClient = new ZkClient(ZK_ADDR);
    _zkClient.setZkSerializer(new ZNRecordSerializer());
  }
View Full Code Here

TOP

Related Classes of org.apache.helix.manager.zk.ZkClient

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.