Repository: incubator-reef
Updated Branches:
  refs/heads/master 85c01c6ce -> 53bed07a9


[REEF-366]: Initial project setup for Vortex

This addressed the issue by:
  * Creating a directory 'lang/java/reef-applications/vortex'
  * Creating necessary pom files
  * Adding 'reef-applications' submodule to the pom file at the root directory

JIRA:
  [REEF-366] https://issues.apache.org/jira/browse/REEF-366

Pull Request:
  Closes #214


Project: http://git-wip-us.apache.org/repos/asf/incubator-reef/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-reef/commit/53bed07a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-reef/tree/53bed07a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-reef/diff/53bed07a

Branch: refs/heads/master
Commit: 53bed07a9965c8a8c8968dd0a6cccf75678fe902
Parents: 85c01c6
Author: John Yang <[email protected]>
Authored: Fri Jun 12 15:37:47 2015 +0900
Committer: Byung-Gon Chun <[email protected]>
Committed: Sun Jun 14 16:05:50 2015 +0900

----------------------------------------------------------------------
 lang/java/reef-applications/pom.xml             | 45 +++++++++++++++
 lang/java/reef-applications/reef-vortex/pom.xml | 31 ++++++++++
 .../org/apache/reef/vortex/VortexDriver.java    | 60 ++++++++++++++++++++
 pom.xml                                         |  1 +
 4 files changed, 137 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/53bed07a/lang/java/reef-applications/pom.xml
----------------------------------------------------------------------
diff --git a/lang/java/reef-applications/pom.xml 
b/lang/java/reef-applications/pom.xml
new file mode 100644
index 0000000..828ace3
--- /dev/null
+++ b/lang/java/reef-applications/pom.xml
@@ -0,0 +1,45 @@
+<?xml version="1.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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+    <modelVersion>4.0.0</modelVersion>
+    <packaging>pom</packaging>
+    <name>REEF Applications</name>
+    <artifactId>reef-applications</artifactId>
+
+    <parent>
+        <groupId>org.apache.reef</groupId>
+        <artifactId>reef-project</artifactId>
+        <version>0.12.0-incubating-SNAPSHOT</version>
+        <relativePath>../../..</relativePath>
+    </parent>
+
+    <dependencies>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>reef-common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+    <modules>
+        <module>reef-vortex</module>
+    </modules>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/53bed07a/lang/java/reef-applications/reef-vortex/pom.xml
----------------------------------------------------------------------
diff --git a/lang/java/reef-applications/reef-vortex/pom.xml 
b/lang/java/reef-applications/reef-vortex/pom.xml
new file mode 100644
index 0000000..175c4a5
--- /dev/null
+++ b/lang/java/reef-applications/reef-vortex/pom.xml
@@ -0,0 +1,31 @@
+<?xml version="1.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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>reef-vortex</artifactId>
+    <name>REEF Vortex</name>
+
+    <parent>
+        <groupId>org.apache.reef</groupId>
+        <artifactId>reef-applications</artifactId>
+        <version>0.12.0-incubating-SNAPSHOT</version>
+    </parent>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/53bed07a/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/VortexDriver.java
----------------------------------------------------------------------
diff --git 
a/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/VortexDriver.java
 
b/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/VortexDriver.java
new file mode 100644
index 0000000..d3a4c70
--- /dev/null
+++ 
b/lang/java/reef-applications/reef-vortex/src/main/java/org/apache/reef/vortex/VortexDriver.java
@@ -0,0 +1,60 @@
+/*
+ * 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.vortex;
+
+import org.apache.reef.driver.evaluator.AllocatedEvaluator;
+import org.apache.reef.driver.evaluator.EvaluatorRequest;
+import org.apache.reef.driver.evaluator.EvaluatorRequestor;
+import org.apache.reef.tang.annotations.Unit;
+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;
+
+@Unit
+public final class VortexDriver {
+  private static final Logger LOG = 
Logger.getLogger(VortexDriver.class.getName());
+  private final EvaluatorRequestor requestor;
+
+  @Inject
+  public VortexDriver(final EvaluatorRequestor requestor) {
+    this.requestor = requestor;
+  }
+
+  public final class StartHandler implements EventHandler<StartTime> {
+    @Override
+    public void onNext(final StartTime startTime) {
+      requestor.submit(EvaluatorRequest.newBuilder()
+          .setNumber(1)
+          .setMemory(64)
+          .setNumberOfCores(1)
+          .build());
+    }
+  }
+
+  public final class EvaluatorAllocatedHandler implements 
EventHandler<AllocatedEvaluator> {
+    @Override
+    public void onNext(final AllocatedEvaluator allocatedEvaluator) {
+      LOG.log(Level.INFO, "Evaluator Allocated: {0}", allocatedEvaluator);
+      allocatedEvaluator.close();
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/53bed07a/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 2d08952..60f50e8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -646,6 +646,7 @@ under the License.
     <modules>
         <module>lang/cs</module>
         <module>lang/java/reef-annotations</module>
+        <module>lang/java/reef-applications</module>
         <module>lang/java/reef-bridge-client</module>
         <module>lang/java/reef-bridge-java</module>
         <module>lang/java/reef-checkpoint</module>

Reply via email to