nemo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From johnya...@apache.org
Subject [incubator-nemo] branch master updated: [NEMO-311] Add StreamingPolicy #174
Date Thu, 06 Dec 2018 01:39:40 GMT
This is an automated email from the ASF dual-hosted git repository.

johnyangk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nemo.git


The following commit(s) were added to refs/heads/master by this push:
     new 10c4008  [NEMO-311] Add StreamingPolicy #174
10c4008 is described below

commit 10c400888d2996be849310937f1b174a16e2d743
Author: Taegeon Um <taegeonum@gmail.com>
AuthorDate: Thu Dec 6 10:39:36 2018 +0900

    [NEMO-311] Add StreamingPolicy #174
    
    JIRA: [NEMO-311: Add StreamingPolicy](https://issues.apache.org/jira/projects/NEMO/issues/NEMO-311)
    
    **Major changes:**
    - Add StreamingPolicy that uses PipeTransferForAllEdgesPass
---
 .../compiler/optimizer/policy/StreamingPolicy.java | 54 ++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/compiler/optimizer/src/main/java/org/apache/nemo/compiler/optimizer/policy/StreamingPolicy.java
b/compiler/optimizer/src/main/java/org/apache/nemo/compiler/optimizer/policy/StreamingPolicy.java
new file mode 100644
index 0000000..9bdf2d4
--- /dev/null
+++ b/compiler/optimizer/src/main/java/org/apache/nemo/compiler/optimizer/policy/StreamingPolicy.java
@@ -0,0 +1,54 @@
+/*
+ * 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.nemo.compiler.optimizer.policy;
+
+import org.apache.nemo.common.dag.DAG;
+import org.apache.nemo.common.eventhandler.PubSubEventHandlerWrapper;
+import org.apache.nemo.common.ir.edge.IREdge;
+import org.apache.nemo.common.ir.vertex.IRVertex;
+import org.apache.nemo.compiler.optimizer.pass.compiletime.annotating.PipeTransferForAllEdgesPass;
+import org.apache.nemo.compiler.optimizer.pass.compiletime.composite.DefaultCompositePass;
+import org.apache.reef.tang.Injector;
+
+/**
+ * Streaming policy.
+ */
+public final class StreamingPolicy implements Policy {
+  private final Policy policy;
+
+  /**
+   * Default constructor.
+   */
+  public StreamingPolicy() {
+    final PolicyBuilder builder = new PolicyBuilder();
+    builder.registerCompileTimePass(new DefaultCompositePass());
+    builder.registerCompileTimePass(new PipeTransferForAllEdgesPass());
+    this.policy = builder.build();
+  }
+
+  @Override
+  public DAG<IRVertex, IREdge> runCompileTimeOptimization(final DAG<IRVertex, IREdge>
dag, final String dagDirectory) {
+    return this.policy.runCompileTimeOptimization(dag, dagDirectory);
+  }
+
+  @Override
+  public void registerRunTimeOptimizations(final Injector injector, final PubSubEventHandlerWrapper
pubSubWrapper) {
+    this.policy.registerRunTimeOptimizations(injector, pubSubWrapper);
+  }
+}


Mime
View raw message