Repository: reef Updated Branches: refs/heads/master bee4a67a1 -> 0bb388e8c
[REEF-60] Delete org.apache.reef.tests.multipleEventHandlerInstances The classes under this folder are unused and undocumented for a year. JIRA: [REEF-60](https://issues.apache.org/jira/browse/REEF-60) Pull request: This closes #798 Project: http://git-wip-us.apache.org/repos/asf/reef/repo Commit: http://git-wip-us.apache.org/repos/asf/reef/commit/0bb388e8 Tree: http://git-wip-us.apache.org/repos/asf/reef/tree/0bb388e8 Diff: http://git-wip-us.apache.org/repos/asf/reef/diff/0bb388e8 Branch: refs/heads/master Commit: 0bb388e8ccc643203e85d67bae63d9adf7a927eb Parents: bee4a67 Author: Mariia Mykhailova <[email protected]> Authored: Mon Jan 25 16:37:54 2016 -0800 Committer: Dongjoon Hyun <[email protected]> Committed: Tue Jan 26 10:24:52 2016 -0800 ---------------------------------------------------------------------- .../ActiveContextHandler.java | 63 ---------------- .../AllocatedEvaluatorHandler.java | 61 ---------------- .../multipleEventHandlerInstances/Client.java | 75 -------------------- .../ClosedContextHandler.java | 51 ------------- .../CompletedEvaluatorHandler.java | 52 -------------- .../CompletedTaskHandler.java | 52 -------------- .../EmptyTask.java | 39 ---------- .../RunningTaskHandler.java | 51 ------------- .../StartHandler.java | 63 ---------------- .../package-info.java | 22 ------ 10 files changed, 529 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/reef/blob/0bb388e8/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/ActiveContextHandler.java ---------------------------------------------------------------------- diff --git a/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/ActiveContextHandler.java b/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/ActiveContextHandler.java deleted file mode 100644 index 4cf733b..0000000 --- a/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/ActiveContextHandler.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.reef.tests.multipleEventHandlerInstances; - -import org.apache.reef.driver.context.ActiveContext; -import org.apache.reef.driver.task.TaskConfiguration; -import org.apache.reef.tang.Configuration; -import org.apache.reef.tang.exceptions.BindException; -import org.apache.reef.tests.library.exceptions.DriverSideFailure; -import org.apache.reef.wake.EventHandler; - -import javax.inject.Inject; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * The ActiveContext handler. - */ -public final class ActiveContextHandler implements EventHandler<ActiveContext> { - - private static final Logger LOG = Logger.getLogger(ActiveContextHandler.class.getName()); - - private static int countInstances = 0; - - @Inject - public ActiveContextHandler() { - ++countInstances; - if (countInstances > 1) { - throw new DriverSideFailure("Expect ActiveContextHandler to be created only once"); - } - } - - @Override - public void onNext(final ActiveContext activeContext) { - LOG.log(Level.FINEST, "ActiveContext received. Submitting empty task to it"); - final Configuration taskConfiguration; - try { - taskConfiguration = TaskConfiguration.CONF - .set(TaskConfiguration.IDENTIFIER, "EmptyREEFTask") - .set(TaskConfiguration.TASK, EmptyTask.class) - .build(); - } catch (final BindException e) { - throw new RuntimeException("Unable to setup Task configuration", e); - } - activeContext.submitTask(taskConfiguration); - } -} http://git-wip-us.apache.org/repos/asf/reef/blob/0bb388e8/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/AllocatedEvaluatorHandler.java ---------------------------------------------------------------------- diff --git a/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/AllocatedEvaluatorHandler.java b/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/AllocatedEvaluatorHandler.java deleted file mode 100644 index a84745d..0000000 --- a/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/AllocatedEvaluatorHandler.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.reef.tests.multipleEventHandlerInstances; - -import org.apache.reef.driver.context.ContextConfiguration; -import org.apache.reef.driver.evaluator.AllocatedEvaluator; -import org.apache.reef.tang.Configuration; -import org.apache.reef.tang.exceptions.BindException; -import org.apache.reef.tests.library.exceptions.DriverSideFailure; -import org.apache.reef.wake.EventHandler; - -import javax.inject.Inject; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * The allocated evaluator handler. - */ -public final class AllocatedEvaluatorHandler implements EventHandler<AllocatedEvaluator> { - - private static final Logger LOG = Logger.getLogger(AllocatedEvaluatorHandler.class.getName()); - - private static int countInstances = 0; - - @Inject - public AllocatedEvaluatorHandler() { - ++countInstances; - if (countInstances > 1) { - throw new DriverSideFailure("Expect AllocatedEvaluatorHandler to be created only once"); - } - } - - @Override - public void onNext(final AllocatedEvaluator allocatedEvaluator) { - LOG.log(Level.INFO, "Submitting empty context to AllocatedEvaluator: {0}", allocatedEvaluator); - try { - final Configuration contextConfiguration = ContextConfiguration.CONF - .set(ContextConfiguration.IDENTIFIER, "EmptyREEFContext") - .build(); - allocatedEvaluator.submitContext(contextConfiguration); - } catch (final BindException ex) { - throw new RuntimeException("Unable to setup Task or Context configuration.", ex); - } - } -} http://git-wip-us.apache.org/repos/asf/reef/blob/0bb388e8/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/Client.java ---------------------------------------------------------------------- diff --git a/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/Client.java b/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/Client.java deleted file mode 100644 index ede92c1..0000000 --- a/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/Client.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.reef.tests.multipleEventHandlerInstances; - -import org.apache.reef.client.DriverConfiguration; -import org.apache.reef.client.DriverLauncher; -import org.apache.reef.client.LauncherStatus; -import org.apache.reef.runtime.local.client.LocalRuntimeConfiguration; -import org.apache.reef.tang.Configuration; -import org.apache.reef.tang.exceptions.BindException; -import org.apache.reef.tang.exceptions.InjectionException; -import org.apache.reef.util.EnvironmentUtils; -import org.junit.Assert; -import org.junit.Test; - -import java.util.logging.Logger; - -/** - * - */ -public class Client { - private static final Logger LOG = Logger.getLogger(Client.class.getName()); - - /** - * Number of milliseconds to wait for the job to complete. - */ - private static final int JOB_TIMEOUT = 300000; // 300 sec. - - public static LauncherStatus runReefJob(final Configuration runtimeConf, final int timeOut) - throws BindException, InjectionException { - - final Configuration driverConf = DriverConfiguration.CONF - .set(DriverConfiguration.GLOBAL_LIBRARIES, EnvironmentUtils.getClassLocation(StartHandler.class)) - .set(DriverConfiguration.DRIVER_IDENTIFIER, "MultipleHandlerInstances") - .set(DriverConfiguration.ON_DRIVER_STARTED, StartHandler.class) - .set(DriverConfiguration.ON_EVALUATOR_ALLOCATED, AllocatedEvaluatorHandler.class) - .set(DriverConfiguration.ON_CONTEXT_ACTIVE, ActiveContextHandler.class) - .set(DriverConfiguration.ON_TASK_RUNNING, RunningTaskHandler.class) - .set(DriverConfiguration.ON_TASK_COMPLETED, CompletedTaskHandler.class) - .set(DriverConfiguration.ON_CONTEXT_CLOSED, ClosedContextHandler.class) - .set(DriverConfiguration.ON_EVALUATOR_COMPLETED, CompletedEvaluatorHandler.class) - .build(); - - return DriverLauncher.getLauncher(runtimeConf).run(driverConf, timeOut); - } - - /** - * @throws BindException configuration error. - * @throws InjectionException configuration error. - */ - @Test - public void testMultipleInstances() throws BindException, InjectionException { - final Configuration runtimeConfiguration = LocalRuntimeConfiguration.CONF - .set(LocalRuntimeConfiguration.MAX_NUMBER_OF_EVALUATORS, 2) - .build(); - final LauncherStatus status = runReefJob(runtimeConfiguration, JOB_TIMEOUT); - Assert.assertTrue("Reef Job MultipleHandlerInstances failed: " + status, status.isSuccess()); - } -} http://git-wip-us.apache.org/repos/asf/reef/blob/0bb388e8/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/ClosedContextHandler.java ---------------------------------------------------------------------- diff --git a/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/ClosedContextHandler.java b/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/ClosedContextHandler.java deleted file mode 100644 index 0c3b6fd..0000000 --- a/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/ClosedContextHandler.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.reef.tests.multipleEventHandlerInstances; - -import org.apache.reef.driver.context.ClosedContext; -import org.apache.reef.tests.library.exceptions.DriverSideFailure; -import org.apache.reef.wake.EventHandler; - -import javax.inject.Inject; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * - */ -public class ClosedContextHandler implements EventHandler<ClosedContext> { - - private static final Logger LOG = Logger.getLogger(ClosedContextHandler.class.getName()); - - private static int countInstances = 0; - - @Inject - public ClosedContextHandler() { - ++countInstances; - if (countInstances > 1) { - throw new DriverSideFailure("Expect ClosedContextHandler to be created only once"); - } - } - - @Override - public void onNext(final ClosedContext closedContext) { - LOG.log(Level.FINEST, "Received a closed context"); - } - -} http://git-wip-us.apache.org/repos/asf/reef/blob/0bb388e8/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/CompletedEvaluatorHandler.java ---------------------------------------------------------------------- diff --git a/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/CompletedEvaluatorHandler.java b/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/CompletedEvaluatorHandler.java deleted file mode 100644 index be9625a..0000000 --- a/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/CompletedEvaluatorHandler.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.reef.tests.multipleEventHandlerInstances; - -import org.apache.reef.driver.evaluator.CompletedEvaluator; -import org.apache.reef.tests.library.exceptions.DriverSideFailure; -import org.apache.reef.wake.EventHandler; - -import javax.inject.Inject; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * - */ -public class CompletedEvaluatorHandler implements - EventHandler<CompletedEvaluator> { - - private static final Logger LOG = Logger.getLogger(CompletedEvaluatorHandler.class.getName()); - - private static int countInstances = 0; - - @Inject - public CompletedEvaluatorHandler() { - ++countInstances; - if (countInstances > 1) { - throw new DriverSideFailure("Expect CompletedEvaluatorHandler to be created only once"); - } - } - - @Override - public void onNext(final CompletedEvaluator completedEvaluator) { - LOG.log(Level.FINEST, "Received a completed evaluator"); - } - -} http://git-wip-us.apache.org/repos/asf/reef/blob/0bb388e8/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/CompletedTaskHandler.java ---------------------------------------------------------------------- diff --git a/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/CompletedTaskHandler.java b/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/CompletedTaskHandler.java deleted file mode 100644 index 96498fc..0000000 --- a/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/CompletedTaskHandler.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.reef.tests.multipleEventHandlerInstances; - -import org.apache.reef.driver.task.CompletedTask; -import org.apache.reef.tests.library.exceptions.DriverSideFailure; -import org.apache.reef.wake.EventHandler; - -import javax.inject.Inject; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * - */ -public class CompletedTaskHandler implements EventHandler<CompletedTask> { - - private static final Logger LOG = Logger.getLogger(CompletedTaskHandler.class.getName()); - - private static int countInstances = 0; - - @Inject - public CompletedTaskHandler() { - ++countInstances; - if (countInstances > 1) { - throw new DriverSideFailure("Expect CompletedTaskHandler to be created only once"); - } - } - - @Override - public void onNext(final CompletedTask completedTask) { - LOG.log(Level.FINEST, "Received a completed task"); - completedTask.getActiveContext().close(); - } - -} http://git-wip-us.apache.org/repos/asf/reef/blob/0bb388e8/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/EmptyTask.java ---------------------------------------------------------------------- diff --git a/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/EmptyTask.java b/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/EmptyTask.java deleted file mode 100644 index 29ad0e2..0000000 --- a/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/EmptyTask.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.reef.tests.multipleEventHandlerInstances; - -import org.apache.reef.task.Task; - -import javax.inject.Inject; - -/** - * - */ -public class EmptyTask implements Task { - - @Inject - public EmptyTask() { - } - - @Override - public byte[] call(final byte[] memento) throws Exception { - return null; - } - -} http://git-wip-us.apache.org/repos/asf/reef/blob/0bb388e8/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/RunningTaskHandler.java ---------------------------------------------------------------------- diff --git a/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/RunningTaskHandler.java b/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/RunningTaskHandler.java deleted file mode 100644 index fd419b3..0000000 --- a/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/RunningTaskHandler.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.reef.tests.multipleEventHandlerInstances; - -import org.apache.reef.driver.task.RunningTask; -import org.apache.reef.tests.library.exceptions.DriverSideFailure; -import org.apache.reef.wake.EventHandler; - -import javax.inject.Inject; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * - */ -public class RunningTaskHandler implements EventHandler<RunningTask> { - - private static final Logger LOG = Logger.getLogger(RunningTaskHandler.class.getName()); - - private static int countInstances = 0; - - @Inject - public RunningTaskHandler() { - ++countInstances; - if (countInstances > 1) { - throw new DriverSideFailure("Expect RunningTaskHandler to be created only once"); - } - } - - @Override - public void onNext(final RunningTask runningTask) { - LOG.log(Level.FINEST, "Received a running task"); - } - -} http://git-wip-us.apache.org/repos/asf/reef/blob/0bb388e8/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/StartHandler.java ---------------------------------------------------------------------- diff --git a/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/StartHandler.java b/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/StartHandler.java deleted file mode 100644 index cb5e61d..0000000 --- a/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/StartHandler.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.reef.tests.multipleEventHandlerInstances; - -import org.apache.reef.driver.evaluator.EvaluatorRequest; -import org.apache.reef.driver.evaluator.EvaluatorRequestor; -import org.apache.reef.tests.library.exceptions.DriverSideFailure; -import org.apache.reef.wake.EventHandler; -import org.apache.reef.wake.time.event.StartTime; - -import javax.inject.Inject; -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * The start handler. - */ -public final class StartHandler implements EventHandler<StartTime> { - - private static final Logger LOG = Logger.getLogger(StartHandler.class.getName()); - private static int countInstances = 0; - private final EvaluatorRequestor requestor; - - /** - * Job driver constructor - instantiated via TANG. - * - * @param requestor evaluator requestor object used to create new evaluator containers. - */ - @Inject - public StartHandler(final EvaluatorRequestor requestor) { - this.requestor = requestor; - ++countInstances; - if (countInstances > 1) { - throw new DriverSideFailure("Expect StartHandler be created only once"); - } - } - - @Override - public void onNext(final StartTime startTime) { - LOG.log(Level.INFO, "StartTime: ", startTime); - StartHandler.this.requestor.submit(EvaluatorRequest.newBuilder() - .setNumber(5) - .setMemory(64) - .setNumberOfCores(1) - .build()); - } -} http://git-wip-us.apache.org/repos/asf/reef/blob/0bb388e8/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/package-info.java ---------------------------------------------------------------------- diff --git a/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/package-info.java b/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/package-info.java deleted file mode 100644 index a45d3a1..0000000 --- a/lang/java/reef-tests/src/test/java/org/apache/reef/tests/multipleEventHandlerInstances/package-info.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -/** - * Tests for multiple event handler registration. - */ -package org.apache.reef.tests.multipleEventHandlerInstances;
