You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## 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.#frompywy.coreimportExecutor, ChannelDescriptorfrompywy.coreimportPywyPlanfrompywy.platforms.jvm.channelsimportDISPATCHABLE_CHANNEL_DESCRIPTORfrompywy.platforms.jvm.graphimportNodeDispatch, WGraphDispatchfrompywy.platforms.jvm.operatorimportJVMExecutionOperatorfrompywy.platforms.jvm.serializable.wayang_jvm_operatorimportWayangJVMOperatorclassJVMExecutor(Executor):
def__init__(self):
super(JVMExecutor, self).__init__()
defexecute(self, plan):
pywyPlan: PywyPlan=plangraph=WGraphDispatch(pywyPlan.sinks)
# TODO get this information by a configuration and ideally by the contextdescriptor_default: ChannelDescriptor=DISPATCHABLE_CHANNEL_DESCRIPTORdefexecute(op_current: NodeDispatch, op_next: NodeDispatch):
ifop_currentisNone:
returnjvm_current: JVMExecutionOperator=op_current.currentifjvm_current.outputs==0:
jvm_current.execute(jvm_current.inputChannel, [])
returnifop_nextisNone:
returnjvm_next: JVMExecutionOperator=op_next.currentoutputs=jvm_current.get_output_channeldescriptors()
inputs=jvm_next.get_input_channeldescriptors()
intersect=outputs.intersection(inputs)
iflen(intersect) ==0:
raiseException(
"The operator(A) {} can't connect with (B) {}, ""because the output of (A) is {} and the input of (B) is {} ".format(
jvm_current,
jvm_next,
outputs,
inputs
)
)
iflen(intersect) >1:
ifdescriptor_defaultisNone:
raiseException(
"The interaction between the operator (A) {} and (B) {}, ""can't be decided because are several channel availables {}".format(
jvm_current,
jvm_next,
intersect
)
)
descriptor=descriptor_defaultelse:
descriptor=intersect.pop()
# TODO validate if is valite for several outputjvm_current.outputChannel[0] =descriptor.create_instance()
jvm_current.execute(jvm_current.inputChannel, jvm_current.outputChannel)
jvm_next.inputChannel=jvm_current.outputChannelgraph.traversal(graph.starting_nodes, execute)
magic: JVMExecutionOperator=graph.starting_nodes[0].currentmagic.translate_context.generate_request()
1115030c0469051346f22bc19ec7ac1251b46417
The text was updated successfully, but these errors were encountered:
validate if is valite for several output
https://github.com/databloom-ai/incubator-wayang/blob/384ff1ac87f5353938234cbc4bcc040950a315ac/python/src/pywy/platforms/jvm/execution.py#L80
1115030c0469051346f22bc19ec7ac1251b46417
The text was updated successfully, but these errors were encountered: