-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Lambda Pass, LambdaPolicy and ResourceLambdaProperty
- Loading branch information
Showing
5 changed files
with
129 additions
and
10 deletions.
There are no files selected for viewing
4 changes: 0 additions & 4 deletions
4
common/src/main/java/org/apache/nemo/common/ir/edge/executionproperty/LambdaProperty.java
This file was deleted.
Oops, something went wrong.
55 changes: 55 additions & 0 deletions
55
.../main/java/org/apache/nemo/common/ir/vertex/executionproperty/ResourceLambdaProperty.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* 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.common.ir.vertex.executionproperty; | ||
|
||
import org.apache.nemo.common.ir.executionproperty.VertexExecutionProperty; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
|
||
public final class ResourceLambdaProperty extends VertexExecutionProperty<ResourceLambdaProperty.Value>{ | ||
private static final Logger LOG = LoggerFactory.getLogger(ResourceLambdaProperty.class.getName()); | ||
/** | ||
* Constructor. | ||
* | ||
* @param value value of the execution property. | ||
*/ | ||
private ResourceLambdaProperty(final ResourceLambdaProperty.Value value) { | ||
super(value); | ||
LOG.info("LambdaProperty Instantiated"); | ||
} | ||
|
||
/** | ||
* Static method exposing the constructor. | ||
* | ||
* @param value value of the new execution property. | ||
* @return the newly created execution property. | ||
*/ | ||
public static ResourceLambdaProperty of(final ResourceLambdaProperty.Value value) { | ||
return new ResourceLambdaProperty(value); | ||
} | ||
|
||
/** | ||
* Possible values of DataStore ExecutionProperty. | ||
*/ | ||
public enum Value { | ||
On, | ||
Off, | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
.../main/java/org/apache/nemo/compiler/optimizer/pass/compiletime/annotating/LambdaPass.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.pass.compiletime.annotating; | ||
|
||
import org.apache.nemo.common.ir.IRDAG; | ||
import org.apache.nemo.common.ir.vertex.executionproperty.ResourceLambdaProperty; | ||
import org.apache.nemo.common.ir.executionproperty.ExecutionProperty; | ||
import org.apache.nemo.compiler.optimizer.pass.compiletime.CompileTimePass; | ||
import org.apache.nemo.compiler.optimizer.pass.compiletime.annotating.AnnotatingPass; | ||
import org.apache.nemo.common.ir.edge.executionproperty.DataStoreProperty; | ||
|
||
import org.apache.nemo.compiler.optimizer.policy.LambdaPolicy; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/* | ||
* Lambda Policy | ||
* Maintainer: Gao Zhiyuan | ||
* Description: A part of lambda executor, assigning LambdaResourceProperty | ||
*/ | ||
|
||
@Annotates(ResourceLambdaProperty.class) | ||
public final class LambdaPass extends AnnotatingPass { | ||
private static final Logger LOG = LoggerFactory.getLogger(LambdaPolicy.class.getName()); | ||
|
||
public LambdaPass() { | ||
super(LambdaPass.class); | ||
LOG.info("LambdaPass initialized"); | ||
} | ||
|
||
@Override | ||
public IRDAG apply(final IRDAG dag) { | ||
dag.getVertices().forEach(vertex -> { | ||
vertex.setPropertyPermanently(ResourceLambdaProperty.of(ResourceLambdaProperty.Value.On)); | ||
}); | ||
return dag; | ||
} | ||
} |
4 changes: 0 additions & 4 deletions
4
...c/main/java/org/apache/nemo/compiler/optimizer/pass/compiletime/composite/LambdaPass.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters