From notifications-return-818-archive-asf-public=cust-asf.ponee.io@nemo.apache.org Mon Aug 19 08:07:43 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id A18511806C7 for ; Mon, 19 Aug 2019 10:07:41 +0200 (CEST) Received: (qmail 13700 invoked by uid 500); 19 Aug 2019 08:07:41 -0000 Mailing-List: contact notifications-help@nemo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nemo.apache.org Delivered-To: mailing list notifications@nemo.apache.org Received: (qmail 13669 invoked by uid 99); 19 Aug 2019 08:07:41 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Aug 2019 08:07:41 +0000 From: GitBox To: notifications@nemo.apache.org Subject: [GitHub] [incubator-nemo] taegeonum commented on a change in pull request #231: [NEMO-406] Invoke LambdaExecutor without creating containers Message-ID: <156620206105.25905.9522458389796782782.gitbox@gitbox.apache.org> Date: Mon, 19 Aug 2019 08:07:41 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit taegeonum commented on a change in pull request #231: [NEMO-406] Invoke LambdaExecutor without creating containers URL: https://github.com/apache/incubator-nemo/pull/231#discussion_r315080510 ########## File path: runtime/master/src/main/java/org/apache/nemo/runtime/master/LambdaMaster.java ########## @@ -0,0 +1,184 @@ +/* + * 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.runtime.master; + +import com.amazonaws.regions.Regions; +import com.amazonaws.services.lambda.AWSLambda; +import com.amazonaws.services.lambda.AWSLambdaClientBuilder; +import com.amazonaws.services.lambda.model.InvokeRequest; +import com.amazonaws.services.lambda.model.InvokeResult; +import io.netty.bootstrap.ServerBootstrap; +import io.netty.channel.Channel; +import io.netty.channel.ChannelInboundHandlerAdapter; +import io.netty.channel.ChannelOption; +import io.netty.channel.EventLoopGroup; +import io.netty.channel.group.ChannelGroup; +import io.netty.channel.group.DefaultChannelGroup; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.channel.socket.nio.NioServerSocketChannel; +import io.netty.util.concurrent.DefaultThreadFactory; +import io.netty.util.concurrent.GlobalEventExecutor; +import org.apache.nemo.runtime.master.resource.LambdaInboundHandler; +import org.apache.nemo.runtime.master.resource.NettyChannelInitializer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.*; + +/** + * Invoked by runtime master, with utilities for the LambdaExecutor to communicate + * Set up netty server for LambdaExecutors to connect to. + * Invoke LambdaExecutor with public addr and port. + */ +public class LambdaMaster { + + private static final Logger LOG = LoggerFactory.getLogger(LambdaMaster.class.getName()); + private static final int SERVER_BOSS_NUM_THREADS = 3; + private static final int SERVER_WORKER_NUM_THREADS = 10; + private static final String CLASS_NAME = LambdaMaster.class.getName(); + + private EventLoopGroup serverBossGroup; + private EventLoopGroup serverWorkerGroup; + private Channel acceptor; + // A container object keeping track of all existing channels + private final ChannelGroup serverChannelGroup = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE); + + private int port = 9999; Review comment: private final ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services