You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tajo.apache.org by hy...@apache.org on 2013/07/02 16:16:02 UTC
[08/51] [partial] TAJO-22: The package prefix should be
org.apache.tajo. (DaeMyung Kang via hyunsik)
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/TaskSchedulerImpl.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/TaskSchedulerImpl.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/TaskSchedulerImpl.java
deleted file mode 100644
index aae88a6..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/TaskSchedulerImpl.java
+++ /dev/null
@@ -1,420 +0,0 @@
-/**
- * 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 tajo.master;
-
-import com.google.common.collect.Lists;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.yarn.event.AsyncDispatcher;
-import org.apache.hadoop.yarn.event.EventHandler;
-import org.apache.hadoop.yarn.service.AbstractService;
-import org.apache.hadoop.yarn.util.RackResolver;
-import tajo.QueryIdFactory;
-import tajo.QueryUnitAttemptId;
-import tajo.SubQueryId;
-import tajo.engine.MasterWorkerProtos;
-import tajo.engine.planner.logical.ScanNode;
-import tajo.engine.query.QueryUnitRequestImpl;
-import tajo.ipc.protocolrecords.QueryUnitRequest;
-import tajo.master.QueryMaster.QueryContext;
-import tajo.master.TaskRunnerLauncherImpl.ContainerProxy;
-import tajo.master.event.TaskAttemptAssignedEvent;
-import tajo.master.event.TaskRequestEvent;
-import tajo.master.event.TaskRequestEvent.TaskRequestEventType;
-import tajo.master.event.TaskScheduleEvent;
-import tajo.master.event.TaskSchedulerEvent;
-import tajo.master.event.TaskSchedulerEvent.EventType;
-import tajo.storage.Fragment;
-import tajo.util.TajoIdUtils;
-
-import java.net.URI;
-import java.util.*;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-
-public class TaskSchedulerImpl extends AbstractService
- implements TaskScheduler {
- private static final Log LOG = LogFactory.getLog(TaskScheduleEvent.class);
-
- private final QueryContext context;
- private AsyncDispatcher dispatcher;
-
- private Thread eventHandlingThread;
- private Thread schedulingThread;
- private volatile boolean stopEventHandling;
-
- BlockingQueue<TaskSchedulerEvent> eventQueue
- = new LinkedBlockingQueue<TaskSchedulerEvent>();
-
- private ScheduledRequests scheduledRequests;
- private TaskRequests taskRequests;
-
- private int hostLocalAssigned = 0;
- private int rackLocalAssigned = 0;
- private int totalAssigned = 0;
-
- public TaskSchedulerImpl(QueryContext context) {
- super(TaskSchedulerImpl.class.getName());
- this.context = context;
- this.dispatcher = context.getDispatcher();
- }
-
- public void init(Configuration conf) {
-
- scheduledRequests = new ScheduledRequests();
- taskRequests = new TaskRequests();
- dispatcher.register(TaskRequestEventType.class, taskRequests);
-
- super.init(conf);
- }
-
- public void start() {
- LOG.info("Start TaskScheduler");
- this.eventHandlingThread = new Thread() {
- public void run() {
-
- TaskSchedulerEvent event;
- while(!stopEventHandling && !Thread.currentThread().isInterrupted()) {
- try {
- event = eventQueue.take();
- handleEvent(event);
- } catch (InterruptedException e) {
- LOG.error("Returning, iterrupted : " + e);
- }
- }
- }
- };
-
- this.eventHandlingThread.start();
-
- this.schedulingThread = new Thread() {
- public void run() {
-
- while(!stopEventHandling && !Thread.currentThread().isInterrupted()) {
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- LOG.warn(e);
- }
-
- schedule();
- }
- }
- };
-
- this.schedulingThread.start();
- super.start();
- }
-
- private static final QueryUnitAttemptId NULL_ID;
- private static final MasterWorkerProtos.QueryUnitRequestProto stopTaskRunnerReq;
- static {
- SubQueryId nullSubQuery =
- QueryIdFactory.newSubQueryId(TajoIdUtils.NullQueryId);
- NULL_ID = QueryIdFactory.newQueryUnitAttemptId(QueryIdFactory.newQueryUnitId(nullSubQuery, 0), 0);
-
- MasterWorkerProtos.QueryUnitRequestProto.Builder builder =
- MasterWorkerProtos.QueryUnitRequestProto.newBuilder();
- builder.setId(NULL_ID.getProto());
- builder.setShouldDie(true);
- builder.setOutputTable("");
- builder.setSerializedData("");
- builder.setClusteredOutput(false);
- stopTaskRunnerReq = builder.build();
- }
-
-
- public void stop() {
- stopEventHandling = true;
- eventHandlingThread.interrupt();
- schedulingThread.interrupt();
-
- // Return all of request callbacks instantly.
- for (TaskRequestEvent req : taskRequests.taskRequestQueue) {
- req.getCallback().run(stopTaskRunnerReq);
- }
-
- super.stop();
- }
-
- private void handleEvent(TaskSchedulerEvent event) {
- if (event.getType() == EventType.T_SCHEDULE) {
- TaskScheduleEvent castEvent = (TaskScheduleEvent) event;
- if (castEvent.isLeafQuery()) {
- scheduledRequests.addLeafTask(castEvent);
- } else {
- scheduledRequests.addNonLeafTask(castEvent);
- }
- }
- }
-
- List<TaskRequestEvent> taskRequestEvents = new ArrayList<TaskRequestEvent>();
- public void schedule() {
-
- if (taskRequests.size() > 0) {
- if (scheduledRequests.leafTaskNum() > 0) {
- LOG.info("Try to schedule tasks with taskRequestEvents: " +
- taskRequests.size() + ", LeafTask Schedule Request: " +
- scheduledRequests.leafTaskNum());
- taskRequests.getTaskRequests(taskRequestEvents,
- scheduledRequests.leafTaskNum());
- LOG.info("Get " + taskRequestEvents.size() + " taskRequestEvents ");
- if (taskRequestEvents.size() > 0) {
- scheduledRequests.assignToLeafTasks(taskRequestEvents);
- taskRequestEvents.clear();
- }
- }
- }
-
- if (taskRequests.size() > 0) {
- if (scheduledRequests.nonLeafTaskNum() > 0) {
- LOG.info("Try to schedule tasks with taskRequestEvents: " +
- taskRequests.size() + ", NonLeafTask Schedule Request: " +
- scheduledRequests.nonLeafTaskNum());
- taskRequests.getTaskRequests(taskRequestEvents,
- scheduledRequests.nonLeafTaskNum());
- scheduledRequests.assignToNonLeafTasks(taskRequestEvents);
- taskRequestEvents.clear();
- }
- }
- }
-
- @Override
- public void handle(TaskSchedulerEvent event) {
- int qSize = eventQueue.size();
- if (qSize != 0 && qSize % 1000 == 0) {
- LOG.info("Size of event-queue in RMContainerAllocator is " + qSize);
- }
- int remCapacity = eventQueue.remainingCapacity();
- if (remCapacity < 1000) {
- LOG.warn("Very low remaining capacity in the event-queue "
- + "of RMContainerAllocator: " + remCapacity);
- }
-
- try {
- eventQueue.put(event);
- } catch (InterruptedException e) {
- throw new InternalError(e.getMessage());
- }
- }
-
- private class TaskRequests implements EventHandler<TaskRequestEvent> {
- private final LinkedBlockingQueue<TaskRequestEvent> taskRequestQueue =
- new LinkedBlockingQueue<TaskRequestEvent>();
-
- @Override
- public void handle(TaskRequestEvent event) {
- int qSize = taskRequestQueue.size();
- if (qSize != 0 && qSize % 1000 == 0) {
- LOG.info("Size of event-queue in RMContainerAllocator is " + qSize);
- }
- int remCapacity = taskRequestQueue.remainingCapacity();
- if (remCapacity < 1000) {
- LOG.warn("Very low remaining capacity in the event-queue "
- + "of RMContainerAllocator: " + remCapacity);
- }
-
- taskRequestQueue.add(event);
- }
-
- public void getTaskRequests(final Collection<TaskRequestEvent> taskRequests,
- int num) {
- taskRequestQueue.drainTo(taskRequests, num);
- }
-
- public int size() {
- return taskRequestQueue.size();
- }
- }
-
- private class ScheduledRequests {
- private final HashSet<QueryUnitAttemptId> leafTasks = new HashSet<QueryUnitAttemptId>();
- private final HashSet<QueryUnitAttemptId> nonLeafTasks = new HashSet<QueryUnitAttemptId>();
- private final Map<String, LinkedList<QueryUnitAttemptId>> leafTasksHostMapping =
- new HashMap<String, LinkedList<QueryUnitAttemptId>>();
- private final Map<String, LinkedList<QueryUnitAttemptId>> leafTasksRackMapping =
- new HashMap<String, LinkedList<QueryUnitAttemptId>>();
-
- public void addLeafTask(TaskScheduleEvent event) {
- for (String host : event.getHosts()) {
- LinkedList<QueryUnitAttemptId> list = leafTasksHostMapping.get(host);
- if (list == null) {
- list = new LinkedList<QueryUnitAttemptId>();
- leafTasksHostMapping.put(host, list);
- }
- list.add(event.getAttemptId());
- if (LOG.isDebugEnabled()) {
- LOG.debug("Added attempt req to host " + host);
- }
- }
- for (String rack: event.getRacks()) {
- LinkedList<QueryUnitAttemptId> list = leafTasksRackMapping.get(rack);
- if (list == null) {
- list = new LinkedList<QueryUnitAttemptId>();
- leafTasksRackMapping.put(rack, list);
- }
- list.add(event.getAttemptId());
- if (LOG.isDebugEnabled()) {
- LOG.debug("Added attempt req to rack " + rack);
- }
- }
-
- leafTasks.add(event.getAttemptId());
- }
-
- public void addNonLeafTask(TaskScheduleEvent event) {
- nonLeafTasks.add(event.getAttemptId());
- }
-
- public int leafTaskNum() {
- return leafTasks.size();
- }
-
- public int nonLeafTaskNum() {
- return nonLeafTasks.size();
- }
-
- public Set<QueryUnitAttemptId> AssignedRequest = new HashSet<QueryUnitAttemptId>();
-
- public void assignToLeafTasks(List<TaskRequestEvent> taskRequests) {
- Iterator<TaskRequestEvent> it = taskRequests.iterator();
- LOG.info("Got task requests " + taskRequests.size());
-
- TaskRequestEvent taskRequest;
- while (it.hasNext() && leafTasks.size() > 0) {
- taskRequest = it.next();
- ContainerProxy container = context.getContainer(taskRequest.getContainerId());
- String hostName = container.getHostName();
-
- QueryUnitAttemptId attemptId = null;
-
- // local allocation
- LinkedList<QueryUnitAttemptId> list = leafTasksHostMapping.get(hostName);
- while(list != null && list.size() > 0) {
-
- QueryUnitAttemptId tId = list.removeFirst();
-
- if (leafTasks.contains(tId)) {
- leafTasks.remove(tId);
- attemptId = tId;
- //LOG.info(attemptId + " Assigned based on host match " + hostName);
- hostLocalAssigned++;
- break;
- }
- }
-
- // rack allocation
- if (attemptId == null) {
- String rack = RackResolver.resolve(hostName).getNetworkLocation();
- list = leafTasksRackMapping.get(rack);
- while(list != null && list.size() > 0) {
-
- QueryUnitAttemptId tId = list.removeFirst();
-
- if (leafTasks.contains(tId)) {
- leafTasks.remove(tId);
- attemptId = tId;
- //LOG.info(attemptId + "Assigned based on rack match " + rack);
- rackLocalAssigned++;
- break;
- }
- }
-
- // random allocation
- if (attemptId == null && leafTaskNum() > 0) {
- attemptId = leafTasks.iterator().next();
- leafTasks.remove(attemptId);
- //LOG.info(attemptId + " Assigned based on * match");
- }
- }
-
- if (attemptId != null) {
- QueryUnit task = context.getQuery()
- .getSubQuery(attemptId.getSubQueryId()).getQueryUnit(attemptId.getQueryUnitId());
- QueryUnitRequest taskAssign = new QueryUnitRequestImpl(
- attemptId,
- new ArrayList<Fragment>(task.getAllFragments()),
- task.getOutputName(),
- false,
- task.getLogicalPlan().toJSON());
- if (task.getStoreTableNode().isLocal()) {
- taskAssign.setInterQuery();
- }
-
- context.getEventHandler().handle(new TaskAttemptAssignedEvent(attemptId,
- taskRequest.getContainerId(),
- container.getHostName(), container.getPullServerPort()));
- AssignedRequest.add(attemptId);
-
- totalAssigned++;
- taskRequest.getCallback().run(taskAssign.getProto());
- } else {
- throw new RuntimeException("Illegal State!!!!!!!!!!!!!!!!!!!!!");
- }
- }
-
- LOG.info("HostLocalAssigned / Total: " + hostLocalAssigned + " / " + totalAssigned);
- LOG.info("RackLocalAssigned: " + rackLocalAssigned + " / " + totalAssigned);
- }
-
- public void assignToNonLeafTasks(List<TaskRequestEvent> taskRequests) {
- Iterator<TaskRequestEvent> it = taskRequests.iterator();
-
- TaskRequestEvent taskRequest;
- while (it.hasNext()) {
- taskRequest = it.next();
-
- QueryUnitAttemptId attemptId;
- // random allocation
- if (nonLeafTasks.size() > 0) {
- attemptId = nonLeafTasks.iterator().next();
- nonLeafTasks.remove(attemptId);
- LOG.debug("Assigned based on * match");
-
- QueryUnit task;
- task = context.getSubQuery(attemptId.getSubQueryId()).getQueryUnit(attemptId.getQueryUnitId());
- QueryUnitRequest taskAssign = new QueryUnitRequestImpl(
- attemptId,
- Lists.newArrayList(task.getAllFragments()),
- task.getOutputName(),
- false,
- task.getLogicalPlan().toJSON());
- if (task.getStoreTableNode().isLocal()) {
- taskAssign.setInterQuery();
- }
- for (ScanNode scan : task.getScanNodes()) {
- Collection<URI> fetches = task.getFetch(scan);
- if (fetches != null) {
- for (URI fetch : fetches) {
- taskAssign.addFetch(scan.getTableId(), fetch);
- }
- }
- }
-
- ContainerProxy container = context.getContainer(
- taskRequest.getContainerId());
- context.getEventHandler().handle(new TaskAttemptAssignedEvent(attemptId,
- taskRequest.getContainerId(), container.getHostName(), container.getPullServerPort()));
- taskRequest.getCallback().run(taskAssign.getProto());
- }
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/TaskState.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/TaskState.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/TaskState.java
deleted file mode 100644
index 52ed276..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/TaskState.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * 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 tajo.master;
-
-public enum TaskState {
- NEW, SCHEDULED, RUNNING, SUCCEEDED, FAILED, KILL_WAIT, KILLED;
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/cluster/ServerName.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/cluster/ServerName.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/cluster/ServerName.java
deleted file mode 100644
index 0e87e67..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/cluster/ServerName.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/**
- * 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 tajo.master.cluster;
-
-public class ServerName implements Comparable<ServerName> {
- /**
- * This character is used as separator between server hostname and port.
- */
- public static final String SERVERNAME_SEPARATOR = ":";
-
- private final String serverName;
- private final String hostname;
- private final int port;
-
-
- public ServerName(final String hostname, final int port) {
- this.hostname = hostname;
- this.port = port;
- this.serverName = getServerName(hostname, port);
- }
-
- public ServerName(final String serverName) {
- this(parseHostname(serverName), parsePort(serverName));
- }
-
- public static ServerName create(final String serverName) {
- return new ServerName(serverName);
- }
-
- public static ServerName createWithDefaultPort(final String serverName,
- final int defaultPort) {
- if (serverName == null || serverName.length() <= 0) {
- throw new IllegalArgumentException("Passed hostname is null or empty ("
- + serverName + ")");
- }
- int index = serverName.indexOf(SERVERNAME_SEPARATOR);
- if (index == -1) {
- return new ServerName(parseHostname(serverName), defaultPort);
- } else {
- return new ServerName(parseHostname(serverName), parsePort(serverName));
- }
- }
-
- public static String parseHostname(final String serverName) {
- if (serverName == null || serverName.length() <= 0) {
- throw new IllegalArgumentException("Passed hostname is null or empty ("
- + serverName + ")");
- }
- int index = serverName.indexOf(SERVERNAME_SEPARATOR);
- if (index == -1) { // if a port is missing, the index will be set to -1.
- throw new IllegalArgumentException("Passed port is missing ("
- + serverName + ")");
- }
- return serverName.substring(0, index);
- }
-
- public static int parsePort(final String serverName) {
- String [] split = serverName.split(SERVERNAME_SEPARATOR);
- return Integer.parseInt(split[1]);
- }
-
- @Override
- public String toString() {
- return getServerName();
- }
-
- public String getServerName() {
- return serverName;
- }
-
- public String getHostname() {
- return hostname;
- }
-
- public int getPort() {
- return port;
- }
-
- public static String getServerName(String hostName, int port) {
- final StringBuilder name = new StringBuilder(hostName.length() + 4);
- name.append(hostName);
- name.append(SERVERNAME_SEPARATOR);
- name.append(port);
- return name.toString();
- }
-
- @Override
- public int compareTo(ServerName other) {
- int compare = this.getHostname().toLowerCase().
- compareTo(other.getHostname().toLowerCase());
- if (compare != 0) return compare;
- return this.getPort() - other.getPort();
- }
-
- @Override
- public int hashCode() {
- return getServerName().hashCode();
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null) return false;
- if (!(o instanceof ServerName)) return false;
- return this.compareTo((ServerName)o) == 0;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/cluster/WorkerListener.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/cluster/WorkerListener.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/cluster/WorkerListener.java
deleted file mode 100644
index 43fc1d0..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/cluster/WorkerListener.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/**
- * 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 tajo.master.cluster;
-
-import com.google.protobuf.RpcCallback;
-import com.google.protobuf.RpcController;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.net.NetUtils;
-import org.apache.hadoop.yarn.proto.YarnProtos.ContainerIdProto;
-import org.apache.hadoop.yarn.service.AbstractService;
-import tajo.QueryUnitAttemptId;
-import tajo.TajoIdProtos.QueryUnitAttemptIdProto;
-import tajo.conf.TajoConf;
-import tajo.conf.TajoConf.ConfVars;
-import tajo.engine.MasterWorkerProtos.QueryUnitRequestProto;
-import tajo.engine.MasterWorkerProtos.TaskCompletionReport;
-import tajo.engine.MasterWorkerProtos.TaskFatalErrorReport;
-import tajo.engine.MasterWorkerProtos.TaskStatusProto;
-import tajo.ipc.MasterWorkerProtocol;
-import tajo.ipc.MasterWorkerProtocol.MasterWorkerProtocolService;
-import tajo.master.TajoMaster.MasterContext;
-import tajo.master.event.TaskAttemptStatusUpdateEvent;
-import tajo.master.event.TaskCompletionEvent;
-import tajo.master.event.TaskFatalErrorEvent;
-import tajo.rpc.ProtoAsyncRpcServer;
-import tajo.rpc.protocolrecords.PrimitiveProtos.BoolProto;
-
-import java.net.InetSocketAddress;
-
-public class WorkerListener extends AbstractService
- implements MasterWorkerProtocolService.Interface {
-
- private final static Log LOG = LogFactory.getLog(WorkerListener.class);
- private MasterContext context;
- private ProtoAsyncRpcServer rpcServer;
- private InetSocketAddress bindAddr;
- private String addr;
-
- public WorkerListener(final MasterContext context) throws Exception {
- super(WorkerListener.class.getName());
- this.context = context;
-
- String confMasterAddr = context.getConf().getVar(ConfVars.TASKRUNNER_LISTENER_ADDRESS);
- InetSocketAddress initIsa = NetUtils.createSocketAddr(confMasterAddr);
- if (initIsa.getAddress() == null) {
- throw new IllegalArgumentException("Failed resolve of " + initIsa);
- }
- try {
- this.rpcServer = new ProtoAsyncRpcServer(MasterWorkerProtocol.class,
- this, initIsa);
- } catch (Exception e) {
- LOG.error(e);
- }
- this.rpcServer.start();
- this.bindAddr = rpcServer.getBindAddress();
- this.addr = bindAddr.getHostName() + ":" + bindAddr.getPort();
-
- // Setup RPC server
- // Get the master address
- LOG.info(WorkerListener.class.getSimpleName() + " is bind to " + addr);
- context.getConf().setVar(TajoConf.ConfVars.TASKRUNNER_LISTENER_ADDRESS, addr);
- }
-
- @Override
- public void init(Configuration conf) {
- super.init(conf);
- }
-
- @Override
- public void start() {
- super.start();
- }
-
- @Override
- public void stop() {
- rpcServer.shutdown();
- super.stop();
- }
-
- public InetSocketAddress getBindAddress() {
- return this.bindAddr;
- }
-
- public String getAddress() {
- return this.addr;
- }
-
- static BoolProto TRUE_PROTO = BoolProto.newBuilder().setValue(true).build();
-
- @Override
- public void getTask(RpcController controller, ContainerIdProto request,
- RpcCallback<QueryUnitRequestProto> done) {
- //LOG.info("Get TaskRequest from " + request.getHost());
- //context.getEventHandler().handle(new TaskRequestEvent(new NodeIdPBImpl(request), done));
- }
-
- @Override
- public void statusUpdate(RpcController controller, TaskStatusProto request,
- RpcCallback<BoolProto> done) {
- QueryUnitAttemptId attemptId = new QueryUnitAttemptId(request.getId());
- context.getEventHandler().handle(new TaskAttemptStatusUpdateEvent(attemptId,
- request));
- done.run(TRUE_PROTO);
- }
-
- @Override
- public void ping(RpcController controller,
- QueryUnitAttemptIdProto attemptIdProto,
- RpcCallback<BoolProto> done) {
- QueryUnitAttemptId attemptId = new QueryUnitAttemptId(attemptIdProto);
- context.getQuery(attemptId.getQueryId()).getContext().getSubQuery(attemptId.getSubQueryId()).
- getQueryUnit(attemptId.getQueryUnitId()).getAttempt(attemptId).
- resetExpireTime();
- done.run(TRUE_PROTO);
- }
-
- @Override
- public void fatalError(RpcController controller, TaskFatalErrorReport report,
- RpcCallback<BoolProto> done) {
- context.getEventHandler().handle(new TaskFatalErrorEvent(report));
- done.run(TRUE_PROTO);
- }
-
- @Override
- public void done(RpcController controller, TaskCompletionReport report,
- RpcCallback<BoolProto> done) {
- context.getEventHandler().handle(new TaskCompletionEvent(report));
- done.run(TRUE_PROTO);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/ContainerAllocationEvent.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/ContainerAllocationEvent.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/ContainerAllocationEvent.java
deleted file mode 100644
index f5d9a49..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/ContainerAllocationEvent.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-import org.apache.hadoop.yarn.api.records.Priority;
-import org.apache.hadoop.yarn.api.records.Resource;
-import org.apache.hadoop.yarn.event.AbstractEvent;
-import tajo.SubQueryId;
-
-public class ContainerAllocationEvent extends AbstractEvent<ContainerAllocatorEventType> {
-
- private final SubQueryId subQueryId;
- private final Priority priority;
- private final Resource resource;
- private final boolean isLeafQuery;
- private final int requiredNum;
- private final float progress;
-
- public ContainerAllocationEvent(ContainerAllocatorEventType eventType,
- SubQueryId subQueryId,
- Priority priority,
- Resource resource,
- int requiredNum,
- boolean isLeafQuery, float progress) {
- super(eventType);
- this.subQueryId = subQueryId;
- this.priority = priority;
- this.resource = resource;
- this.requiredNum = requiredNum;
- this.isLeafQuery = isLeafQuery;
- this.progress = progress;
- }
-
- public SubQueryId getSubQueryId() {
- return subQueryId;
- }
-
- public Priority getPriority() {
- return priority;
- }
-
- public int getRequiredNum() {
- return requiredNum;
- }
-
- public boolean isLeafQuery() {
- return isLeafQuery;
- }
-
- public Resource getCapability() {
- return resource;
- }
-
- public float getProgress() {
- return progress;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/ContainerAllocatorEventType.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/ContainerAllocatorEventType.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/ContainerAllocatorEventType.java
deleted file mode 100644
index b8463b5..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/ContainerAllocatorEventType.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-public enum ContainerAllocatorEventType {
- // producer: QueryUnitAttempt, consumer: ContainerAllocator
- CONTAINER_REQ,
- CONTAINER_DEALLOCATE,
- CONTAINER_FAILED
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/ContainerEvent.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/ContainerEvent.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/ContainerEvent.java
deleted file mode 100644
index e133d71..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/ContainerEvent.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-import org.apache.hadoop.yarn.api.records.ContainerId;
-import org.apache.hadoop.yarn.event.AbstractEvent;
-import tajo.master.event.ContainerEvent.EventType;
-
-public class ContainerEvent extends AbstractEvent<EventType> {
- public enum EventType {
- CONTAINER_LAUNCHED,
- CONTAINER_STOPPED
- }
-
- private final ContainerId cId;
-
- public ContainerEvent(EventType eventType, ContainerId cId) {
- super(eventType);
- this.cId = cId;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/GrouppedContainerAllocatorEvent.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/GrouppedContainerAllocatorEvent.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/GrouppedContainerAllocatorEvent.java
deleted file mode 100644
index d352192..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/GrouppedContainerAllocatorEvent.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-import org.apache.hadoop.yarn.api.records.Priority;
-import org.apache.hadoop.yarn.api.records.Resource;
-import tajo.SubQueryId;
-
-import java.util.Map;
-
-public class GrouppedContainerAllocatorEvent
- extends ContainerAllocationEvent {
- private final Map<String, Integer> requestMap;
-
- public GrouppedContainerAllocatorEvent(ContainerAllocatorEventType eventType,
- SubQueryId subQueryId,
- Priority priority,
- Resource resource,
- Map<String, Integer> requestMap,
- boolean isLeafQuery, float progress) {
- super(eventType, subQueryId, priority,
- resource, requestMap.size(), isLeafQuery, progress);
- this.requestMap = requestMap;
- }
-
- public Map<String, Integer> getRequestMap() {
- return this.requestMap;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/QueryDiagnosticsUpdateEvent.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/QueryDiagnosticsUpdateEvent.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/QueryDiagnosticsUpdateEvent.java
deleted file mode 100644
index 1c123e6..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/QueryDiagnosticsUpdateEvent.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-import tajo.QueryId;
-
-public class QueryDiagnosticsUpdateEvent extends QueryEvent {
- private final String msg;
-
- public QueryDiagnosticsUpdateEvent(final QueryId id, String diagnostic) {
- super(id, QueryEventType.SUBQUERY_COMPLETED);
- this.msg = diagnostic;
- }
-
- public String getDiagnosticUpdate() {
- return msg;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/QueryEvent.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/QueryEvent.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/QueryEvent.java
deleted file mode 100644
index 793b5df..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/QueryEvent.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-import org.apache.hadoop.yarn.event.AbstractEvent;
-import tajo.QueryId;
-
-public class QueryEvent extends AbstractEvent<QueryEventType> {
- private final QueryId id;
-
-
- public QueryEvent(final QueryId id, final QueryEventType queryEvent) {
- super(queryEvent);
- this.id = id;
- }
-
- public QueryId getQueryId() {
- return id;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/QueryEventType.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/QueryEventType.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/QueryEventType.java
deleted file mode 100644
index 73c0445..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/QueryEventType.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-public enum QueryEventType {
- INIT,
- START,
- INIT_COMPLETED,
- INTERNAL_ERROR,
- SUBQUERY_COMPLETED,
- KILL,
- DIAGNOSTIC_UPDATE,
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/QueryFinishEvent.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/QueryFinishEvent.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/QueryFinishEvent.java
deleted file mode 100644
index d4625e1..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/QueryFinishEvent.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-import org.apache.hadoop.yarn.event.AbstractEvent;
-import tajo.QueryId;
-
-public class QueryFinishEvent extends AbstractEvent {
- public enum EventType {
- QUERY_FINISH
- }
-
- private final QueryId queryId;
-
- public QueryFinishEvent(QueryId queryId) {
- super(EventType.QUERY_FINISH);
- this.queryId = queryId;
- }
-
- public QueryId getQueryId() {
- return this.queryId;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/QuerySubQueryEvent.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/QuerySubQueryEvent.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/QuerySubQueryEvent.java
deleted file mode 100644
index 9152875..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/QuerySubQueryEvent.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-import tajo.SubQueryId;
-
-public class QuerySubQueryEvent extends QueryEvent {
- private SubQueryId subQueryId;
-
- public QuerySubQueryEvent(final SubQueryId id,
- final QueryEventType queryEvent) {
- super(id.getQueryId(), queryEvent);
- this.subQueryId = id;
- }
-
- public SubQueryId getSubQueryId() {
- return this.subQueryId;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/SubQueryCompletedEvent.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/SubQueryCompletedEvent.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/SubQueryCompletedEvent.java
deleted file mode 100644
index 345fc11..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/SubQueryCompletedEvent.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-import tajo.SubQueryId;
-import tajo.master.SubQueryState;
-
-public class SubQueryCompletedEvent extends QueryEvent {
- private final SubQueryId subQueryId;
- private final SubQueryState finalState;
-
- public SubQueryCompletedEvent(final SubQueryId subQueryId,
- SubQueryState finalState) {
- super(subQueryId.getQueryId(), QueryEventType.SUBQUERY_COMPLETED);
- this.subQueryId = subQueryId;
- this.finalState = finalState;
- }
-
- public SubQueryId getSubQueryId() {
- return subQueryId;
- }
-
- public SubQueryState getFinalState() {
- return finalState;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/SubQueryContainerAllocationEvent.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/SubQueryContainerAllocationEvent.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/SubQueryContainerAllocationEvent.java
deleted file mode 100644
index 5eb197b..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/SubQueryContainerAllocationEvent.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-import org.apache.hadoop.yarn.api.records.Container;
-import tajo.SubQueryId;
-
-import java.util.List;
-
-public class SubQueryContainerAllocationEvent extends SubQueryEvent {
- private List<Container> allocatedContainer;
-
- public SubQueryContainerAllocationEvent(final SubQueryId id,
- List<Container> allocatedContainer) {
- super(id, SubQueryEventType.SQ_CONTAINER_ALLOCATED);
- this.allocatedContainer = allocatedContainer;
- }
-
- public List<Container> getAllocatedContainer() {
- return this.allocatedContainer;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/SubQueryEvent.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/SubQueryEvent.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/SubQueryEvent.java
deleted file mode 100644
index 92ee2dd..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/SubQueryEvent.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-import org.apache.hadoop.yarn.event.AbstractEvent;
-import tajo.SubQueryId;
-
-public class SubQueryEvent extends AbstractEvent<SubQueryEventType> {
- private final SubQueryId id;
-
- public SubQueryEvent(SubQueryId id, SubQueryEventType subQueryEventType) {
- super(subQueryEventType);
- this.id = id;
- }
-
- public SubQueryId getSubQueryId() {
- return id;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/SubQueryEventType.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/SubQueryEventType.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/SubQueryEventType.java
deleted file mode 100644
index 2c21411..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/SubQueryEventType.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-/**
- * Event Types handled by SubQuery
- */
-public enum SubQueryEventType {
-
- // Producer: Query
- SQ_INIT,
- SQ_START,
- SQ_CONTAINER_ALLOCATED,
-
- // Producer: QueryUnit
- SQ_TASK_COMPLETED,
- SQ_FAILED,
-
- // Producer: Completed
- SQ_SUBQUERY_COMPLETED,
-
- SQ_INTERNAL_ERROR
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/SubQuerySucceeEvent.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/SubQuerySucceeEvent.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/SubQuerySucceeEvent.java
deleted file mode 100644
index 2855b05..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/SubQuerySucceeEvent.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-import tajo.SubQueryId;
-import tajo.catalog.TableMeta;
-import tajo.master.SubQueryState;
-
-public class SubQuerySucceeEvent extends SubQueryCompletedEvent {
- private final TableMeta tableMeta;
-
- public SubQuerySucceeEvent(final SubQueryId id, TableMeta tableMeta) {
- super(id, SubQueryState.SUCCEEDED);
- this.tableMeta = tableMeta;
- }
-
- public TableMeta getTableMeta() {
- return tableMeta;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/SubQueryTaskEvent.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/SubQueryTaskEvent.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/SubQueryTaskEvent.java
deleted file mode 100644
index c50fd8d..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/SubQueryTaskEvent.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-import tajo.QueryUnitId;
-
-/**
- * Event Class: From Task to SubQuery
- */
-public class SubQueryTaskEvent extends SubQueryEvent {
- private QueryUnitId taskId;
- public SubQueryTaskEvent(QueryUnitId taskId,
- SubQueryEventType subQueryEventType) {
- super(taskId.getSubQueryId(), subQueryEventType);
- this.taskId = taskId;
- }
-
- public QueryUnitId getTaskId() {
- return this.taskId;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskAttemptAssignedEvent.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskAttemptAssignedEvent.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskAttemptAssignedEvent.java
deleted file mode 100644
index 9fd0887..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskAttemptAssignedEvent.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-import org.apache.hadoop.yarn.api.records.ContainerId;
-import tajo.QueryUnitAttemptId;
-
-public class TaskAttemptAssignedEvent extends TaskAttemptEvent {
- private final ContainerId cId;
- private final String hostName;
- private final int pullServerPort;
-
- public TaskAttemptAssignedEvent(QueryUnitAttemptId id, ContainerId cId,
- String hostname, int pullServerPort) {
- super(id, TaskAttemptEventType.TA_ASSIGNED);
- this.cId = cId;
- this.hostName = hostname;
- this.pullServerPort = pullServerPort;
- }
-
- public ContainerId getContainerId() {
- return cId;
- }
-
- public String getHostName() {
- return hostName;
- }
-
- public int getPullServerPort() {
- return pullServerPort;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskAttemptEvent.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskAttemptEvent.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskAttemptEvent.java
deleted file mode 100644
index adedece..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskAttemptEvent.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-import org.apache.hadoop.yarn.event.AbstractEvent;
-import tajo.QueryUnitAttemptId;
-
-public class TaskAttemptEvent extends AbstractEvent<TaskAttemptEventType> {
- private final QueryUnitAttemptId id;
-
- public TaskAttemptEvent(QueryUnitAttemptId id,
- TaskAttemptEventType taskAttemptEventType) {
- super(taskAttemptEventType);
- this.id = id;
- }
-
- public QueryUnitAttemptId getTaskAttemptId() {
- return this.id;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskAttemptEventType.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskAttemptEventType.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskAttemptEventType.java
deleted file mode 100644
index 5fa8bdf..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskAttemptEventType.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-/**
- * Event types handled by TaskAttempt.
- */
-public enum TaskAttemptEventType {
-
- //Producer:Task
- TA_SCHEDULE,
- TA_RESCHEDULE,
-
- //Producer:Client, Task
- TA_KILL,
-
- //Producer:Scheduler
- TA_ASSIGNED,
-
- //Producer:Scheduler
- TA_LAUNCHED,
-
- //Producer:TaskAttemptListener
- TA_DIAGNOSTICS_UPDATE,
- TA_COMMIT_PENDING,
- TA_DONE,
- TA_FATAL_ERROR,
- TA_UPDATE,
- TA_TIMED_OUT,
-
- //Producer:TaskCleaner
- TA_CLEANUP_DONE,
-
- //Producer:Job
- TA_TOO_MANY_FETCH_FAILURE,
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskAttemptStatusUpdateEvent.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskAttemptStatusUpdateEvent.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskAttemptStatusUpdateEvent.java
deleted file mode 100644
index 027e5c2..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskAttemptStatusUpdateEvent.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-import tajo.QueryUnitAttemptId;
-import tajo.engine.MasterWorkerProtos.TaskStatusProto;
-
-public class TaskAttemptStatusUpdateEvent extends TaskAttemptEvent {
- private final TaskStatusProto status;
-
- public TaskAttemptStatusUpdateEvent(final QueryUnitAttemptId id,
- TaskStatusProto status) {
- super(id, TaskAttemptEventType.TA_UPDATE);
- this.status = status;
- }
-
- public TaskStatusProto getStatus() {
- return status;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskCompletionEvent.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskCompletionEvent.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskCompletionEvent.java
deleted file mode 100644
index 7557916..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskCompletionEvent.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-import tajo.QueryUnitAttemptId;
-import tajo.engine.MasterWorkerProtos.TaskCompletionReport;
-
-public class TaskCompletionEvent extends TaskAttemptEvent {
- private TaskCompletionReport report;
-
- public TaskCompletionEvent(TaskCompletionReport report) {
- super(new QueryUnitAttemptId(report.getId()), TaskAttemptEventType.TA_DONE);
- this.report = report;
- }
-
- public TaskCompletionReport getReport() {
- return report;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskEvent.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskEvent.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskEvent.java
deleted file mode 100644
index d848be2..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskEvent.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-import org.apache.hadoop.yarn.event.AbstractEvent;
-import tajo.QueryUnitId;
-
-public class TaskEvent extends AbstractEvent<TaskEventType> {
- private final QueryUnitId id;
-
- public TaskEvent(QueryUnitId id, TaskEventType taskEventType) {
- super(taskEventType);
- this.id = id;
- }
-
- public QueryUnitId getTaskId() {
- return id;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskEventType.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskEventType.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskEventType.java
deleted file mode 100644
index 144c13e..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskEventType.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-/**
- * Event types handled by Task.
- */
-public enum TaskEventType {
-
- //Producer:Client, SubQuery
- T_KILL,
-
- //Producer:SubQuery
- T_SCHEDULE,
-
- //Producer:TaskAttempt
- T_ATTEMPT_LAUNCHED,
- T_ATTEMPT_COMMIT_PENDING,
- T_ATTEMPT_FAILED,
- T_ATTEMPT_SUCCEEDED,
- T_ATTEMPT_KILLED
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskFatalErrorEvent.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskFatalErrorEvent.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskFatalErrorEvent.java
deleted file mode 100644
index 9d70c2d..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskFatalErrorEvent.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-import tajo.QueryUnitAttemptId;
-import tajo.engine.MasterWorkerProtos.TaskFatalErrorReport;
-
-public class TaskFatalErrorEvent extends TaskAttemptEvent {
- private TaskFatalErrorReport report;
- public TaskFatalErrorEvent(TaskFatalErrorReport report) {
- super(new QueryUnitAttemptId(report.getId()),
- TaskAttemptEventType.TA_FATAL_ERROR);
- this.report = report;
- }
-
- public String errorMessage() {
- return report.getErrorMessage();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskRequestEvent.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskRequestEvent.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskRequestEvent.java
deleted file mode 100644
index ee21447..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskRequestEvent.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-import com.google.protobuf.RpcCallback;
-import org.apache.hadoop.yarn.api.records.ContainerId;
-import org.apache.hadoop.yarn.event.AbstractEvent;
-import tajo.engine.MasterWorkerProtos.QueryUnitRequestProto;
-import tajo.master.event.TaskRequestEvent.TaskRequestEventType;
-
-public class TaskRequestEvent extends AbstractEvent<TaskRequestEventType> {
-
- public enum TaskRequestEventType {
- TASK_REQ
- }
-
- private final ContainerId workerId;
- private final RpcCallback<QueryUnitRequestProto> callback;
-
- public TaskRequestEvent(ContainerId workerId,
- RpcCallback<QueryUnitRequestProto> callback) {
- super(TaskRequestEventType.TASK_REQ);
- this.workerId = workerId;
- this.callback = callback;
- }
-
- public ContainerId getContainerId() {
- return this.workerId;
- }
-
- public RpcCallback<QueryUnitRequestProto> getCallback() {
- return this.callback;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskScheduleEvent.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskScheduleEvent.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskScheduleEvent.java
deleted file mode 100644
index 95cd73c..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskScheduleEvent.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-import tajo.QueryUnitAttemptId;
-
-import java.util.Arrays;
-
-public class TaskScheduleEvent extends TaskSchedulerEvent {
- private final QueryUnitAttemptId attemptId;
- private final boolean isLeafQuery;
- private final String[] hosts;
- private final String[] racks;
-
- public TaskScheduleEvent(final QueryUnitAttemptId attemptId,
- final EventType eventType, boolean isLeafQuery,
- final String[] hosts,
- final String[] racks) {
- super(eventType, attemptId.getSubQueryId());
- this.attemptId = attemptId;
- this.isLeafQuery = isLeafQuery;
- this.hosts = hosts;
- this.racks = racks;
- }
-
- public QueryUnitAttemptId getAttemptId() {
- return this.attemptId;
- }
-
- public boolean isLeafQuery() {
- return this.isLeafQuery;
- }
-
- public String [] getHosts() {
- return this.hosts;
- }
-
- public String [] getRacks() {
- return this.racks;
- }
-
- @Override
- public String toString() {
- return "TaskScheduleEvent{" +
- "attemptId=" + attemptId +
- ", isLeafQuery=" + isLeafQuery +
- ", hosts=" + (hosts == null ? null : Arrays.asList(hosts)) +
- ", racks=" + (racks == null ? null : Arrays.asList(racks)) +
- '}';
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskSchedulerEvent.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskSchedulerEvent.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskSchedulerEvent.java
deleted file mode 100644
index d7eb859..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskSchedulerEvent.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-import org.apache.hadoop.yarn.event.AbstractEvent;
-import tajo.SubQueryId;
-import tajo.master.event.TaskSchedulerEvent.EventType;
-
-public class TaskSchedulerEvent extends AbstractEvent<EventType> {
- public enum EventType {
- T_SCHEDULE,
- T_SUBQUERY_COMPLETED
- }
-
- private final SubQueryId subQueryId;
-
- public TaskSchedulerEvent(EventType eventType, SubQueryId subQueryId) {
- super(eventType);
- this.subQueryId = subQueryId;
- }
-
- public SubQueryId getSubQueryId() {
- return this.subQueryId;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-tajo/blob/bc6359b8/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskTAttemptEvent.java
----------------------------------------------------------------------
diff --git a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskTAttemptEvent.java b/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskTAttemptEvent.java
deleted file mode 100644
index 5b89915..0000000
--- a/tajo-core/tajo-core-backend/src/main/java/tajo/master/event/TaskTAttemptEvent.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * 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 tajo.master.event;
-
-import tajo.QueryUnitAttemptId;
-
-public class TaskTAttemptEvent extends TaskEvent {
- private final QueryUnitAttemptId attemptId;
- public TaskTAttemptEvent(QueryUnitAttemptId attemptId,
- TaskEventType eventType) {
- super(attemptId.getQueryUnitId(), eventType);
- this.attemptId = attemptId;
- }
-
- public QueryUnitAttemptId getTaskAttemptId() {
- return attemptId;
- }
-}