Examples of EventHandler


Examples of org.apache.commons.math.ode.events.EventHandler

          new HighamHall54Integrator(minStep, maxStep,
                                     scalAbsoluteTolerance, scalRelativeTolerance);
      TestProblemHandler handler = new TestProblemHandler(pb, integ);
      integ.addStepHandler(handler);

      integ.addEventHandler(new EventHandler() {
        public int eventOccurred(double t, double[] y, boolean increasing) {
          return EventHandler.CONTINUE;
        }
        public double g(double t, double[] y) throws EventException {
          double middle = (pb.getInitialTime() + pb.getFinalTime()) / 2;
View Full Code Here

Examples of org.apache.commons.math.ode.events.EventHandler

        new HighamHall54Integrator(minStep, maxStep,
                                   scalAbsoluteTolerance, scalRelativeTolerance);
    TestProblemHandler handler = new TestProblemHandler(pb, integ);
    integ.addStepHandler(handler);

    integ.addEventHandler(new EventHandler() {
      public int eventOccurred(double t, double[] y, boolean increasing) {
        return EventHandler.CONTINUE;
      }
      public double g(double t, double[] y) {
        double middle = (pb.getInitialTime() + pb.getFinalTime()) / 2;
View Full Code Here

Examples of org.apache.commons.math3.ode.events.EventHandler

      Assert.assertEquals(tEvent, finalT, 5.0e-6);
      for (int i = 0; i < y.length; ++i) {
          Assert.assertEquals(y0[i] * FastMath.exp(k[i] * (finalT - t0)), y[i], 1.0e-9);
      }

      integrator.addEventHandler(new EventHandler() {

          public void init(double t0, double[] y0, double t) {
          }

          public void resetState(double t, double[] y) {
View Full Code Here

Examples of org.apache.commons.math3.ode.events.EventHandler

        Assert.assertEquals(tEvent, finalT, 1.0e-15);
        for (int i = 0; i < y.length; ++i) {
            Assert.assertEquals(y0[i] * FastMath.exp(k[i] * (finalT - t0)), y[i], 1.0e-15);
        }

        integrator.addEventHandler(new EventHandler() {

            public void init(double t0, double[] y0, double t) {
            }

            public void resetState(double t, double[] y) {
View Full Code Here

Examples of org.apache.excalibur.event.EventHandler

     * @param pipeline  The pipeline we are registering
     */
    public void register( EventPipeline pipeline )
    {
        Source[] sources = pipeline.getSources();
        EventHandler handler = pipeline.getEventHandler();
        List sourceList = new ArrayList(sources.length);

        for (int i = 0; i < sources.length; i++)
        {
            PooledExecutor threadPool = new PooledExecutor();
View Full Code Here

Examples of org.apache.hadoop.hbase.executor.EventHandler

        } else {
          // Insert into RIT & resend the query to the region server: may be the previous master
          // died before sending the query the first time.
          final RegionState rs = regionStates.updateRegionState(rt, State.CLOSING);
          this.executorService.submit(
              new EventHandler(server, EventType.M_MASTER_RECOVERY) {
                @Override
                public void process() throws IOException {
                  ReentrantLock lock = locker.acquireLock(regionInfo.getEncodedName());
                  try {
                    unassign(regionInfo, rs, expectedVersion, null, true, null);
                    if (regionStates.isRegionOffline(regionInfo)) {
                      assign(regionInfo, true);
                    }
                  } finally {
                    lock.unlock();
                  }
                }
              });
        }
        break;

      case RS_ZK_REGION_CLOSED:
      case RS_ZK_REGION_FAILED_OPEN:
        // Region is closed, insert into RIT and handle it
        addToRITandInvokeAssign(regionInfo, State.CLOSED, rt);
        break;

      case M_ZK_REGION_OFFLINE:
        // If zk node of the region was updated by a live server skip this
        // region and just add it into RIT.
        if (!serverManager.isServerOnline(sn)) {
          // Region is offline, insert into RIT and invoke assign
          addToRITandInvokeAssign(regionInfo, State.OFFLINE, rt);
        } else {
          // Insert in RIT and resend to the regionserver
          regionStates.updateRegionState(rt, State.PENDING_OPEN);
          final RegionState rs = regionStates.getRegionState(regionInfo);
          this.executorService.submit(
              new EventHandler(server, EventType.M_MASTER_RECOVERY) {
                @Override
                public void process() throws IOException {
                  ReentrantLock lock = locker.acquireLock(regionInfo.getEncodedName());
                  try {
                    RegionPlan plan = new RegionPlan(regionInfo, null, sn);
View Full Code Here

Examples of org.apache.hadoop.hbase.executor.EventHandler

      case M_ZK_REGION_CLOSING:
        // Insert into RIT & resend the query to the region server: may be the previous master
        // died before sending the query the first time.
        final RegionState rsClosing = regionStates.updateRegionState(rt, State.CLOSING);
        this.executorService.submit(
          new EventHandler(server, EventType.M_MASTER_RECOVERY) {
            @Override
            public void process() throws IOException {
              ReentrantLock lock = locker.acquireLock(regionInfo.getEncodedName());
              try {
                unassign(regionInfo, rsClosing, expectedVersion, null, true, null);
                if (regionStates.isRegionOffline(regionInfo)) {
                  assign(regionInfo, true);
                }
              } finally {
                lock.unlock();
              }
            }
          });
        break;

      case RS_ZK_REGION_CLOSED:
      case RS_ZK_REGION_FAILED_OPEN:
        // Region is closed, insert into RIT and handle it
        regionStates.updateRegionState(regionInfo, State.CLOSED, sn);
        invokeAssign(regionInfo);
        break;

      case M_ZK_REGION_OFFLINE:
        // Insert in RIT and resend to the regionserver
        regionStates.updateRegionState(rt, State.PENDING_OPEN);
        final RegionState rsOffline = regionStates.getRegionState(regionInfo);
        this.executorService.submit(
          new EventHandler(server, EventType.M_MASTER_RECOVERY) {
            @Override
            public void process() throws IOException {
              ReentrantLock lock = locker.acquireLock(regionInfo.getEncodedName());
              try {
                RegionPlan plan = new RegionPlan(regionInfo, null, sn);
View Full Code Here

Examples of org.apache.hadoop.yarn.event.EventHandler

    }
    StubbedJob job = new StubbedJob(jobId,
        ApplicationAttemptId.newInstance(ApplicationId.newInstance(0, 0), 0),
        conf,dispatcher.getEventHandler(), true, "somebody", numSplits, appContext);
    dispatcher.register(JobEventType.class, job);
    EventHandler mockHandler = mock(EventHandler.class);
    dispatcher.register(TaskEventType.class, mockHandler);
    dispatcher.register(org.apache.hadoop.mapreduce.jobhistory.EventType.class,
        mockHandler);
    dispatcher.register(JobFinishEvent.Type.class, mockHandler);
    return job;
View Full Code Here

Examples of org.apache.hadoop.yarn.event.EventHandler

            }
            return false;
          }
        }

        EventHandler handler = spy(super.getEventHandler());
        doNothing().when(handler).handle(argThat(new EventArgMatcher()));
        return handler;
      }
    };
View Full Code Here

Examples of org.apache.hadoop.yarn.event.EventHandler

  @Test
  public void testReleaseWhileRunning() {

    DrainDispatcher drainDispatcher = new DrainDispatcher();
    EventHandler<RMAppAttemptEvent> appAttemptEventHandler = mock(EventHandler.class);
    EventHandler generic = mock(EventHandler.class);
    drainDispatcher.register(RMAppAttemptEventType.class,
        appAttemptEventHandler);
    drainDispatcher.register(RMNodeEventType.class, generic);
    drainDispatcher.init(new YarnConfiguration());
    drainDispatcher.start();
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.