Package com.linkedin.helix.manager.file

Examples of com.linkedin.helix.manager.file.StaticFileHelixManager


    // System.out.println(new String(bytes));

    StaticFileHelixManager.verifyFileBasedClusterStates("localhost_8900",
                                       configFile, configFile);

    StaticFileHelixManager controller = new StaticFileHelixManager(clusterName, controllerName,
                                                     InstanceType.CONTROLLER, configFile);
    controller.disconnect();
    AssertJUnit.assertFalse(controller.isConnected());
    controller.connect();
    AssertJUnit.assertTrue(controller.isConnected());

    String sessionId = controller.getSessionId();
//    AssertJUnit.assertEquals(DynamicFileClusterManager._sessionId, sessionId);
    AssertJUnit.assertEquals(clusterName, controller.getClusterName());
    AssertJUnit.assertEquals(0, controller.getLastNotificationTime());
    AssertJUnit.assertEquals(InstanceType.CONTROLLER, controller.getInstanceType());
    AssertJUnit.assertNull(controller.getPropertyStore());
    AssertJUnit.assertNull(controller.getHealthReportCollector());
    AssertJUnit.assertEquals(controllerName, controller.getInstanceName());
    AssertJUnit.assertNull(controller.getClusterManagmentTool());
    AssertJUnit.assertNull(controller.getMessagingService());

    MockListener controllerListener = new MockListener();
    AssertJUnit.assertFalse(controller.removeListener(null, controllerListener));
    controllerListener.reset();

    controller.addIdealStateChangeListener(controllerListener);
    AssertJUnit.assertTrue(controllerListener.isIdealStateChangeListenerInvoked);

    controller.addMessageListener(controllerListener, "localhost_8900");
    AssertJUnit.assertTrue(controllerListener.isMessageListenerInvoked);

    exceptionCaught = false;
    try
    {
      controller.addLiveInstanceChangeListener(controllerListener);
    } catch (UnsupportedOperationException e)
    {
      exceptionCaught = true;
    }
    AssertJUnit.assertTrue(exceptionCaught);

    exceptionCaught = false;
    try
    {
      controller.addCurrentStateChangeListener(controllerListener, "localhost_8900", sessionId);
    } catch (UnsupportedOperationException e)
    {
      exceptionCaught = true;
    }
    AssertJUnit.assertTrue(exceptionCaught);

    exceptionCaught = false;
    try
    {
      controller.addConfigChangeListener(controllerListener);
    } catch (UnsupportedOperationException e)
    {
      exceptionCaught = true;
    }
    AssertJUnit.assertTrue(exceptionCaught);

    exceptionCaught = false;
    try
    {
      controller.addExternalViewChangeListener(controllerListener);
    } catch (UnsupportedOperationException e)
    {
      exceptionCaught = true;
    }
    AssertJUnit.assertTrue(exceptionCaught);

    exceptionCaught = false;
    try
    {
      controller.addControllerListener(controllerListener);
    } catch (UnsupportedOperationException e)
    {
      exceptionCaught = true;
    }
    AssertJUnit.assertTrue(exceptionCaught);
View Full Code Here


  {
    if (type != InstanceType.PARTICIPANT)
    {
      throw new IllegalArgumentException("Static file-based cluster manager doesn't support type other than participant");
    }
    return new StaticFileHelixManager(clusterName, instanceName, type, clusterViewFile);
  }
View Full Code Here

TOP

Related Classes of com.linkedin.helix.manager.file.StaticFileHelixManager

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.