nemo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-nemo] alapha23 commented on a change in pull request #231: [NEMO-406] Invoke LambdaExecutor without creating containers
Date Mon, 19 Aug 2019 21:59:29 GMT
alapha23 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_r315430564
 
 

 ##########
 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;
 
 Review comment:
   acceptor is also initialized in function `setNetty`, with also exception handling.
   
   Moving those variable initialization to construction doesn't sound like a good idea to
me, because it will make constructor quite large.

----------------------------------------------------------------
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

Mime
View raw message