Package org.apache.helix.model

Examples of org.apache.helix.model.Error


      // TODO need to fix: ERRORS_CONTROLLER doesn't have a form of
      // ../{sessionId}/{subPath}
      // accessor.setProperty(PropertyType.ERRORS_CONTROLLER, record,
      // statusUpdateSubPath);
      accessor.setProperty(keyBuilder.controllerTaskError(statusUpdateSubPath),
                           new Error(record));
    }
    else
    {
      // accessor.updateProperty(PropertyType.ERRORS,
      // record,
      // instanceName,
      // sessionId,
      // statusUpdateSubPath,
      // statusUpdateKey);
      accessor.updateProperty(keyBuilder.stateTransitionError(instanceName,
                                                              sessionId,
                                                              statusUpdateSubPath,
                                                              statusUpdateKey),
                              new Error(record));

    }
  }
View Full Code Here


    if (instanceName.equalsIgnoreCase("controller")) {
      // TODO need to fix: ERRORS_CONTROLLER doesn't have a form of
      // ../{sessionId}/{subPath}
      // accessor.setProperty(PropertyType.ERRORS_CONTROLLER, record,
      // statusUpdateSubPath);
      accessor.setProperty(keyBuilder.controllerTaskError(statusUpdateSubPath), new Error(record));
    } else {
      // accessor.updateProperty(PropertyType.ERRORS,
      // record,
      // instanceName,
      // sessionId,
      // statusUpdateSubPath,
      // statusUpdateKey);
      accessor.updateProperty(keyBuilder.stateTransitionError(instanceName, sessionId,
          statusUpdateSubPath, statusUpdateKey), new Error(record));

    }
  }
View Full Code Here

    statusUpdateKey =
        keyBuilder.stateTransitionStatus("localhost_12918", "session_0", "TestDB0", "TestDB0_0");
    accessor.setProperty(statusUpdateKey, new StatusUpdate(new ZNRecord("statusUpdate")));
    errorKey =
        keyBuilder.stateTransitionError("localhost_12918", "session_0", "TestDB0", "TestDB0_0");
    accessor.setProperty(errorKey, new Error(new ZNRecord("error")));

    // add controller status updates and errors
    controllerStatusUpdateKey = keyBuilder.controllerTaskStatus("session_0", "TestDB");
    accessor.setProperty(controllerStatusUpdateKey, new StatusUpdate(new ZNRecord(
        "controllerStatusUpdate")));
    controllerErrorKey = keyBuilder.controllerTaskError("TestDB_error");
    accessor.setProperty(controllerErrorKey, new Error(new ZNRecord("controllerError")));

    // run dump task, should remove existing statusUpdate/error paths
    task.run();
    Assert.assertFalse(baseAccessor.exists(controllerStatusUpdateKey.getPath(), 0));
    Assert.assertFalse(baseAccessor.exists(controllerErrorKey.getPath(), 0));
View Full Code Here

    statusUpdateKey =
        keyBuilder.stateTransitionStatus("localhost_12918", "session_0", "TestDB0", "TestDB0_0");
    accessor.setProperty(statusUpdateKey, new StatusUpdate(new ZNRecord("statusUpdate")));
    errorKey =
        keyBuilder.stateTransitionError("localhost_12918", "session_0", "TestDB0", "TestDB0_0");
    accessor.setProperty(errorKey, new Error(new ZNRecord("error")));

    // add controller status updates and errors (one of each, should not trigger anything)
    controllerStatusUpdateKey = keyBuilder.controllerTaskStatus("session_0", "TestDB");
    accessor.setProperty(controllerStatusUpdateKey, new StatusUpdate(new ZNRecord(
        "controllerStatusUpdate")));
    controllerErrorKey = keyBuilder.controllerTaskError("TestDB_error");
    accessor.setProperty(controllerErrorKey, new Error(new ZNRecord("controllerError")));

    // run dump task, should not remove anything because the threshold is not exceeded
    task.run();
    Assert.assertTrue(baseAccessor.exists(controllerStatusUpdateKey.getPath(), 0));
    Assert.assertTrue(baseAccessor.exists(controllerErrorKey.getPath(), 0));
    Assert.assertTrue(baseAccessor.exists(statusUpdateKey.getPath(), 0));
    Assert.assertTrue(baseAccessor.exists(errorKey.getPath(), 0));

    // add a second set of all status updates and errors
    statusUpdateKey =
        keyBuilder.stateTransitionStatus("localhost_12918", "session_0", "TestDB0", "TestDB0_1");
    accessor.setProperty(statusUpdateKey, new StatusUpdate(new ZNRecord("statusUpdate")));
    errorKey =
        keyBuilder.stateTransitionError("localhost_12918", "session_0", "TestDB0", "TestDB0_1");
    accessor.setProperty(errorKey, new Error(new ZNRecord("error")));
    controllerStatusUpdateKey = keyBuilder.controllerTaskStatus("session_0", "TestDB1");
    accessor.setProperty(controllerStatusUpdateKey, new StatusUpdate(new ZNRecord(
        "controllerStatusUpdate")));
    controllerErrorKey = keyBuilder.controllerTaskError("TestDB1_error");
    accessor.setProperty(controllerErrorKey, new Error(new ZNRecord("controllerError")));

    // run dump task, should remove everything since capacities are exceeded
    task.run();
    Assert.assertFalse(baseAccessor.exists(controllerStatusUpdateKey.getPath(), 0));
    Assert.assertFalse(baseAccessor.exists(controllerErrorKey.getPath(), 0));
View Full Code Here

    if (instanceName.equalsIgnoreCase("controller")) {
      // TODO need to fix: ERRORS_CONTROLLER doesn't have a form of
      // ../{sessionId}/{subPath}
      // accessor.setProperty(PropertyType.ERRORS_CONTROLLER, record,
      // statusUpdateSubPath);
      accessor.setProperty(keyBuilder.controllerTaskError(statusUpdateSubPath), new Error(record));
    } else {
      // accessor.updateProperty(PropertyType.ERRORS,
      // record,
      // instanceName,
      // sessionId,
      // statusUpdateSubPath,
      // statusUpdateKey);
      accessor.updateProperty(keyBuilder.stateTransitionError(instanceName, sessionId.stringify(),
          statusUpdateSubPath, statusUpdateKey), new Error(record));

    }
  }
View Full Code Here

    if (instanceName.equalsIgnoreCase("controller")) {
      // TODO need to fix: ERRORS_CONTROLLER doesn't have a form of
      // ../{sessionId}/{subPath}
      // accessor.setProperty(PropertyType.ERRORS_CONTROLLER, record,
      // statusUpdateSubPath);
      accessor.setProperty(keyBuilder.controllerTaskError(statusUpdateSubPath), new Error(record));
    } else {
      // accessor.updateProperty(PropertyType.ERRORS,
      // record,
      // instanceName,
      // sessionId,
      // statusUpdateSubPath,
      // statusUpdateKey);
      accessor.updateProperty(keyBuilder.stateTransitionError(instanceName, sessionId.stringify(),
          statusUpdateSubPath, statusUpdateKey), new Error(record));

    }
  }
View Full Code Here

    statusUpdateKey =
        keyBuilder.stateTransitionStatus("localhost_12918", "session_0", "TestDB0", "TestDB0_0");
    accessor.setProperty(statusUpdateKey, new StatusUpdate(new ZNRecord("statusUpdate")));
    errorKey =
        keyBuilder.stateTransitionError("localhost_12918", "session_0", "TestDB0", "TestDB0_0");
    accessor.setProperty(errorKey, new Error(new ZNRecord("error")));

    // add controller status updates and errors
    controllerStatusUpdateKey = keyBuilder.controllerTaskStatus("session_0", "TestDB");
    accessor.setProperty(controllerStatusUpdateKey, new StatusUpdate(new ZNRecord(
        "controllerStatusUpdate")));
    controllerErrorKey = keyBuilder.controllerTaskError("TestDB_error");
    accessor.setProperty(controllerErrorKey, new Error(new ZNRecord("controllerError")));

    // run dump task, should remove existing statusUpdate/error paths
    task.run();
    Assert.assertFalse(baseAccessor.exists(controllerStatusUpdateKey.getPath(), 0));
    Assert.assertFalse(baseAccessor.exists(controllerErrorKey.getPath(), 0));
View Full Code Here

    statusUpdateKey =
        keyBuilder.stateTransitionStatus("localhost_12918", "session_0", "TestDB0", "TestDB0_0");
    accessor.setProperty(statusUpdateKey, new StatusUpdate(new ZNRecord("statusUpdate")));
    errorKey =
        keyBuilder.stateTransitionError("localhost_12918", "session_0", "TestDB0", "TestDB0_0");
    accessor.setProperty(errorKey, new Error(new ZNRecord("error")));

    // add controller status updates and errors (one of each, should not trigger anything)
    controllerStatusUpdateKey = keyBuilder.controllerTaskStatus("session_0", "TestDB");
    accessor.setProperty(controllerStatusUpdateKey, new StatusUpdate(new ZNRecord(
        "controllerStatusUpdate")));
    controllerErrorKey = keyBuilder.controllerTaskError("TestDB_error");
    accessor.setProperty(controllerErrorKey, new Error(new ZNRecord("controllerError")));

    // run dump task, should not remove anything because the threshold is not exceeded
    task.run();
    Assert.assertTrue(baseAccessor.exists(controllerStatusUpdateKey.getPath(), 0));
    Assert.assertTrue(baseAccessor.exists(controllerErrorKey.getPath(), 0));
    Assert.assertTrue(baseAccessor.exists(statusUpdateKey.getPath(), 0));
    Assert.assertTrue(baseAccessor.exists(errorKey.getPath(), 0));

    // add a second set of all status updates and errors
    statusUpdateKey =
        keyBuilder.stateTransitionStatus("localhost_12918", "session_0", "TestDB0", "TestDB0_1");
    accessor.setProperty(statusUpdateKey, new StatusUpdate(new ZNRecord("statusUpdate")));
    errorKey =
        keyBuilder.stateTransitionError("localhost_12918", "session_0", "TestDB0", "TestDB0_1");
    accessor.setProperty(errorKey, new Error(new ZNRecord("error")));
    controllerStatusUpdateKey = keyBuilder.controllerTaskStatus("session_0", "TestDB1");
    accessor.setProperty(controllerStatusUpdateKey, new StatusUpdate(new ZNRecord(
        "controllerStatusUpdate")));
    controllerErrorKey = keyBuilder.controllerTaskError("TestDB1_error");
    accessor.setProperty(controllerErrorKey, new Error(new ZNRecord("controllerError")));

    // run dump task, should remove everything since capacities are exceeded
    task.run();
    Assert.assertFalse(baseAccessor.exists(controllerStatusUpdateKey.getPath(), 0));
    Assert.assertFalse(baseAccessor.exists(controllerErrorKey.getPath(), 0));
View Full Code Here

TOP

Related Classes of org.apache.helix.model.Error

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.