Examples of updateProperty()


Examples of org.apache.helix.HelixDataAccessor.updateProperty()

    LiveInstance instance = helixDataAccessor.getProperty(propertyKey);

    Map<String, String> map = new TreeMap<String, String>();
    map.put("k1", "v1");
    instance.getRecord().setMapField("test", map);
    Assert.assertTrue(helixDataAccessor.updateProperty(propertyKey, instance),
        "Failed to update live instance node");

    instances = changeList.poll(1, TimeUnit.SECONDS);
    Assert.assertNotNull(instances, "Expecting a list of live instance");
    Assert.assertEquals(instances.get(0).getRecord().getMapField("test"), map, "Wrong map data.");
View Full Code Here

Examples of org.apache.helix.HelixDataAccessor.updateProperty()

    // find a task
    for (String resource : _admin.getResourcesInCluster(_clusterName)) {
      IdealState is = _admin.getResourceIdealState(_clusterName, resource);
      if (is.getStateModelDefRef().equals(TaskConstants.STATE_MODEL_NAME)) {
        HelixDataAccessor accessor = _manager.getHelixDataAccessor();
        accessor.updateProperty(accessor.keyBuilder().idealStates(resource), is);
        break;
      }
    }
  }
View Full Code Here

Examples of org.apache.helix.HelixDataAccessor.updateProperty()

          accessor.getProperty(
              keyBuilder.controllerTaskStatus(MessageType.SCHEDULER_MSG.toString(), _message
                  .getMessageId().stringify())).getRecord();

      statusUpdate.getMapFields().put("SentMessageCount", sendSummary);
      accessor.updateProperty(keyBuilder.controllerTaskStatus(MessageType.SCHEDULER_MSG.toString(),
          _message.getMessageId().stringify()), new StatusUpdate(statusUpdate));
    }

    private int findTopPartitionId(IdealState currentTaskQueue) {
      int topId = 0;
View Full Code Here

Examples of org.apache.helix.HelixDataAccessor.updateProperty()

   * @param resource the name of the resource changed to triggering the execution
   */
  public static void invokeRebalance(HelixManager manager, String resource) {
    // The pipeline is idempotent, so touching an ideal state is enough to trigger a pipeline run
    HelixDataAccessor accessor = manager.getHelixDataAccessor();
    accessor.updateProperty(accessor.keyBuilder().idealStates(resource), new IdealState(resource));
  }

  /**
   * Get a ScheduleConfig from a workflow config string map
   * @param cfg the string map
View Full Code Here

Examples of org.apache.helix.HelixDataAccessor.updateProperty()

          summary.put("CompletedMessages", "" + completedTasksNum);

          controllerStatusUpdate.getRecord().setMapField("Summary", summary);
        }
        // Update the statusUpdate of controllerMsgId
        accessor.updateProperty(controllerStatusUpdateKey, controllerStatusUpdate);
      }
    }

    if (finishedTasks.getListFields().size() > 0) {
      ZNRecordDelta znDelta = new ZNRecordDelta(finishedTasks, MergeOperation.SUBTRACT);
View Full Code Here

Examples of org.apache.helix.HelixDataAccessor.updateProperty()

      IdealState delta = new IdealState(resourceId);
      delta.setDeltaList(deltaList);

      // Remove the finished (COMPLETED or ERROR) tasks from the SCHEDULER_TASK_RESOURCE idealstate
      keyBuilder = accessor.keyBuilder();
      accessor.updateProperty(keyBuilder.idealStates(resourceId.stringify()), delta);
    }
  }

}
View Full Code Here

Examples of org.apache.helix.manager.zk.ZKHelixDataAccessor.updateProperty()

    {
      idealState.getRecord().setSimpleField(i + "", bufStr);
    }
    // System.out.println("record: " + idealState.getRecord());
    succeed =
        accessor.updateProperty(keyBuilder.idealStates("TestDB1"), idealState);
    Assert.assertFalse(succeed);
    recordNew =
        accessor.getProperty(keyBuilder.idealStates("TestDB1")).getRecord();
    arr = serializer.serialize(record);
    arrNew = serializer.serialize(recordNew);
View Full Code Here

Examples of org.apache.helix.manager.zk.ZKHelixDataAccessor.updateProperty()

    {
      idealState.getRecord().setSimpleField(i + "", bufStr);
    }
    // System.out.println("record: " + idealState.getRecord());
    succeed =
        accessor.updateProperty(keyBuilder.idealStates("TestDB_2"),
                                                                 idealState);
    Assert.assertFalse(succeed);
    recordNew =
        accessor.getProperty(keyBuilder.idealStates("TestDB_2")).getRecord();
    arr = serializer.serialize(record);
View Full Code Here

Examples of org.apache.helix.manager.zk.ZKHelixDataAccessor.updateProperty()

    for (int i = 900; i < 1024; i++) {
      idealState.getRecord().setSimpleField(i + "", bufStr);
    }
    // System.out.println("record: " + idealState.getRecord());
    succeed = accessor.updateProperty(keyBuilder.idealStates("TestDB_2"), idealState);
    Assert.assertFalse(succeed);
    recordNew = accessor.getProperty(keyBuilder.idealStates("TestDB_2")).getRecord();
    arr = serializer.serialize(record);
    arrNew = serializer.serialize(recordNew);
    Assert.assertTrue(Arrays.equals(arr, arrNew));
View Full Code Here

Examples of org.apache.helix.manager.zk.ZKHelixDataAccessor.updateProperty()

    idealState.setNumPartitions(10);
    for (int i = 900; i < 1024; i++) {
      idealState.getRecord().setSimpleField(i + "", bufStr);
    }
    // System.out.println("record: " + idealState.getRecord());
    succeed = accessor.updateProperty(keyBuilder.idealStates("TestDB1"), idealState);
    Assert.assertFalse(succeed);
    recordNew = accessor.getProperty(keyBuilder.idealStates("TestDB1")).getRecord();
    arr = serializer.serialize(record);
    arrNew = serializer.serialize(recordNew);
    Assert.assertTrue(Arrays.equals(arr, arrNew));
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.