Examples of ParticipantMonitor


Examples of com.linkedin.helix.monitoring.ParticipantMonitor

    _taskMap = new ConcurrentHashMap<String, Future<HelixTaskResult>>();
    _groupMsgHandler = new GroupMessageHandler();

    _lock = new Object();
    _statusUpdateUtil = new StatusUpdateUtil();
    _monitor = new ParticipantMonitor();
    startMonitorThread();
  }
View Full Code Here

Examples of com.linkedin.helix.monitoring.ParticipantMonitor

  public HelixTaskExecutor()
  {
    _taskMap = new ConcurrentHashMap<String, Future<HelixTaskResult>>();
    _lock = new Object();
    _statusUpdateUtil = new StatusUpdateUtil();
    _monitor = new ParticipantMonitor();
    startMonitorThread();
  }
View Full Code Here

Examples of org.apache.helix.monitoring.ParticipantMonitor

  }
  @Test(groups={ "unitTest" })
  public void TestReportData() throws InstanceNotFoundException, MalformedObjectNameException, NullPointerException, IOException, InterruptedException
  {
    System.out.println("START TestParticipantMonitor");
    ParticipantMonitor monitor = new ParticipantMonitor();

    int monitorNum = 0;

    StateTransitionContext cxt = new StateTransitionContext("cluster", "instance", "db_1","a-b");
    StateTransitionDataPoint data = new StateTransitionDataPoint(1000,1000,true);
    monitor.reportTransitionStat(cxt, data);

    data = new StateTransitionDataPoint(1000,1200,true);
    monitor.reportTransitionStat(cxt, data);

    ParticipantMonitorListener monitorListener = new ParticipantMonitorListener("CLMParticipantReport");
    Thread.sleep(1000);
    AssertJUnit.assertTrue(monitorListener._beanValueMap.size() == monitorNum + 1);

    data = new StateTransitionDataPoint(1000,500,true);
    monitor.reportTransitionStat(cxt, data);
    Thread.sleep(1000);
    AssertJUnit.assertTrue(monitorListener._beanValueMap.size() == monitorNum + 1);

    data = new StateTransitionDataPoint(1000,500,true);
    StateTransitionContext cxt2 = new StateTransitionContext("cluster", "instance", "db_2","a-b");
    monitor.reportTransitionStat(cxt2, data);
    monitor.reportTransitionStat(cxt2, data);
    Thread.sleep(1000);
    AssertJUnit.assertTrue(monitorListener._beanValueMap.size() == monitorNum + 2);

    AssertJUnit.assertFalse(cxt.equals(cxt2));
    AssertJUnit.assertFalse(cxt.equals(new Object()));
View Full Code Here

Examples of org.apache.helix.monitoring.ParticipantMonitor

    _taskMap = new ConcurrentHashMap<String, Future<HelixTaskResult>>();
    _groupMsgHandler = new GroupMessageHandler();

    _lock = new Object();
    _statusUpdateUtil = new StatusUpdateUtil();
    _monitor = new ParticipantMonitor();
    startMonitorThread();
  }
View Full Code Here

Examples of org.apache.helix.monitoring.ParticipantMonitor

    "unitTest"
  })
  public void TestReportData() throws InstanceNotFoundException, MalformedObjectNameException,
      NullPointerException, IOException, InterruptedException {
    System.out.println("START TestParticipantMonitor");
    ParticipantMonitor monitor = new ParticipantMonitor();

    int monitorNum = 0;

    StateTransitionContext cxt = new StateTransitionContext("cluster", "instance", "db_1", "a-b");
    StateTransitionDataPoint data = new StateTransitionDataPoint(1000, 1000, true);
    monitor.reportTransitionStat(cxt, data);

    data = new StateTransitionDataPoint(1000, 1200, true);
    monitor.reportTransitionStat(cxt, data);

    ParticipantMonitorListener monitorListener =
        new ParticipantMonitorListener("CLMParticipantReport");
    Thread.sleep(1000);
    AssertJUnit.assertTrue(monitorListener._beanValueMap.size() == monitorNum + 1);

    data = new StateTransitionDataPoint(1000, 500, true);
    monitor.reportTransitionStat(cxt, data);
    Thread.sleep(1000);
    AssertJUnit.assertTrue(monitorListener._beanValueMap.size() == monitorNum + 1);

    data = new StateTransitionDataPoint(1000, 500, true);
    StateTransitionContext cxt2 = new StateTransitionContext("cluster", "instance", "db_2", "a-b");
    monitor.reportTransitionStat(cxt2, data);
    monitor.reportTransitionStat(cxt2, data);
    Thread.sleep(1000);
    AssertJUnit.assertTrue(monitorListener._beanValueMap.size() == monitorNum + 2);

    AssertJUnit.assertFalse(cxt.equals(cxt2));
    AssertJUnit.assertFalse(cxt.equals(new Object()));
View Full Code Here

Examples of org.apache.helix.monitoring.ParticipantMonitor

    _taskMap = new ConcurrentHashMap<String, MessageTaskInfo>();
    _executorMap = new ConcurrentHashMap<String, ExecutorService>();

    _lock = new Object();
    _statusUpdateUtil = new StatusUpdateUtil();
    _monitor = new ParticipantMonitor();

    _timer = new Timer(true); // created as a daemon timer thread to handle task timeout

    startMonitorThread();
  }
View Full Code Here

Examples of org.apache.helix.monitoring.ParticipantMonitor

    _executorMap = new ConcurrentHashMap<String, ExecutorService>();
    _resourceThreadpoolSizeMap = new ConcurrentHashMap<String, Integer>();

    _lock = new Object();
    _statusUpdateUtil = new StatusUpdateUtil();
    _monitor = new ParticipantMonitor();

    _timer = new Timer(true); // created as a daemon timer thread to handle task timeout

    startMonitorThread();
  }
View Full Code Here

Examples of org.apache.helix.monitoring.ParticipantMonitor

    _taskMap = new ConcurrentHashMap<String, MessageTaskInfo>();
    _executorMap = new ConcurrentHashMap<String, ExecutorService>();

    _lock = new Object();
    _statusUpdateUtil = new StatusUpdateUtil();
    _monitor = new ParticipantMonitor();

    _timer = new Timer(true); // created as a daemon timer thread to handle task timeout

    startMonitorThread();
  }
View Full Code Here

Examples of org.apache.helix.monitoring.ParticipantMonitor

    _executorMap = new ConcurrentHashMap<String, ExecutorService>();
    _resourceThreadpoolSizeMap = new ConcurrentHashMap<String, Integer>();

    _lock = new Object();
    _statusUpdateUtil = new StatusUpdateUtil();
    _monitor = new ParticipantMonitor();

    _timer = new Timer(true); // created as a daemon timer thread to handle task timeout

    startMonitorThread();
  }
View Full Code Here

Examples of org.apache.helix.monitoring.ParticipantMonitor

  @Test()
  public void testReportData() throws InstanceNotFoundException, MalformedObjectNameException,
      NullPointerException, IOException, InterruptedException {
    System.out.println("START TestParticipantMonitor");
    ParticipantMonitor monitor = new ParticipantMonitor();

    int monitorNum = 0;

    StateTransitionContext cxt = new StateTransitionContext("cluster", "instance", "db_1", "a-b");
    StateTransitionDataPoint data = new StateTransitionDataPoint(1000, 1000, true);
    monitor.reportTransitionStat(cxt, data);

    data = new StateTransitionDataPoint(1000, 1200, true);
    monitor.reportTransitionStat(cxt, data);

    ParticipantMonitorListener monitorListener =
        new ParticipantMonitorListener("CLMParticipantReport");
    Thread.sleep(1000);
    AssertJUnit.assertTrue(monitorListener._beanValueMap.size() == monitorNum + 1);

    data = new StateTransitionDataPoint(1000, 500, true);
    monitor.reportTransitionStat(cxt, data);
    Thread.sleep(1000);
    AssertJUnit.assertTrue(monitorListener._beanValueMap.size() == monitorNum + 1);

    data = new StateTransitionDataPoint(1000, 500, true);
    StateTransitionContext cxt2 = new StateTransitionContext("cluster", "instance", "db_2", "a-b");
    monitor.reportTransitionStat(cxt2, data);
    monitor.reportTransitionStat(cxt2, data);
    Thread.sleep(1000);
    AssertJUnit.assertTrue(monitorListener._beanValueMap.size() == monitorNum + 2);

    AssertJUnit.assertFalse(cxt.equals(cxt2));
    AssertJUnit.assertFalse(cxt.equals(new Object()));
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.