From notifications-return-732-archive-asf-public=cust-asf.ponee.io@nemo.apache.org Fri Aug 2 10:07:15 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 E744018065E for ; Fri, 2 Aug 2019 12:07:14 +0200 (CEST) Received: (qmail 93519 invoked by uid 500); 2 Aug 2019 10:07:14 -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 93510 invoked by uid 99); 2 Aug 2019 10:07:14 -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; Fri, 02 Aug 2019 10:07:14 +0000 From: GitBox To: notifications@nemo.apache.org Subject: [GitHub] [incubator-nemo] taegeonum commented on a change in pull request #227: [NEMO-398] ExecutorRepresenter interface and DefaultExecutorRepresenter Message-ID: <156474043095.21685.2613001590831363651.gitbox@gitbox.apache.org> Date: Fri, 02 Aug 2019 10:07:10 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit taegeonum commented on a change in pull request #227: [NEMO-398] ExecutorRepresenter interface and DefaultExecutorRepresenter URL: https://github.com/apache/incubator-nemo/pull/227#discussion_r310066191 ########## File path: runtime/master/src/main/java/org/apache/nemo/runtime/master/resource/ExecutorRepresenter.java ########## @@ -18,248 +18,90 @@ */ package org.apache.nemo.runtime.master.resource; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.ObjectNode; -import com.google.protobuf.ByteString; -import org.apache.commons.lang3.SerializationUtils; -import org.apache.nemo.common.ir.vertex.executionproperty.ResourceSlotProperty; -import org.apache.nemo.runtime.common.RuntimeIdManager; import org.apache.nemo.runtime.common.comm.ControlMessage; -import org.apache.nemo.runtime.common.message.MessageEnvironment; -import org.apache.nemo.runtime.common.message.MessageSender; import org.apache.nemo.runtime.common.plan.Task; -import org.apache.reef.driver.context.ActiveContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.apache.reef.tang.annotations.DefaultImplementation; -import javax.annotation.concurrent.NotThreadSafe; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; import java.util.Set; -import java.util.concurrent.ExecutorService; -import java.util.stream.Collectors; -import java.util.stream.Stream; /** - * (WARNING) This class is not thread-safe, and thus should only be accessed through ExecutorRegistry. - *

- * Contains information/state regarding an executor. - * Such information may include: - * a) The executor's resource type. - * b) The executor's capacity (ex. number of cores). - * c) Tasks scheduled/launched for the executor. - * d) Name of the physical node which hosts this executor. - * e) (Please add other information as we implement more features). + * Interface for DefaultExecutorRepresenter and LambdaExecutorRepresenter. */ -@NotThreadSafe -public final class ExecutorRepresenter { - private static final Logger LOG = LoggerFactory.getLogger(ExecutorRepresenter.class.getName()); - - private final String executorId; - private final ResourceSpecification resourceSpecification; - private final Map runningComplyingTasks; - private final Map runningNonComplyingTasks; - private final Map runningTaskToAttempt; - private final Set completeTasks; - private final Set failedTasks; - private final MessageSender messageSender; - private final ActiveContext activeContext; - private final ExecutorService serializationExecutorService; - private final String nodeName; - - /** - * Creates a reference to the specified executor. - * - * @param executorId the executor id - * @param resourceSpecification specification for the executor - * @param messageSender provides communication context for this executor - * @param activeContext context on the corresponding REEF evaluator - * @param serializationExecutorService provides threads for message serialization - * @param nodeName physical name of the node where this executor resides - */ - public ExecutorRepresenter(final String executorId, - final ResourceSpecification resourceSpecification, - final MessageSender messageSender, - final ActiveContext activeContext, - final ExecutorService serializationExecutorService, - final String nodeName) { - this.executorId = executorId; - this.resourceSpecification = resourceSpecification; - this.messageSender = messageSender; - this.runningComplyingTasks = new HashMap<>(); - this.runningNonComplyingTasks = new HashMap<>(); - this.runningTaskToAttempt = new HashMap<>(); - this.completeTasks = new HashSet<>(); - this.failedTasks = new HashSet<>(); - this.activeContext = activeContext; - this.serializationExecutorService = serializationExecutorService; - this.nodeName = nodeName; - } +@DefaultImplementation(DefaultExecutorRepresenter.class) Review comment: please remove this. As DefaultExecutorRepresentor does not use @Inject, you cannot use this. ---------------------------------------------------------------- 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