Package com.linkedin.helix.PropertyKey

Examples of com.linkedin.helix.PropertyKey.Builder.idealStates()


    ZKHelixDataAccessor accessor = new ZKHelixDataAccessor(clusterName, baseAccessor);
    // String idealStatePath = PropertyPathConfig.getPath(PropertyType.IDEALSTATES, clusterName, "TestDB0");
    Builder keyBuilder = accessor.keyBuilder();
    IdealState idealState = accessor.getProperty(keyBuilder.idealStates("TestDB0"));
    idealState.setBucketSize(1);
    accessor.setProperty(keyBuilder.idealStates("TestDB0"), idealState);

    TestHelper.startController(clusterName,
                               "controller_0",
                               ZK_ADDR,
                               HelixControllerMain.STANDALONE);
View Full Code Here


  {
    ZKHelixDataAccessor accessor =
        new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor(zkClient));
    Builder keyBuilder = accessor.keyBuilder();

    IdealState idealState = accessor.getProperty(keyBuilder.idealStates(resource));
    for (String partitionName : idealState.getPartitionSet())
    {
      if (idealState.getIdealStateMode() == IdealStateModeProperty.AUTO)
      {
        AssertJUnit.assertEquals(repl, idealState.getPreferenceList(partitionName).size());
View Full Code Here

      idealState.setIdealStateMode(IdealStateModeProperty.AUTO.toString());
      idealState.setNumPartitions(partitions);
      idealStates.add(idealState);

      // System.out.println(idealState);
      accessor.setProperty(keyBuilder.idealStates(resourceName), idealState);
    }
    return idealStates;
  }

  protected void setupLiveInstances(String clusterName, int[] liveInstances)
View Full Code Here

    for (int i = 0; i < 1024; i++)
    {
      idealState.getRecord().setSimpleField(i + "", bufStr);
    }
    boolean succeed = accessor.setProperty(keyBuilder.idealStates("TestDB0"), idealState);
    Assert.assertFalse(succeed);
    HelixProperty property =
        accessor.getProperty(keyBuilder.stateTransitionStatus("localhost_12918",
                                                              "session_1",
                                                              "partition_1"));
View Full Code Here

    for (int i = 0; i < 900; i++)
    {
      idealState.getRecord().setSimpleField(i + "", bufStr);
    }
    succeed = accessor.setProperty(keyBuilder.idealStates("TestDB1"), idealState);
    Assert.assertTrue(succeed);
    record =
        accessor.getProperty(keyBuilder.idealStates("TestDB1")).getRecord();
    Assert.assertTrue(serializer.serialize(record).length > 900 * 1024);

 
View Full Code Here

      idealState.getRecord().setSimpleField(i + "", bufStr);
    }
    succeed = accessor.setProperty(keyBuilder.idealStates("TestDB1"), idealState);
    Assert.assertTrue(succeed);
    record =
        accessor.getProperty(keyBuilder.idealStates("TestDB1")).getRecord();
    Assert.assertTrue(serializer.serialize(record).length > 900 * 1024);

    // oversized data should not update existing data on zk
    idealState.getRecord().getSimpleFields().clear();
    idealState.setStateModelDefRef("MasterSlave");
View Full Code Here

    {
      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

    // 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));

    System.out.println("END testZNRecordSizeLimitUseZNRecordSerializer at "
View Full Code Here

    for (int i = 0; i < 1024; i++)
    {
      idealState.getRecord().setSimpleField(i + "", bufStr);
    }
    boolean succeed =
        accessor.setProperty(keyBuilder.idealStates("TestDB_1"),
                                                              idealState);
    Assert.assertFalse(succeed);
    HelixProperty property =
        accessor.getProperty(keyBuilder.idealStates("TestDB_1"));
    Assert.assertNull(property);
View Full Code Here

    boolean succeed =
        accessor.setProperty(keyBuilder.idealStates("TestDB_1"),
                                                              idealState);
    Assert.assertFalse(succeed);
    HelixProperty property =
        accessor.getProperty(keyBuilder.idealStates("TestDB_1"));
    Assert.assertNull(property);

    // legal sized data gets written to zk
    idealState.getRecord().getSimpleFields().clear();
    idealState.setStateModelDefRef("MasterSlave");
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.