You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@reef.apache.org by we...@apache.org on 2014/10/23 02:04:07 UTC
[36/51] [abbrv] [partial] Initial merge of Wake,
Tang and REEF into one repository and project
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/TaskStopImpl.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/TaskStopImpl.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/TaskStopImpl.java
deleted file mode 100644
index 4ea60d2..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/TaskStopImpl.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.evaluator.task;
-
-import com.microsoft.reef.task.events.TaskStop;
-import com.microsoft.reef.driver.task.TaskConfigurationOptions;
-import com.microsoft.tang.annotations.Parameter;
-
-import javax.inject.Inject;
-
-/**
- * Injectable implementation of TaskStop
- */
-final class TaskStopImpl implements TaskStop {
- private final String id;
-
- @Inject
- TaskStopImpl(final @Parameter(TaskConfigurationOptions.Identifier.class) String id) {
- this.id = id;
- }
-
- @Override
- public String getId() {
- return this.id;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/defaults/DefaultCloseHandler.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/defaults/DefaultCloseHandler.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/defaults/DefaultCloseHandler.java
deleted file mode 100644
index 91fa358..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/defaults/DefaultCloseHandler.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.evaluator.task.defaults;
-
-import com.microsoft.reef.annotations.audience.Private;
-import com.microsoft.reef.task.events.CloseEvent;
-import com.microsoft.wake.EventHandler;
-
-import javax.inject.Inject;
-
-/**
- * Default implementation for EventHandler<CloseEvent>
- */
-@Private
-public final class DefaultCloseHandler implements EventHandler<CloseEvent> {
-
- @Inject
- public DefaultCloseHandler() {
- }
-
- @Override
- public void onNext(final CloseEvent closeEvent) {
- throw new RuntimeException("No EventHandler<CloseEvent> registered. Event received: " + closeEvent);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/defaults/DefaultDriverMessageHandler.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/defaults/DefaultDriverMessageHandler.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/defaults/DefaultDriverMessageHandler.java
deleted file mode 100644
index 6191b27..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/defaults/DefaultDriverMessageHandler.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.evaluator.task.defaults;
-
-import com.microsoft.reef.annotations.audience.Private;
-import com.microsoft.reef.task.events.DriverMessage;
-import com.microsoft.wake.EventHandler;
-
-import javax.inject.Inject;
-
-/**
- * A default implementation of EventHandler<DriverMessage>
- */
-@Private
-public final class DefaultDriverMessageHandler implements EventHandler<DriverMessage> {
-
- @Inject
- public DefaultDriverMessageHandler() {
- }
-
- @Override
- public void onNext(final DriverMessage driverMessage) {
- throw new RuntimeException("No DriverMessage handler bound. Message received:" + driverMessage);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/defaults/DefaultSuspendHandler.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/defaults/DefaultSuspendHandler.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/defaults/DefaultSuspendHandler.java
deleted file mode 100644
index 2d87681..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/defaults/DefaultSuspendHandler.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.evaluator.task.defaults;
-
-import com.microsoft.reef.annotations.audience.Private;
-import com.microsoft.reef.task.events.SuspendEvent;
-import com.microsoft.wake.EventHandler;
-
-import javax.inject.Inject;
-
-/**
- * Default handler for SuspendEvent
- */
-@Private
-public final class DefaultSuspendHandler implements EventHandler<SuspendEvent> {
-
- @Inject
- public DefaultSuspendHandler() {
- }
-
- @Override
- public void onNext(final SuspendEvent suspendEvent) {
- throw new RuntimeException("No handler for SuspendEvent registered. event: " + suspendEvent);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/defaults/package-info.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/defaults/package-info.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/defaults/package-info.java
deleted file mode 100644
index 7b9dbc6..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/defaults/package-info.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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.
- */
-/**
- * Default implementations for the optional task interfaces.
- */
-package com.microsoft.reef.runtime.common.evaluator.task.defaults;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/exceptions/TaskCallFailure.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/exceptions/TaskCallFailure.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/exceptions/TaskCallFailure.java
deleted file mode 100644
index 65368b1..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/exceptions/TaskCallFailure.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.evaluator.task.exceptions;
-
-import com.microsoft.reef.annotations.audience.EvaluatorSide;
-import com.microsoft.reef.annotations.audience.Private;
-
-/**
- * Thrown when a Task.call() throws an exception
- */
-@EvaluatorSide
-@Private
-public final class TaskCallFailure extends Exception {
-
- /**
- * @param cause the exception thrown by the Task.call() method.
- */
- public TaskCallFailure(final Throwable cause) {
- super("Task.call() threw an Exception.", cause);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/exceptions/TaskCloseHandlerFailure.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/exceptions/TaskCloseHandlerFailure.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/exceptions/TaskCloseHandlerFailure.java
deleted file mode 100644
index f430888..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/exceptions/TaskCloseHandlerFailure.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.evaluator.task.exceptions;
-
-import com.microsoft.reef.annotations.audience.EvaluatorSide;
-import com.microsoft.reef.annotations.audience.Private;
-
-/**
- * Thrown when a Task Close Handler throws an exception
- */
-@EvaluatorSide
-@Private
-public final class TaskCloseHandlerFailure extends Exception {
-
- /**
- * @param cause the exception thrown by the Task.call() method.
- */
- public TaskCloseHandlerFailure(final Throwable cause) {
- super("Task close handler threw an Exception.", cause);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/exceptions/TaskMessageHandlerFailure.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/exceptions/TaskMessageHandlerFailure.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/exceptions/TaskMessageHandlerFailure.java
deleted file mode 100644
index 053e2bb..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/exceptions/TaskMessageHandlerFailure.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.evaluator.task.exceptions;
-
-import com.microsoft.reef.annotations.audience.EvaluatorSide;
-import com.microsoft.reef.annotations.audience.Private;
-
-/**
- * Thrown when a Task Message Handler throws an exception
- */
-@EvaluatorSide
-@Private
-public final class TaskMessageHandlerFailure extends Exception {
-
- /**
- * the exception thrown by the task message handler's onNext() method.
- */
- public TaskMessageHandlerFailure(final Throwable cause) {
- super("Task message handler threw an Exception.", cause);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/exceptions/TaskStartHandlerFailure.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/exceptions/TaskStartHandlerFailure.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/exceptions/TaskStartHandlerFailure.java
deleted file mode 100644
index 60d7dd5..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/exceptions/TaskStartHandlerFailure.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.evaluator.task.exceptions;
-
-import com.microsoft.reef.annotations.audience.EvaluatorSide;
-import com.microsoft.reef.annotations.audience.Private;
-import com.microsoft.reef.task.events.TaskStart;
-import com.microsoft.wake.EventHandler;
-
-/**
- * Thrown when a TastStart handler throws an exception
- */
-@EvaluatorSide
-@Private
-public final class TaskStartHandlerFailure extends Exception {
-
- /**
- * @param cause the exception thrown by the start handler
- */
- public TaskStartHandlerFailure(final EventHandler<TaskStart> handler, final Throwable cause) {
- super("EventHandler<TaskStart> `" + handler.toString() + "` threw an Exception in onNext()", cause);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/exceptions/TaskStopHandlerFailure.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/exceptions/TaskStopHandlerFailure.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/exceptions/TaskStopHandlerFailure.java
deleted file mode 100644
index a8a0794..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/exceptions/TaskStopHandlerFailure.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.evaluator.task.exceptions;
-
-import com.microsoft.reef.annotations.audience.EvaluatorSide;
-import com.microsoft.reef.annotations.audience.Private;
-import com.microsoft.reef.task.events.TaskStop;
-import com.microsoft.wake.EventHandler;
-
-/**
- * Thrown when a TaskStop handler throws an exception
- */
-@EvaluatorSide
-@Private
-public final class TaskStopHandlerFailure extends Exception {
-
- /**
- * @param cause the exception thrown by the stop handler
- */
- public TaskStopHandlerFailure(final EventHandler<TaskStop> handler, final Throwable cause) {
- super("EventHandler<TaskStop> `" + handler.toString() + "` threw an Exception in onNext()", cause);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/exceptions/TaskSuspendHandlerFailure.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/exceptions/TaskSuspendHandlerFailure.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/exceptions/TaskSuspendHandlerFailure.java
deleted file mode 100644
index 12dc3d2..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/exceptions/TaskSuspendHandlerFailure.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.evaluator.task.exceptions;
-
-import com.microsoft.reef.annotations.audience.EvaluatorSide;
-import com.microsoft.reef.annotations.audience.Private;
-
-/**
- * Thrown when a Task Suspend Handler throws an exception
- */
-@EvaluatorSide
-@Private
-public final class TaskSuspendHandlerFailure extends Exception {
-
- /**
- * @param cause the exception thrown by the task suspend handler's onNext() method.
- */
- public TaskSuspendHandlerFailure(final Throwable cause) {
- super("Task suspend handler threw an Exception.", cause);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/package-info.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/package-info.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/package-info.java
deleted file mode 100644
index a503deb..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/evaluator/task/package-info.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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.
- */
-/**
- * Task-related implementation of the Evaluator resourcemanager.
- */
-package com.microsoft.reef.runtime.common.evaluator.task;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/files/ClasspathProvider.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/files/ClasspathProvider.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/files/ClasspathProvider.java
deleted file mode 100644
index 8fcab3f..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/files/ClasspathProvider.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.files;
-
-import com.microsoft.reef.annotations.audience.RuntimeAuthor;
-import net.jcip.annotations.Immutable;
-
-import javax.inject.Inject;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * Supplies the classpath to REEF for process (Driver, Evaluator) launches.
- */
-@Immutable
-@RuntimeAuthor
-public final class ClasspathProvider {
- private final List<String> driverClasspath;
- private final List<String> evaluatorClasspath;
-
-
- @Inject
- ClasspathProvider(final RuntimeClasspathProvider runtimeClasspathProvider,
- final REEFFileNames reefFileNames) {
- final List<String> baseClasspath = Arrays.asList(
- reefFileNames.getLocalFolderPath() + "/*",
- reefFileNames.getGlobalFolderPath() + "/*");
-
- // Assemble the driver classpath
- final List<String> runtimeDriverClasspathPrefix = runtimeClasspathProvider.getDriverClasspathPrefix();
- final List<String> runtimeDriverClasspathSuffix = runtimeClasspathProvider.getDriverClasspathSuffix();
- final List<String> driverClasspath = new ArrayList<>(baseClasspath.size() +
- runtimeDriverClasspathPrefix.size() +
- runtimeDriverClasspathSuffix.size());
- driverClasspath.addAll(runtimeDriverClasspathPrefix);
- driverClasspath.addAll(baseClasspath);
- driverClasspath.addAll(runtimeDriverClasspathSuffix);
- this.driverClasspath = Collections.unmodifiableList(driverClasspath);
-
- // Assemble the evaluator classpath
- final List<String> runtimeEvaluatorClasspathPrefix = runtimeClasspathProvider.getEvaluatorClasspathPrefix();
- final List<String> runtimeEvaluatorClasspathSuffix = runtimeClasspathProvider.getEvaluatorClasspathSuffix();
- final List<String> evaluatorClasspath = new ArrayList<>(runtimeEvaluatorClasspathPrefix.size() +
- baseClasspath.size() +
- runtimeEvaluatorClasspathSuffix.size());
- evaluatorClasspath.addAll(runtimeEvaluatorClasspathPrefix);
- evaluatorClasspath.addAll(baseClasspath);
- evaluatorClasspath.addAll(runtimeEvaluatorClasspathSuffix);
- this.evaluatorClasspath = Collections.unmodifiableList(evaluatorClasspath);
- }
-
- /**
- * @return the classpath to be used for the Driver
- */
- public List<String> getDriverClasspath() {
- return this.driverClasspath;
- }
-
- /**
- * @return the classpath to be used for Evaluators.
- */
- public List<String> getEvaluatorClasspath() {
- return this.evaluatorClasspath;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/files/JobJarMaker.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/files/JobJarMaker.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/files/JobJarMaker.java
deleted file mode 100644
index fdf3595..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/files/JobJarMaker.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.files;
-
-import com.microsoft.reef.annotations.audience.ClientSide;
-import com.microsoft.reef.annotations.audience.Private;
-import com.microsoft.reef.annotations.audience.RuntimeAuthor;
-import com.microsoft.reef.proto.ClientRuntimeProtocol;
-import com.microsoft.reef.proto.ReefServiceProtos;
-import com.microsoft.reef.runtime.common.parameters.DeleteTempFiles;
-import com.microsoft.reef.util.JARFileMaker;
-import com.microsoft.tang.Configuration;
-import com.microsoft.tang.annotations.Parameter;
-import com.microsoft.tang.formats.ConfigurationSerializer;
-
-import javax.inject.Inject;
-import java.io.File;
-import java.io.IOException;
-import java.nio.file.Files;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Utility that takes a JobSubmissionProto and turns it into a Job Submission Jar.
- */
-@Private
-@RuntimeAuthor
-@ClientSide
-public final class JobJarMaker {
-
- private static final Logger LOG = Logger.getLogger(JobJarMaker.class.getName());
-
- private final ConfigurationSerializer configurationSerializer;
- private final REEFFileNames fileNames;
- private final boolean deleteTempFilesOnExit;
-
- @Inject
- JobJarMaker(final ConfigurationSerializer configurationSerializer,
- final REEFFileNames fileNames,
- final @Parameter(DeleteTempFiles.class) boolean deleteTempFilesOnExit) {
- this.configurationSerializer = configurationSerializer;
- this.fileNames = fileNames;
- this.deleteTempFilesOnExit = deleteTempFilesOnExit;
- }
-
- public File createJobSubmissionJAR(
- final ClientRuntimeProtocol.JobSubmissionProto jobSubmissionProto,
- final Configuration driverConfiguration) throws IOException {
-
- // Copy all files to a local job submission folder
- final File jobSubmissionFolder = makejobSubmissionFolder();
- LOG.log(Level.FINE, "Staging submission in {0}", jobSubmissionFolder);
-
- final File localFolder = new File(jobSubmissionFolder, this.fileNames.getLocalFolderName());
- final File globalFolder = new File(jobSubmissionFolder, this.fileNames.getGlobalFolderName());
-
- this.copy(jobSubmissionProto.getGlobalFileList(), globalFolder);
- this.copy(jobSubmissionProto.getLocalFileList(), localFolder);
-
- // Store the Driver Configuration in the JAR file.
- this.configurationSerializer.toFile(
- driverConfiguration, new File(localFolder, this.fileNames.getDriverConfigurationName()));
-
- // Create a JAR File for the submission
- final File jarFile = File.createTempFile(this.fileNames.getJobFolderPrefix(), this.fileNames.getJarFileSuffix());
-
- LOG.log(Level.FINE, "Creating job submission jar file: {0}", jarFile);
- new JARFileMaker(jarFile).addChildren(jobSubmissionFolder).close();
-
- if (this.deleteTempFilesOnExit) {
- LOG.log(Level.FINE,
- "Deleting the temporary job folder [{0}] and marking the jar file [{1}] for deletion after the JVM exits.",
- new Object[]{jobSubmissionFolder.getAbsolutePath(), jarFile.getAbsolutePath()});
- jobSubmissionFolder.delete();
- jarFile.deleteOnExit();
- } else {
- LOG.log(Level.FINE, "Keeping the temporary job folder [{0}] and jar file [{1}] available after job submission.",
- new Object[]{jobSubmissionFolder.getAbsolutePath(), jarFile.getAbsolutePath()});
- }
- return jarFile;
- }
-
- public static void copy(final Iterable<ReefServiceProtos.FileResourceProto> files, final File destinationFolder) {
-
- if (!destinationFolder.exists()) {
- destinationFolder.mkdirs();
- }
-
- for (final ReefServiceProtos.FileResourceProto fileProto : files) {
- final File sourceFile = toFile(fileProto);
- final File destinationFile = new File(destinationFolder, fileProto.getName());
- if (destinationFile.exists()) {
- LOG.log(Level.FINEST,
- "Will not add {0} to the job jar because another file with the same name was already added.",
- sourceFile.getAbsolutePath()
- );
- } else {
- try {
- java.nio.file.Files.copy(sourceFile.toPath(), destinationFile.toPath());
- } catch (final IOException e) {
- final String message = new StringBuilder("Copy of file [")
- .append(sourceFile.getAbsolutePath())
- .append("] to [")
- .append(destinationFile.getAbsolutePath())
- .append("] failed.")
- .toString();
- throw new RuntimeException(message, e);
- }
- }
- }
- }
-
- private static File toFile(final ReefServiceProtos.FileResourceProto fileProto) {
- return new File(fileProto.getPath());
- }
-
- private File makejobSubmissionFolder() throws IOException {
- return Files.createTempDirectory(this.fileNames.getJobFolderPrefix()).toFile();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/files/REEFFileNames.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/files/REEFFileNames.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/files/REEFFileNames.java
deleted file mode 100644
index 8f8a60a..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/files/REEFFileNames.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.files;
-
-import com.microsoft.reef.util.OSUtils;
-import net.jcip.annotations.Immutable;
-import org.apache.commons.lang.StringUtils;
-
-import javax.inject.Inject;
-import java.io.File;
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * Access to the various places things go according to the REEF file system standard.
- */
-@Immutable
-public final class REEFFileNames {
-
- private static final String REEF_BASE_FOLDER = "reef";
- private static final String GLOBAL_FOLDER = "global";
- private static final String LOCAL_FOLDER = "local";
- private static final String DRIVER_CONFIGURATION_NAME = "driver.conf";
- private static final String EVALUATOR_CONFIGURATION_NAME = "evaluator.conf";
- private static final String JAR_FILE_SUFFIX = ".jar";
- private static final String JOB_FOLDER_PREFIX = "reef-job-";
- private static final String EVALUATOR_FOLDER_PREFIX = "reef-evaluator-";
- private static final String DRIVER_STDERR = "driver.stderr";
- private static final String DRIVER_STDOUT = "driver.stdout";
- private static final String EVALUATOR_STDERR = "evaluator.stderr";
- private static final String EVALUATOR_STDOUT = "evaluator.stdout";
-
- static final String GLOBAL_FOLDER_PATH = REEF_BASE_FOLDER + '/' + GLOBAL_FOLDER;
- static final String LOCAL_FOLDER_PATH = REEF_BASE_FOLDER + '/' + LOCAL_FOLDER;
-
- private static final String DRIVER_CONFIGURATION_PATH =
- LOCAL_FOLDER_PATH + '/' + DRIVER_CONFIGURATION_NAME;
-
- private static final String EVALUATOR_CONFIGURATION_PATH =
- LOCAL_FOLDER_PATH + '/' + EVALUATOR_CONFIGURATION_NAME;
-
- @Inject
- public REEFFileNames() {
- }
-
- /**
- * The name of the REEF folder inside of the working directory of an Evaluator or Driver
- */
- public String getREEFFolderName() {
- return REEF_BASE_FOLDER;
- }
-
- /**
- * @return the folder und which all REEF files are stored.
- */
- public File getREEFFolder() {
- return new File(getREEFFolderName());
- }
-
-
- /**
- * @return the name of the folder inside of REEF_BASE_FOLDER that houses the global files.
- */
- public String getGlobalFolderName() {
- return GLOBAL_FOLDER;
- }
-
- /**
- * @return the path to the global folder: REEF_BASE_FOLDER/GLOBAL_FOLDER
- */
- public String getGlobalFolderPath() {
- return GLOBAL_FOLDER_PATH;
- }
-
- /**
- * @return the folder holding the files global to all containers.
- */
- public File getGlobalFolder() {
- return new File(getREEFFolder(), getGlobalFolderName());
- }
-
-
- /**
- * @return the name of the folder inside of REEF_BASE_FOLDER that houses the local files.
- */
- public String getLocalFolderName() {
- return LOCAL_FOLDER;
- }
-
- /**
- * @return the path to the local folder: REEF_BASE_FOLDER/LOCAL_FOLDER
- */
- public String getLocalFolderPath() {
- return LOCAL_FOLDER_PATH;
- }
-
- /**
- * @return the folder holding the files local to this container.
- */
- public File getLocalFolder() {
- return new File(getREEFFolder(), getLocalFolderName());
- }
-
-
- /**
- * The name under which the driver configuration will be stored in REEF_BASE_FOLDER/LOCAL_FOLDER
- */
- public String getDriverConfigurationName() {
- return DRIVER_CONFIGURATION_NAME;
- }
-
- /**
- * @return The path to the driver configuration: GLOBAL_FOLDER/LOCAL_FOLDER/DRIVER_CONFIGURATION_NAME
- */
- public String getDriverConfigurationPath() {
- return DRIVER_CONFIGURATION_PATH;
- }
-
- /**
- * @return The name under which the driver configuration will be stored in REEF_BASE_FOLDER/LOCAL_FOLDER
- */
- public String getEvaluatorConfigurationName() {
- return EVALUATOR_CONFIGURATION_NAME;
- }
-
- /**
- * @return the path to the evaluator configuration.
- */
- public String getEvaluatorConfigurationPath() {
- return EVALUATOR_CONFIGURATION_PATH;
- }
-
- /**
- * @return The suffix used for JAR files, including the "."
- */
- public String getJarFileSuffix() {
- return JAR_FILE_SUFFIX;
- }
-
- /**
- * The prefix used whenever REEF is asked to create a job folder, on (H)DFS or locally.
- * <p/>
- * This prefix is also used with JAR files created to represent a job.
- */
- public String getJobFolderPrefix() {
- return JOB_FOLDER_PREFIX;
- }
-
- /**
- * @return The name used within the current working directory of the driver to redirect standard error to.
- */
- public String getDriverStderrFileName() {
- return DRIVER_STDERR;
- }
-
- /**
- * @return The name used within the current working directory of the driver to redirect standard out to.
- */
- public String getDriverStdoutFileName() {
- return DRIVER_STDOUT;
- }
-
- /**
- * @return The prefix used whenever REEF is asked to create an Evaluator folder, e.g. for staging.
- */
- public String getEvaluatorFolderPrefix() {
- return EVALUATOR_FOLDER_PREFIX;
- }
-
- /**
- * @return The name used within the current working directory of the driver to redirect standard error to.
- */
- public String getEvaluatorStderrFileName() {
- return EVALUATOR_STDERR;
- }
-
- /**
- * @return The name used within the current working directory of the driver to redirect standard out to.
- */
- public String getEvaluatorStdoutFileName() {
- return EVALUATOR_STDOUT;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/files/RuntimeClasspathProvider.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/files/RuntimeClasspathProvider.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/files/RuntimeClasspathProvider.java
deleted file mode 100644
index 0819cc4..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/files/RuntimeClasspathProvider.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.files;
-
-import java.util.List;
-
-/**
- * Interface to be implemented by each REEF runtime (YARN, Mesos, Local) to provide additional classpath elements to be
- * pre- and postfixed to the user classpath.
- */
-public interface RuntimeClasspathProvider {
-
- /**
- * @return the classpath to be prefixed in front of the user classpath of the Driver.
- */
- List<String> getDriverClasspathPrefix();
-
- /**
- * @return the classpath to be suffixed after of the user classpath of the Driver.
- */
- List<String> getDriverClasspathSuffix();
-
- /**
- * @return the classpath to be prefixed in front of the user classpath of each Evaluator.
- */
- List<String> getEvaluatorClasspathPrefix();
-
- /**
- * @return the classpath to be suffixed after of the user classpath of each Evaluator.
- */
- List<String> getEvaluatorClasspathSuffix();
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/files/package-info.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/files/package-info.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/files/package-info.java
deleted file mode 100644
index 216da03..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/files/package-info.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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.
- */
-/**
- * This package will contain the implementation of the REEF file system standard.
- */
-package com.microsoft.reef.runtime.common.files;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/CLRLaunchCommandBuilder.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/CLRLaunchCommandBuilder.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/CLRLaunchCommandBuilder.java
deleted file mode 100644
index 38219e6..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/CLRLaunchCommandBuilder.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.launch;
-
-import org.apache.commons.lang.StringUtils;
-
-import java.io.File;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * A builder for the command line to launch a CLR Evaluator.
- */
-public class CLRLaunchCommandBuilder implements LaunchCommandBuilder {
- private static final Logger LOG = Logger.getLogger(CLRLaunchCommandBuilder.class.getName());
- private static final String EVALUATOR_PATH = "reef/global/Microsoft.Reef.Evaluator.exe";
-
-
- private String standardErrPath = null;
- private String standardOutPath = null;
- private String errorHandlerRID = null;
- private String launchID = null;
- private int megaBytes = 0;
- private String evaluatorConfigurationPath = null;
-
- @Override
- public List<String> build() {
- final List<String> result = new LinkedList<>();
- File f = new File(EVALUATOR_PATH);
- if (!f.exists()) {
- LOG.log(Level.WARNING, "file can NOT be found: {0}", f.getAbsolutePath());
- }
- result.add(f.getPath());
- result.add(errorHandlerRID);
- result.add(evaluatorConfigurationPath);
- if ((null != this.standardOutPath) && (!standardOutPath.isEmpty())) {
- result.add(">" + this.standardOutPath);
- }
- if ((null != this.standardErrPath) && (!standardErrPath.isEmpty())) {
- result.add("2>" + this.standardErrPath);
- }
- LOG.log(Level.FINE, "Launch Exe: {0}", StringUtils.join(result, ' '));
- return result;
- }
-
- @Override
- public CLRLaunchCommandBuilder setErrorHandlerRID(final String errorHandlerRID) {
- this.errorHandlerRID = errorHandlerRID;
- return this;
- }
-
- @Override
- public CLRLaunchCommandBuilder setLaunchID(final String launchID) {
- this.launchID = launchID;
- return this;
- }
-
- @Override
- public CLRLaunchCommandBuilder setMemory(final int megaBytes) {
- this.megaBytes = megaBytes;
- return this;
- }
-
- @Override
- public CLRLaunchCommandBuilder setConfigurationFileName(final String configurationFileName) {
- this.evaluatorConfigurationPath = configurationFileName;
- return this;
- }
-
- @Override
- public CLRLaunchCommandBuilder setStandardOut(final String standardOut) {
- this.standardOutPath = standardOut;
- return this;
- }
-
- @Override
- public CLRLaunchCommandBuilder setStandardErr(final String standardErr) {
- this.standardErrPath = standardErr;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/JavaLaunchCommandBuilder.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/JavaLaunchCommandBuilder.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/JavaLaunchCommandBuilder.java
deleted file mode 100644
index f732391..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/JavaLaunchCommandBuilder.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.launch;
-
-import com.microsoft.reef.runtime.common.Launcher;
-import com.microsoft.reef.runtime.common.launch.parameters.ClockConfigurationPath;
-import com.microsoft.reef.runtime.common.launch.parameters.ErrorHandlerRID;
-import com.microsoft.reef.runtime.common.launch.parameters.LaunchID;
-import com.microsoft.reef.util.EnvironmentUtils;
-import org.apache.commons.lang.StringUtils;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-public final class JavaLaunchCommandBuilder implements LaunchCommandBuilder {
- private static final String DEFAULT_JAVA_PATH = System.getenv("JAVA_HOME") + "/bin/" + "java";
- private String stderrPath = null;
- private String stdoutPath = null;
- private String errorHandlerRID = null;
- private String launchID = null;
- private int megaBytes = 0;
- private String evaluatorConfigurationPath = null;
- private String javaPath = null;
- private String classPath = null;
- private Boolean assertionsEnabled = null;
-
- @Override
- public List<String> build() {
- return new ArrayList<String>() {{
-
- if (javaPath == null || javaPath.isEmpty()) {
- add(DEFAULT_JAVA_PATH);
- } else {
- add(javaPath);
- }
-
- add("-XX:PermSize=128m");
- add("-XX:MaxPermSize=128m");
- // Set Xmx based on am memory size
- add("-Xmx" + megaBytes + "m");
-
- if ((assertionsEnabled != null && assertionsEnabled)
- || EnvironmentUtils.areAssertionsEnabled()) {
- add("-ea");
- }
-
- if (classPath != null && !classPath.isEmpty()) {
- add("-classpath");
- add(classPath);
- }
-
- Launcher.propagateProperties(this, true, "proc_reef");
- Launcher.propagateProperties(this, false,
- "java.util.logging.config.file", "java.util.logging.config.class");
-
- add(Launcher.class.getName());
-
- add("-" + ErrorHandlerRID.SHORT_NAME);
- add(errorHandlerRID);
- add("-" + LaunchID.SHORT_NAME);
- add(launchID);
- add("-" + ClockConfigurationPath.SHORT_NAME);
- add(evaluatorConfigurationPath);
-
- if (stdoutPath != null && !stdoutPath.isEmpty()) {
- add("1>");
- add(stdoutPath);
- }
-
- if (stderrPath != null && !stderrPath.isEmpty()) {
- add("2>");
- add(stderrPath);
- }
- }};
- }
-
- @Override
- public JavaLaunchCommandBuilder setErrorHandlerRID(final String errorHandlerRID) {
- this.errorHandlerRID = errorHandlerRID;
- return this;
- }
-
- @Override
- public JavaLaunchCommandBuilder setLaunchID(final String launchID) {
- this.launchID = launchID;
- return this;
- }
-
- @Override
- public JavaLaunchCommandBuilder setMemory(final int megaBytes) {
- this.megaBytes = megaBytes;
- return this;
- }
-
- @Override
- public JavaLaunchCommandBuilder setConfigurationFileName(final String configurationFileName) {
- this.evaluatorConfigurationPath = configurationFileName;
- return this;
- }
-
- @Override
- public JavaLaunchCommandBuilder setStandardOut(final String standardOut) {
- this.stdoutPath = standardOut;
- return this;
- }
-
- @Override
- public JavaLaunchCommandBuilder setStandardErr(final String standardErr) {
- this.stderrPath = standardErr;
- return this;
- }
-
- /**
- * Set the path to the java executable. Will default to a heuristic search if not set.
- *
- * @param path
- * @return this
- */
- public JavaLaunchCommandBuilder setJavaPath(final String path) {
- this.javaPath = path;
- return this;
- }
-
- public JavaLaunchCommandBuilder setClassPath(final String classPath) {
- this.classPath = classPath;
- return this;
- }
-
- public JavaLaunchCommandBuilder setClassPath(final Collection<String> classPathElements) {
- this.classPath = "\"" + StringUtils.join(classPathElements, File.pathSeparatorChar) + "\"";
- return this;
- }
-
- /**
- * Enable or disable assertions on the child process.
- * If not set, the setting is taken from the JVM that executes the code.
- *
- * @param assertionsEnabled
- * @return this
- */
- public JavaLaunchCommandBuilder enableAssertions(final boolean assertionsEnabled) {
- this.assertionsEnabled = assertionsEnabled;
- return this;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/LaunchClass.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/LaunchClass.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/LaunchClass.java
deleted file mode 100644
index 7aa628b..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/LaunchClass.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.launch;
-
-import com.microsoft.reef.runtime.common.evaluator.PIDStoreStartHandler;
-import com.microsoft.reef.runtime.common.launch.parameters.ClockConfigurationPath;
-import com.microsoft.reef.runtime.common.launch.parameters.ErrorHandlerRID;
-import com.microsoft.reef.runtime.common.launch.parameters.LaunchID;
-import com.microsoft.reef.runtime.common.utils.RemoteManager;
-import com.microsoft.tang.*;
-import com.microsoft.tang.annotations.Name;
-import com.microsoft.tang.annotations.NamedParameter;
-import com.microsoft.tang.annotations.Parameter;
-import com.microsoft.tang.formats.ConfigurationSerializer;
-import com.microsoft.wake.profiler.WakeProfiler;
-import com.microsoft.wake.remote.RemoteConfiguration;
-import com.microsoft.wake.time.Clock;
-
-import javax.inject.Inject;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * This encapsulates processes started by REEF.
- */
-public final class LaunchClass implements AutoCloseable, Runnable {
-
- private static final Logger LOG = Logger.getLogger(LaunchClass.class.getName());
- private final RemoteManager remoteManager;
- private final String launchID;
- private final String errorHandlerID;
- private final String evaluatorConfigurationPath;
- private final boolean isProfilingEnabled;
- private final REEFErrorHandler errorHandler;
- private final ConfigurationSerializer configurationSerializer;
- private WakeProfiler profiler;
-
- @Inject
- LaunchClass(final RemoteManager remoteManager,
- final REEFUncaughtExceptionHandler uncaughtExceptionHandler,
- final REEFErrorHandler errorHandler,
- final @Parameter(LaunchID.class) String launchID,
- final @Parameter(ErrorHandlerRID.class) String errorHandlerID,
- final @Parameter(ClockConfigurationPath.class) String evaluatorConfigurationPath,
- final @Parameter(ProfilingEnabled.class) boolean enableProfiling,
- final ConfigurationSerializer configurationSerializer) {
- this.remoteManager = remoteManager;
- this.launchID = launchID;
- this.errorHandlerID = errorHandlerID;
- this.evaluatorConfigurationPath = evaluatorConfigurationPath;
- this.isProfilingEnabled = enableProfiling;
- this.errorHandler = errorHandler;
- this.configurationSerializer = configurationSerializer;
-
-
- // Registering a default exception handler. It sends every exception to the upstream RemoteManager
- Thread.setDefaultUncaughtExceptionHandler(uncaughtExceptionHandler);
-
-
- if (isProfilingEnabled) {
- this.profiler = new WakeProfiler();
- ProfilingStopHandler.setProfiler(profiler); // TODO: This probably should be bound via Tang.
- }
- }
-
- /**
- * Loads the client and resource manager configuration files from disk.
- */
- private Configuration getClockConfiguration() {
- return Configurations.merge(readConfigurationFromDisk(), getStaticClockConfiguration());
- }
-
-
- private Configuration readConfigurationFromDisk() {
- LOG.log(Level.FINEST, "Loading configuration file: {0}", this.evaluatorConfigurationPath);
-
- final File evaluatorConfigFile = new File(this.evaluatorConfigurationPath);
-
- if (!evaluatorConfigFile.exists()) {
- final String message = "The configuration file " + this.evaluatorConfigurationPath +
- "doesn't exist. This points to an issue in the job submission.";
- fail(message, new FileNotFoundException());
- throw new RuntimeException(message);
- } else if (!evaluatorConfigFile.canRead()) {
- final String message = "The configuration file " + this.evaluatorConfigurationPath + " exists, but can't be read";
- fail(message, new IOException());
- throw new RuntimeException(message);
- } else {
- try {
- return this.configurationSerializer.fromFile(evaluatorConfigFile);
- } catch (final IOException e) {
- final String message = "Unable to parse the configuration file " + this.evaluatorConfigurationPath;
- fail(message, e);
- throw new RuntimeException(message, e);
- }
- }
- }
-
- /**
- * @return the part of the clock configuration *not* read from disk.
- */
- private Configuration getStaticClockConfiguration() {
- final JavaConfigurationBuilder builder = Tang.Factory.getTang().newConfigurationBuilder()
- .bindNamedParameter(LaunchID.class, this.launchID)
- .bindNamedParameter(ErrorHandlerRID.class, this.errorHandlerID)
- .bindSetEntry(Clock.StartHandler.class, PIDStoreStartHandler.class)
- .bindNamedParameter(RemoteConfiguration.ErrorHandler.class, REEFErrorHandler.class)
- .bindNamedParameter(RemoteConfiguration.ManagerName.class, "REEF_LAUNCHER")
- .bindNamedParameter(RemoteConfiguration.MessageCodec.class, REEFMessageCodec.class);
- if (this.isProfilingEnabled) {
- builder.bindSetEntry(Clock.StopHandler.class, ProfilingStopHandler.class);
- }
- return builder.build();
- }
-
- /**
- * Instantiates the clock.
- *
- * @return a clock object.
- */
- private Clock getClock() {
- try {
- final Injector clockInjector = Tang.Factory.getTang().newInjector(this.getClockConfiguration());
- if (isProfilingEnabled) {
- clockInjector.bindAspect(profiler);
- }
- clockInjector.bindVolatileInstance(RemoteManager.class, this.remoteManager);
- return clockInjector.getInstance(Clock.class);
- } catch (final Throwable ex) {
- fail("Unable to instantiate the clock", ex);
- throw new RuntimeException("Unable to instantiate the clock", ex);
- }
- }
-
- /**
- * Starts the Clock.
- * This blocks until the clock returns.
- */
- @Override
- public void run() {
- LOG.entering(this.getClass().getName(), "run", "Starting the clock");
- try {
- this.getClock().run();
- } catch (final Throwable t) {
- fail("Fatal exception while executing the clock", t);
- }
- LOG.exiting(this.getClass().getName(), "run", "Clock terminated");
- }
-
- /**
- * Closes the remote manager managed by this class.
- *
- * @throws Exception
- */
- @Override
- public void close() throws Exception {
- LOG.entering(this.getClass().getName(), "close");
- this.errorHandler.close(); // Also closes the remoteManager
- LOG.exiting(this.getClass().getName(), "close");
- }
-
- private void fail(final String message, final Throwable throwable) {
- this.errorHandler.onNext(new Exception(message, throwable));
- }
-
- @NamedParameter(doc = "If true, profiling will be enabled", short_name = "profiling", default_value = "false")
- public final static class ProfilingEnabled implements Name<Boolean> {
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/LaunchCommandBuilder.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/LaunchCommandBuilder.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/LaunchCommandBuilder.java
deleted file mode 100644
index 21b3a61..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/LaunchCommandBuilder.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.launch;
-
-import java.util.List;
-
-/**
- * Used to build the launch command for REEF processes.
- */
-public interface LaunchCommandBuilder {
-
-
- /**
- * @return the launch command line
- */
- public List<String> build();
-
- public LaunchCommandBuilder setErrorHandlerRID(final String errorHandlerRID);
-
- public LaunchCommandBuilder setLaunchID(final String launchID);
-
- public LaunchCommandBuilder setMemory(final int megaBytes);
-
- /**
- * Set the name of the configuration file for the Launcher. This file is assumed to exist in the working directory of
- * the process launched with this command line.
- *
- * @param configurationFileName
- * @return this
- */
- public LaunchCommandBuilder setConfigurationFileName(final String configurationFileName);
-
- /**
- * Names a file to which stdout will be redirected.
- *
- * @param standardOut
- * @return this
- */
- public LaunchCommandBuilder setStandardOut(final String standardOut);
-
- /**
- * Names a file to which stderr will be redirected.
- *
- * @param standardErr
- * @return this
- */
- public LaunchCommandBuilder setStandardErr(final String standardErr);
-
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/LauncherSingletons.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/LauncherSingletons.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/LauncherSingletons.java
deleted file mode 100644
index bc61578..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/LauncherSingletons.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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.
- */
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/ProfilingStopHandler.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/ProfilingStopHandler.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/ProfilingStopHandler.java
deleted file mode 100644
index e8bd27e..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/ProfilingStopHandler.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.launch;
-
-import com.microsoft.reef.runtime.common.launch.parameters.LaunchID;
-import com.microsoft.tang.annotations.Parameter;
-import com.microsoft.wake.EventHandler;
-import com.microsoft.wake.profiler.WakeProfiler;
-import com.microsoft.wake.time.event.StopTime;
-
-import javax.inject.Inject;
-import java.io.FileNotFoundException;
-import java.io.PrintWriter;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * An EventHandler that writes out the profiler results.
- */
-final class ProfilingStopHandler implements EventHandler<StopTime> {
- private static final Logger LOG = Logger.getLogger(ProfilingStopHandler.class.getName());
- private static WakeProfiler profiler;
- private final String launchID;
-
- @Inject
- public ProfilingStopHandler(final @Parameter(LaunchID.class) String launchID) {
- this.launchID = launchID;
- }
-
- static void setProfiler(final WakeProfiler profiler) {
- ProfilingStopHandler.profiler = profiler;
- }
-
- @Override
- public void onNext(final StopTime stopTime) {
- try (final PrintWriter out = new PrintWriter("profile-" + launchID + ".json")) {
- out.print(profiler.objectGraphToString());
- } catch (final FileNotFoundException e) {
- LOG.log(Level.WARNING, "Unable to write the profile", e);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/REEFErrorHandler.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/REEFErrorHandler.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/REEFErrorHandler.java
deleted file mode 100644
index faa3b69..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/REEFErrorHandler.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.launch;
-
-import com.google.protobuf.ByteString;
-import com.microsoft.reef.proto.ReefServiceProtos;
-import com.microsoft.reef.runtime.common.launch.parameters.ErrorHandlerRID;
-import com.microsoft.reef.runtime.common.launch.parameters.LaunchID;
-import com.microsoft.reef.runtime.common.utils.ExceptionCodec;
-import com.microsoft.reef.runtime.common.utils.RemoteManager;
-import com.microsoft.tang.InjectionFuture;
-import com.microsoft.tang.annotations.Parameter;
-import com.microsoft.wake.EventHandler;
-
-import javax.inject.Inject;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-
-/**
- * The error handler REEF registers with Wake.
- */
-public final class REEFErrorHandler implements EventHandler<Throwable> {
-
- private static final Logger LOG = Logger.getLogger(REEFErrorHandler.class.getName());
-
- // This class is used as the ErrorHandler in the RemoteManager. Hence, we need an InjectionFuture here.
- private final InjectionFuture<RemoteManager> remoteManager;
- private final String launchID;
- private final String errorHandlerRID;
- private final ExceptionCodec exceptionCodec;
-
- @Inject
- REEFErrorHandler(final InjectionFuture<RemoteManager> remoteManager,
- final @Parameter(ErrorHandlerRID.class) String errorHandlerRID,
- final @Parameter(LaunchID.class) String launchID,
- final ExceptionCodec exceptionCodec) {
- this.errorHandlerRID = errorHandlerRID;
- this.remoteManager = remoteManager;
- this.launchID = launchID;
- this.exceptionCodec = exceptionCodec;
- }
-
- @Override
- public void onNext(final Throwable e) {
- LOG.log(Level.SEVERE, "Uncaught exception.", e);
- // TODO: This gets a new EventHandler each time an exception is caught. It would be better to cache the handler. But
- // that introduces threading issues and isn't really worth it, as the JVM typically will be killed once we catch an
- // Exception in here.
- if (!this.errorHandlerRID.equals(ErrorHandlerRID.NONE)) {
- final EventHandler<ReefServiceProtos.RuntimeErrorProto> runtimeErrorHandler = this.remoteManager.get()
- .getHandler(errorHandlerRID, ReefServiceProtos.RuntimeErrorProto.class);
- final ReefServiceProtos.RuntimeErrorProto message = ReefServiceProtos.RuntimeErrorProto.newBuilder()
- .setName("reef")
- .setIdentifier(launchID)
- .setMessage(e.getMessage())
- .setException(ByteString.copyFrom(this.exceptionCodec.toBytes(e)))
- .build();
- try {
- runtimeErrorHandler.onNext(message);
- } catch (final Throwable t) {
- LOG.log(Level.SEVERE, "Unable to send the error upstream", t);
- }
- } else {
- LOG.log(Level.SEVERE, "Caught an exception from Wake we cannot send upstream because there is no upstream");
- }
- }
-
- public void close() {
- try {
- this.remoteManager.get().close();
- } catch (final Throwable ex) {
- LOG.log(Level.SEVERE, "Unable to close the remote manager", ex);
- }
- }
-
- @Override
- public String toString() {
- return "REEFErrorHandler{" +
- "remoteManager=" + remoteManager +
- ", launchID='" + launchID + '\'' +
- ", errorHandlerRID='" + errorHandlerRID + '\'' +
- '}';
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/REEFMessageCodec.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/REEFMessageCodec.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/REEFMessageCodec.java
deleted file mode 100644
index b09fac5..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/REEFMessageCodec.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.launch;
-
-import com.google.protobuf.GeneratedMessage;
-import com.google.protobuf.InvalidProtocolBufferException;
-import com.microsoft.reef.annotations.Provided;
-import com.microsoft.reef.annotations.audience.ClientSide;
-import com.microsoft.reef.annotations.audience.DriverSide;
-import com.microsoft.reef.annotations.audience.EvaluatorSide;
-import com.microsoft.reef.annotations.audience.Private;
-import com.microsoft.reef.proto.ClientRuntimeProtocol;
-import com.microsoft.reef.proto.EvaluatorRuntimeProtocol;
-import com.microsoft.reef.proto.REEFProtocol;
-import com.microsoft.reef.proto.ReefServiceProtos;
-import com.microsoft.wake.remote.Codec;
-
-import javax.inject.Inject;
-
-/**
- * Codec for REEF's control flow messages.
- */
-@Private
-@Provided
-@ClientSide
-@DriverSide
-@EvaluatorSide
-public final class REEFMessageCodec implements Codec<GeneratedMessage> {
-
-
- @Inject
- private REEFMessageCodec() {
- }
-
- @Override
- public GeneratedMessage decode(final byte[] bytes) {
- try {
- final REEFProtocol.REEFMessage message = REEFProtocol.REEFMessage.parseFrom(bytes);
- if (message.hasJobSubmission()) {
- return message.getJobSubmission();
- } else if (message.hasJobControl()) {
- return message.getJobControl();
- } else if (message.hasRuntimeError()) {
- return message.getRuntimeError();
- } else if (message.hasJobStatus()) {
- return message.getJobStatus();
- } else if (message.hasEvaluatorControl()) {
- return message.getEvaluatorControl();
- } else if (message.hasEvaluatorHeartBeat()) {
- return message.getEvaluatorHeartBeat();
- }
- throw new RuntimeException("Unable to decode a message: " + message.toString());
- } catch (final InvalidProtocolBufferException e) {
- throw new RuntimeException("Unable to decode a message", e);
- }
- }
-
- @Override
- public byte[] encode(final GeneratedMessage msg) {
- final REEFProtocol.REEFMessage.Builder message = REEFProtocol.REEFMessage.newBuilder();
-
- if (msg instanceof ClientRuntimeProtocol.JobSubmissionProto) {
- message.setJobSubmission((ClientRuntimeProtocol.JobSubmissionProto) msg);
- } else if (msg instanceof ClientRuntimeProtocol.JobControlProto) {
- message.setJobControl((ClientRuntimeProtocol.JobControlProto) msg);
- } else if (msg instanceof ReefServiceProtos.RuntimeErrorProto) {
- message.setRuntimeError((ReefServiceProtos.RuntimeErrorProto) msg);
- } else if (msg instanceof ReefServiceProtos.JobStatusProto) {
- message.setJobStatus((ReefServiceProtos.JobStatusProto) msg);
- } else if (msg instanceof EvaluatorRuntimeProtocol.EvaluatorControlProto) {
- message.setEvaluatorControl((EvaluatorRuntimeProtocol.EvaluatorControlProto) msg);
- } else if (msg instanceof EvaluatorRuntimeProtocol.EvaluatorHeartbeatProto) {
- message.setEvaluatorHeartBeat((EvaluatorRuntimeProtocol.EvaluatorHeartbeatProto) msg);
- } else {
- throw new RuntimeException("Unable to serialize: " + msg);
- }
-
- return message.build().toByteArray();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/REEFUncaughtExceptionHandler.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/REEFUncaughtExceptionHandler.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/REEFUncaughtExceptionHandler.java
deleted file mode 100644
index 5ccd565..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/REEFUncaughtExceptionHandler.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.launch;
-
-import javax.inject.Inject;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * This is used as the Exception handler for REEF client processes (Driver, Evaluator).
- * <p/>
- * It catches all exceptions and sends them to the controlling process.
- * For Evaluators, that is the Driver. For the Driver, that is the Client.
- * <p/>
- * After sending the exception, this shuts down the JVM, as this JVM is then officially dead.
- */
-final class REEFUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler {
- private static final Logger LOG = Logger.getLogger(REEFUncaughtExceptionHandler.class.getName());
- private final REEFErrorHandler errorHandler;
-
-
- /**
- * @param errorHandler
- */
- @Inject
- REEFUncaughtExceptionHandler(final REEFErrorHandler errorHandler) {
- this.errorHandler = errorHandler;
- }
-
- @Override
- public final synchronized void uncaughtException(final Thread thread, final Throwable throwable) {
- final String msg = "Thread " + thread.getName() + " threw an uncaught exception.";
- LOG.log(Level.SEVERE, msg, throwable);
- this.errorHandler.onNext(new Exception(msg, throwable));
- try {
- this.wait(100); // TODO: Remove
- } catch (final InterruptedException e) {
-
- }
- this.errorHandler.close();
- LOG.log(Level.SEVERE, "System.exit(1)");
- System.exit(1);
- }
-
- @Override
- public String toString() {
- return "REEFUncaughtExceptionHandler{" +
- "errorHandler=" + errorHandler +
- '}';
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/package-info.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/package-info.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/package-info.java
deleted file mode 100644
index 0fbd202..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/package-info.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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.
- */
-/**
- * Common launch code between Driver and Evaluator.
- */
-package com.microsoft.reef.runtime.common.launch;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/parameters/ClockConfigurationPath.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/parameters/ClockConfigurationPath.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/parameters/ClockConfigurationPath.java
deleted file mode 100644
index 54fbe0b..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/parameters/ClockConfigurationPath.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.launch.parameters;
-
-import com.microsoft.tang.annotations.Name;
-import com.microsoft.tang.annotations.NamedParameter;
-
-/**
- * The path to the clock configuration
- */
-@NamedParameter(doc = "The path to process configuration.", short_name = ClockConfigurationPath.SHORT_NAME)
-public final class ClockConfigurationPath implements Name<String> {
- public static final String SHORT_NAME = "runtime_configuration";
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/parameters/ErrorHandlerRID.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/parameters/ErrorHandlerRID.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/parameters/ErrorHandlerRID.java
deleted file mode 100644
index bd8bc8b..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/parameters/ErrorHandlerRID.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.launch.parameters;
-
-import com.microsoft.tang.annotations.Name;
-import com.microsoft.tang.annotations.NamedParameter;
-
-@NamedParameter(doc = "The error handler remote identifier.", short_name = ErrorHandlerRID.SHORT_NAME, default_value = ErrorHandlerRID.NONE)
-public final class ErrorHandlerRID implements Name<String> {
- /**
- * Indicates that no ErrorHandler is bound.
- */
- // TODO: Find all comparisons with this and see whether we can do something about them
- public static final String NONE = "NO_ERROR_HANDLER_REMOTE_ID";
-
- /**
- * Short name for the command line and such.
- */
- public static final String SHORT_NAME = "error_handler_rid";
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/parameters/LaunchID.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/parameters/LaunchID.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/parameters/LaunchID.java
deleted file mode 100644
index 8d50c42..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/parameters/LaunchID.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.launch.parameters;
-
-import com.microsoft.tang.annotations.Name;
-import com.microsoft.tang.annotations.NamedParameter;
-
-@NamedParameter(doc = "The launch identifier.", short_name = LaunchID.SHORT_NAME)
-public final class LaunchID implements Name<String> {
- public static final String SHORT_NAME = "launch_id";
-}
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/parameters/package-info.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/parameters/package-info.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/parameters/package-info.java
deleted file mode 100644
index 5563581..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/launch/parameters/package-info.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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.
- */
-/**
- * Parameters of the Launcher.
- */
-package com.microsoft.reef.runtime.common.launch.parameters;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/package-info.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/package-info.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/package-info.java
deleted file mode 100644
index 2d84abf..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/package-info.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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.
- */
-
-/**
- * REEF implementation.
- * This is referred to as the `common resourcemanager` that contains code
- * common to implementations of REEF on all resource managers.
- * The individual resource managers are implemented by providing implementations
- * of the various interfaces presribed in sub-packages called `API`.
- */
-package com.microsoft.reef.runtime.common;
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/50444bba/reef-common/src/main/java/com/microsoft/reef/runtime/common/parameters/DeleteTempFiles.java
----------------------------------------------------------------------
diff --git a/reef-common/src/main/java/com/microsoft/reef/runtime/common/parameters/DeleteTempFiles.java b/reef-common/src/main/java/com/microsoft/reef/runtime/common/parameters/DeleteTempFiles.java
deleted file mode 100644
index e35e2e2..0000000
--- a/reef-common/src/main/java/com/microsoft/reef/runtime/common/parameters/DeleteTempFiles.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * Copyright (C) 2014 Microsoft Corporation
- *
- * Licensed 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 com.microsoft.reef.runtime.common.parameters;
-
-import com.microsoft.tang.annotations.Name;
-import com.microsoft.tang.annotations.NamedParameter;
-
-/**
- * Whether or not to delete the temporary files created during Driver and Evaluator submission.
- */
-@NamedParameter(doc = "Whether or not to delete the temporary files created during Driver and Evaluator submission.", default_value = "true")
-public final class DeleteTempFiles implements Name<Boolean> {
- private DeleteTempFiles() {
- }
-}