Refactored control

git-svn-id: https://hyracks.googlecode.com/svn/trunk/hyracks@50 123451ca-8445-de46-9d55-352943316053
diff --git a/hyracks-runtime/pom.xml b/hyracks-runtime/pom.xml
index c779372..5091865 100644
--- a/hyracks-runtime/pom.xml
+++ b/hyracks-runtime/pom.xml
@@ -73,6 +73,13 @@
   		<type>jar</type>
   		<scope>compile</scope>
   	</dependency>
+  	<dependency>
+  		<groupId>edu.uci.ics.hyracks</groupId>
+  		<artifactId>hyracks-control-common</artifactId>
+  		<version>0.1.0</version>
+  		<type>jar</type>
+  		<scope>compile</scope>
+  	</dependency>
   </dependencies>
   <reporting>
     <plugins>
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/Endpoint.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/Endpoint.java
deleted file mode 100644
index 245c777..0000000
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/Endpoint.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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 edu.uci.ics.hyracks.comm;
-
-import java.io.Serializable;
-import java.util.UUID;
-
-public final class Endpoint implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    private final UUID id;
-
-    private final NetworkAddress address;
-
-    private final int receiverIndex;
-
-    public Endpoint(NetworkAddress address, int receiverIndex) throws Exception {
-        id = UUID.randomUUID();
-        this.address = address;
-        this.receiverIndex = receiverIndex;
-    }
-
-    public UUID getEndpointId() {
-        return id;
-    }
-
-    public NetworkAddress getNetworkAddress() {
-        return address;
-    }
-
-    public int getReceiverIndex() {
-        return receiverIndex;
-    }
-
-    @Override
-    public int hashCode() {
-        return id.hashCode() + address.hashCode();
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (!(o instanceof Endpoint)) {
-            return false;
-        }
-        Endpoint oe = (Endpoint) o;
-        return oe.id.equals(id) && oe.address.equals(address);
-    }
-
-    @Override
-    public String toString() {
-        return "[" + address + ":" + id + "]";
-    }
-}
\ No newline at end of file
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/IReceiverProtocolStack.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/IReceiverProtocolStack.java
deleted file mode 100644
index b7effd5..0000000
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/IReceiverProtocolStack.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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 edu.uci.ics.hyracks.comm;
-
-import edu.uci.ics.hyracks.api.comm.IDataReceiveListenerFactory;
-import edu.uci.ics.hyracks.api.comm.IFrameReader;
-
-public interface IReceiverProtocolStack {
-    public IDataReceiveListenerFactory createDataReceiveListenerFactory();
-
-    public IFrameReader createFrameReader();
-}
\ No newline at end of file
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/ISenderProtocolStack.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/ISenderProtocolStack.java
deleted file mode 100644
index e038379..0000000
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/ISenderProtocolStack.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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 edu.uci.ics.hyracks.comm;
-
-import edu.uci.ics.hyracks.api.comm.IFrameWriter;
-import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-
-public interface ISenderProtocolStack {
-    public IFrameWriter createFrameWriter(Endpoint endpoint) throws HyracksDataException;
-}
\ No newline at end of file
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/NetworkAddress.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/NetworkAddress.java
deleted file mode 100644
index 15db351..0000000
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/NetworkAddress.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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 edu.uci.ics.hyracks.comm;
-
-import java.io.Serializable;
-import java.net.InetAddress;
-
-public final class NetworkAddress implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    private final InetAddress ipAddress;
-
-    private final int port;
-
-    public NetworkAddress(InetAddress ipAddress, int port) {
-        this.ipAddress = ipAddress;
-        this.port = port;
-    }
-
-    public InetAddress getIpAddress() {
-        return ipAddress;
-    }
-
-    public int getPort() {
-        return port;
-    }
-
-    @Override
-    public String toString() {
-        return ipAddress + ":" + port;
-    }
-
-    @Override
-    public int hashCode() {
-        return ipAddress.hashCode() + port;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (!(o instanceof NetworkAddress)) {
-            return false;
-        }
-        NetworkAddress on = (NetworkAddress) o;
-        return on.port == port && on.ipAddress.equals(ipAddress);
-    }
-}
\ No newline at end of file
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/config/CCConfig.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/CCConfig.java
similarity index 97%
rename from hyracks-runtime/src/main/java/edu/uci/ics/hyracks/config/CCConfig.java
rename to hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/CCConfig.java
index 3d3652a..c7597ee 100644
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/config/CCConfig.java
+++ b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/CCConfig.java
@@ -12,7 +12,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.config;
+package edu.uci.ics.hyracks.control.cc;
 
 import org.kohsuke.args4j.Option;
 
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/driver/CCDriver.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/CCDriver.java
similarity index 88%
rename from hyracks-runtime/src/main/java/edu/uci/ics/hyracks/driver/CCDriver.java
rename to hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/CCDriver.java
index bb1ba84..8104362 100644
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/driver/CCDriver.java
+++ b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/CCDriver.java
@@ -12,12 +12,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.driver;
+package edu.uci.ics.hyracks.control.cc;
 
 import org.kohsuke.args4j.CmdLineParser;
 
-import edu.uci.ics.hyracks.config.CCConfig;
-import edu.uci.ics.hyracks.controller.clustercontroller.ClusterControllerService;
 
 public class CCDriver {
     public static void main(String args[]) throws Exception {
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/ClusterControllerService.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/ClusterControllerService.java
similarity index 97%
rename from hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/ClusterControllerService.java
rename to hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/ClusterControllerService.java
index 94413f4..1623bf4 100644
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/ClusterControllerService.java
+++ b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/ClusterControllerService.java
@@ -12,7 +12,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.controller.clustercontroller;
+package edu.uci.ics.hyracks.control.cc;
 
 import java.io.IOException;
 import java.io.PrintWriter;
@@ -57,13 +57,12 @@
 import edu.uci.ics.hyracks.api.job.JobStatus;
 import edu.uci.ics.hyracks.api.job.statistics.JobStatistics;
 import edu.uci.ics.hyracks.api.job.statistics.StageletStatistics;
-import edu.uci.ics.hyracks.comm.Endpoint;
-import edu.uci.ics.hyracks.config.CCConfig;
-import edu.uci.ics.hyracks.controller.AbstractRemoteService;
-import edu.uci.ics.hyracks.controller.NodeParameters;
-import edu.uci.ics.hyracks.controller.nodecontroller.INodeController;
-import edu.uci.ics.hyracks.job.JobPlan;
-import edu.uci.ics.hyracks.web.WebServer;
+import edu.uci.ics.hyracks.control.cc.web.WebServer;
+import edu.uci.ics.hyracks.control.common.AbstractRemoteService;
+import edu.uci.ics.hyracks.control.common.NodeParameters;
+import edu.uci.ics.hyracks.control.common.comm.Endpoint;
+import edu.uci.ics.hyracks.control.common.job.JobPlan;
+import edu.uci.ics.hyracks.control.nc.INodeController;
 
 public class ClusterControllerService extends AbstractRemoteService implements IClusterController {
     private static final long serialVersionUID = 1L;
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/IClusterController.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/IClusterController.java
similarity index 88%
rename from hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/IClusterController.java
rename to hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/IClusterController.java
index f59e712..03ca317 100644
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/IClusterController.java
+++ b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/IClusterController.java
@@ -12,15 +12,15 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.controller.clustercontroller;
+package edu.uci.ics.hyracks.control.cc;
 
 import java.rmi.Remote;
 import java.util.UUID;
 
 import edu.uci.ics.hyracks.api.client.IHyracksClientInterface;
 import edu.uci.ics.hyracks.api.job.statistics.StageletStatistics;
-import edu.uci.ics.hyracks.controller.NodeParameters;
-import edu.uci.ics.hyracks.controller.nodecontroller.INodeController;
+import edu.uci.ics.hyracks.control.common.NodeParameters;
+import edu.uci.ics.hyracks.control.nc.INodeController;
 
 public interface IClusterController extends Remote, IHyracksClientInterface {
     public NodeParameters registerNode(INodeController nodeController) throws Exception;
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/IJobManager.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/IJobManager.java
similarity index 96%
rename from hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/IJobManager.java
rename to hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/IJobManager.java
index e364423..9d500c0 100644
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/IJobManager.java
+++ b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/IJobManager.java
@@ -12,7 +12,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.controller.clustercontroller;
+package edu.uci.ics.hyracks.control.cc;
 
 import java.util.EnumSet;
 import java.util.UUID;
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/JOLJobManagerImpl.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/JOLJobManagerImpl.java
similarity index 99%
rename from hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/JOLJobManagerImpl.java
rename to hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/JOLJobManagerImpl.java
index 11d5ba5..d7fd61d 100644
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/JOLJobManagerImpl.java
+++ b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/JOLJobManagerImpl.java
@@ -12,7 +12,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.controller.clustercontroller;
+package edu.uci.ics.hyracks.control.cc;
 
 import java.util.ArrayList;
 import java.util.EnumSet;
@@ -57,15 +57,15 @@
 import edu.uci.ics.hyracks.api.job.statistics.JobStatistics;
 import edu.uci.ics.hyracks.api.job.statistics.StageStatistics;
 import edu.uci.ics.hyracks.api.job.statistics.StageletStatistics;
-import edu.uci.ics.hyracks.comm.Endpoint;
-import edu.uci.ics.hyracks.job.JobPlan;
+import edu.uci.ics.hyracks.control.common.comm.Endpoint;
+import edu.uci.ics.hyracks.control.common.job.JobPlan;
 
 public class JOLJobManagerImpl implements IJobManager {
     private static final Logger LOGGER = Logger.getLogger(JOLJobManagerImpl.class.getName());
 
     public static final String JOL_SCOPE = "hyrackscc";
 
-    private static final String SCHEDULER_OLG_FILE = "edu/uci/ics/hyracks/controller/clustercontroller/scheduler.olg";
+    private static final String SCHEDULER_OLG_FILE = "edu/uci/ics/hyracks/control/cc/scheduler.olg";
 
     private final Runtime jolRuntime;
 
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/JobPlanBuilder.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/JobPlanBuilder.java
similarity index 96%
rename from hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/JobPlanBuilder.java
rename to hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/JobPlanBuilder.java
index 8781233..fcb796e 100644
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/JobPlanBuilder.java
+++ b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/JobPlanBuilder.java
@@ -1,4 +1,4 @@
-package edu.uci.ics.hyracks.controller.clustercontroller;
+package edu.uci.ics.hyracks.control.cc;
 
 import java.util.ArrayList;
 import java.util.EnumSet;
@@ -13,7 +13,7 @@
 import edu.uci.ics.hyracks.api.dataflow.IActivityNode;
 import edu.uci.ics.hyracks.api.job.JobFlag;
 import edu.uci.ics.hyracks.api.job.JobSpecification;
-import edu.uci.ics.hyracks.job.JobPlan;
+import edu.uci.ics.hyracks.control.common.job.JobPlan;
 
 public class JobPlanBuilder implements IActivityGraphBuilder {
     private static final Logger LOGGER = Logger.getLogger(JobPlanBuilder.class.getName());
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/JobPlanner.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/JobPlanner.java
similarity index 95%
rename from hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/JobPlanner.java
rename to hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/JobPlanner.java
index 314c600..956c658 100644
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/JobPlanner.java
+++ b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/JobPlanner.java
@@ -12,7 +12,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.controller.clustercontroller;
+package edu.uci.ics.hyracks.control.cc;
 
 import java.util.EnumSet;
 import java.util.HashMap;
@@ -31,10 +31,10 @@
 import edu.uci.ics.hyracks.api.job.JobFlag;
 import edu.uci.ics.hyracks.api.job.JobSpecification;
 import edu.uci.ics.hyracks.api.util.Pair;
-import edu.uci.ics.hyracks.job.IOperatorDescriptorVisitor;
-import edu.uci.ics.hyracks.job.JobPlan;
-import edu.uci.ics.hyracks.job.JobStage;
-import edu.uci.ics.hyracks.job.PlanUtils;
+import edu.uci.ics.hyracks.control.cc.job.IOperatorDescriptorVisitor;
+import edu.uci.ics.hyracks.control.cc.job.PlanUtils;
+import edu.uci.ics.hyracks.control.common.job.JobPlan;
+import edu.uci.ics.hyracks.control.common.job.JobStage;
 
 public class JobPlanner {
     private static final Logger LOGGER = Logger.getLogger(JobPlanner.class.getName());
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/NodeControllerState.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/NodeControllerState.java
similarity index 81%
rename from hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/NodeControllerState.java
rename to hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/NodeControllerState.java
index a1dac8c..10bcc51 100644
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/NodeControllerState.java
+++ b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/NodeControllerState.java
@@ -1,6 +1,6 @@
-package edu.uci.ics.hyracks.controller.clustercontroller;
+package edu.uci.ics.hyracks.control.cc;
 
-import edu.uci.ics.hyracks.controller.nodecontroller.INodeController;
+import edu.uci.ics.hyracks.control.nc.INodeController;
 
 public class NodeControllerState {
     private final INodeController nodeController;
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/StageProgress.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/StageProgress.java
similarity index 96%
rename from hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/StageProgress.java
rename to hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/StageProgress.java
index 69f7380..438e235 100644
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/StageProgress.java
+++ b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/StageProgress.java
@@ -12,7 +12,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.controller.clustercontroller;
+package edu.uci.ics.hyracks.control.cc;
 
 import java.util.HashSet;
 import java.util.Set;
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/job/IOperatorDescriptorVisitor.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/job/IOperatorDescriptorVisitor.java
similarity index 94%
rename from hyracks-runtime/src/main/java/edu/uci/ics/hyracks/job/IOperatorDescriptorVisitor.java
rename to hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/job/IOperatorDescriptorVisitor.java
index 0e63c94..65d8771 100644
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/job/IOperatorDescriptorVisitor.java
+++ b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/job/IOperatorDescriptorVisitor.java
@@ -12,7 +12,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.job;
+package edu.uci.ics.hyracks.control.cc.job;
 
 import edu.uci.ics.hyracks.api.dataflow.IOperatorDescriptor;
 
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/job/PlanUtils.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/job/PlanUtils.java
similarity index 96%
rename from hyracks-runtime/src/main/java/edu/uci/ics/hyracks/job/PlanUtils.java
rename to hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/job/PlanUtils.java
index e2337f7..274ffdb 100644
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/job/PlanUtils.java
+++ b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/job/PlanUtils.java
@@ -12,7 +12,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.job;
+package edu.uci.ics.hyracks.control.cc.job;
 
 import java.util.HashSet;
 import java.util.Set;
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/web/WebServer.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/web/WebServer.java
similarity index 96%
rename from hyracks-runtime/src/main/java/edu/uci/ics/hyracks/web/WebServer.java
rename to hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/web/WebServer.java
index b6ab52b..dfffcb3 100644
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/web/WebServer.java
+++ b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/web/WebServer.java
@@ -12,7 +12,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.web;
+package edu.uci.ics.hyracks.control.cc.web;
 
 import org.eclipse.jetty.server.Connector;
 import org.eclipse.jetty.server.Handler;
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/nodecontroller/INodeController.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/INodeController.java
similarity index 86%
rename from hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/nodecontroller/INodeController.java
rename to hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/INodeController.java
index 6eaacb1..e8ea230 100644
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/nodecontroller/INodeController.java
+++ b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/INodeController.java
@@ -12,7 +12,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.controller.nodecontroller;
+package edu.uci.ics.hyracks.control.nc;
 
 import java.rmi.Remote;
 import java.util.Map;
@@ -22,11 +22,10 @@
 import edu.uci.ics.hyracks.api.dataflow.ActivityNodeId;
 import edu.uci.ics.hyracks.api.dataflow.OperatorDescriptorId;
 import edu.uci.ics.hyracks.api.dataflow.PortInstanceId;
-import edu.uci.ics.hyracks.comm.Endpoint;
-import edu.uci.ics.hyracks.config.NCConfig;
-import edu.uci.ics.hyracks.controller.NodeCapability;
-import edu.uci.ics.hyracks.controller.clustercontroller.IClusterController;
-import edu.uci.ics.hyracks.job.JobPlan;
+import edu.uci.ics.hyracks.control.cc.IClusterController;
+import edu.uci.ics.hyracks.control.common.NodeCapability;
+import edu.uci.ics.hyracks.control.common.comm.Endpoint;
+import edu.uci.ics.hyracks.control.common.job.JobPlan;
 
 public interface INodeController extends Remote {
     public String getId() throws Exception;
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/nodecontroller/Joblet.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/Joblet.java
similarity index 98%
rename from hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/nodecontroller/Joblet.java
rename to hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/Joblet.java
index 7f0a44e..eb7ac72 100644
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/nodecontroller/Joblet.java
+++ b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/Joblet.java
@@ -12,7 +12,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.controller.nodecontroller;
+package edu.uci.ics.hyracks.control.nc;
 
 import java.util.HashMap;
 import java.util.Map;
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/config/NCConfig.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/NCConfig.java
similarity index 97%
rename from hyracks-runtime/src/main/java/edu/uci/ics/hyracks/config/NCConfig.java
rename to hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/NCConfig.java
index c95f1ad..62e43ec 100644
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/config/NCConfig.java
+++ b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/NCConfig.java
@@ -12,7 +12,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.config;
+package edu.uci.ics.hyracks.control.nc;
 
 import java.io.Serializable;
 
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/driver/NCDriver.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/NCDriver.java
similarity index 92%
rename from hyracks-runtime/src/main/java/edu/uci/ics/hyracks/driver/NCDriver.java
rename to hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/NCDriver.java
index 3c856ab..71206c3 100644
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/driver/NCDriver.java
+++ b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/NCDriver.java
@@ -12,14 +12,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.driver;
+package edu.uci.ics.hyracks.control.nc;
 
 import org.kohsuke.args4j.CmdLineParser;
 
 import edu.uci.ics.dcache.client.DCacheClient;
 import edu.uci.ics.dcache.client.DCacheClientConfig;
-import edu.uci.ics.hyracks.config.NCConfig;
-import edu.uci.ics.hyracks.controller.nodecontroller.NodeControllerService;
 
 public class NCDriver {
     public static void main(String args[]) throws Exception {
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/nodecontroller/NodeControllerService.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/NodeControllerService.java
similarity index 96%
rename from hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/nodecontroller/NodeControllerService.java
rename to hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/NodeControllerService.java
index 461fc18..c2482ea 100644
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/nodecontroller/NodeControllerService.java
+++ b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/NodeControllerService.java
@@ -12,7 +12,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.controller.nodecontroller;
+package edu.uci.ics.hyracks.control.nc;
 
 import java.net.InetAddress;
 import java.nio.ByteBuffer;
@@ -54,17 +54,16 @@
 import edu.uci.ics.hyracks.api.job.JobFlag;
 import edu.uci.ics.hyracks.api.job.JobSpecification;
 import edu.uci.ics.hyracks.api.job.statistics.StageletStatistics;
-import edu.uci.ics.hyracks.comm.ConnectionManager;
-import edu.uci.ics.hyracks.comm.DemuxDataReceiveListenerFactory;
-import edu.uci.ics.hyracks.comm.Endpoint;
-import edu.uci.ics.hyracks.config.NCConfig;
-import edu.uci.ics.hyracks.context.HyracksContext;
-import edu.uci.ics.hyracks.controller.AbstractRemoteService;
-import edu.uci.ics.hyracks.controller.NodeCapability;
-import edu.uci.ics.hyracks.controller.NodeParameters;
-import edu.uci.ics.hyracks.controller.clustercontroller.IClusterController;
-import edu.uci.ics.hyracks.job.JobPlan;
-import edu.uci.ics.hyracks.runtime.OperatorRunnable;
+import edu.uci.ics.hyracks.control.cc.IClusterController;
+import edu.uci.ics.hyracks.control.common.AbstractRemoteService;
+import edu.uci.ics.hyracks.control.common.NodeCapability;
+import edu.uci.ics.hyracks.control.common.NodeParameters;
+import edu.uci.ics.hyracks.control.common.comm.Endpoint;
+import edu.uci.ics.hyracks.control.common.job.JobPlan;
+import edu.uci.ics.hyracks.control.nc.comm.ConnectionManager;
+import edu.uci.ics.hyracks.control.nc.comm.DemuxDataReceiveListenerFactory;
+import edu.uci.ics.hyracks.control.nc.runtime.HyracksContext;
+import edu.uci.ics.hyracks.control.nc.runtime.OperatorRunnable;
 
 public class NodeControllerService extends AbstractRemoteService implements INodeController {
     private static final long serialVersionUID = 1L;
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/nodecontroller/Stagelet.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/Stagelet.java
similarity index 96%
rename from hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/nodecontroller/Stagelet.java
rename to hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/Stagelet.java
index c9bbc29..696ce29 100644
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/nodecontroller/Stagelet.java
+++ b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/Stagelet.java
@@ -12,7 +12,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.controller.nodecontroller;
+package edu.uci.ics.hyracks.control.nc;
 
 import java.rmi.RemoteException;
 import java.util.Date;
@@ -28,8 +28,8 @@
 import edu.uci.ics.hyracks.api.dataflow.OperatorDescriptorId;
 import edu.uci.ics.hyracks.api.dataflow.OperatorInstanceId;
 import edu.uci.ics.hyracks.api.job.statistics.StageletStatistics;
-import edu.uci.ics.hyracks.comm.Endpoint;
-import edu.uci.ics.hyracks.runtime.OperatorRunnable;
+import edu.uci.ics.hyracks.control.common.comm.Endpoint;
+import edu.uci.ics.hyracks.control.nc.runtime.OperatorRunnable;
 
 public class Stagelet {
     private static final long serialVersionUID = 1L;
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/ConnectionEntry.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/comm/ConnectionEntry.java
similarity index 98%
rename from hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/ConnectionEntry.java
rename to hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/comm/ConnectionEntry.java
index bfc79e7..20d41d6 100644
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/ConnectionEntry.java
+++ b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/comm/ConnectionEntry.java
@@ -12,7 +12,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.comm;
+package edu.uci.ics.hyracks.control.nc.comm;
 
 import java.io.IOException;
 import java.nio.ByteBuffer;
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/ConnectionManager.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/comm/ConnectionManager.java
similarity index 99%
rename from hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/ConnectionManager.java
rename to hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/comm/ConnectionManager.java
index 45c7221..452f25e 100644
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/ConnectionManager.java
+++ b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/comm/ConnectionManager.java
@@ -12,7 +12,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.comm;
+package edu.uci.ics.hyracks.control.nc.comm;
 
 import java.io.IOException;
 import java.net.InetAddress;
@@ -43,6 +43,7 @@
 import edu.uci.ics.hyracks.api.comm.IFrameWriter;
 import edu.uci.ics.hyracks.api.context.IHyracksContext;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.control.common.comm.NetworkAddress;
 
 public class ConnectionManager {
     private static final Logger LOGGER = Logger.getLogger(ConnectionManager.class.getName());
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/DemuxDataReceiveListenerFactory.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/comm/DemuxDataReceiveListenerFactory.java
similarity index 98%
rename from hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/DemuxDataReceiveListenerFactory.java
rename to hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/comm/DemuxDataReceiveListenerFactory.java
index 403d4e8..6b4c041 100644
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/DemuxDataReceiveListenerFactory.java
+++ b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/comm/DemuxDataReceiveListenerFactory.java
@@ -12,7 +12,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.comm;
+package edu.uci.ics.hyracks.control.nc.comm;
 
 import java.io.IOException;
 import java.nio.ByteBuffer;
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/context/HyracksContext.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/runtime/HyracksContext.java
similarity index 92%
rename from hyracks-runtime/src/main/java/edu/uci/ics/hyracks/context/HyracksContext.java
rename to hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/runtime/HyracksContext.java
index b061919..f61ff8b 100644
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/context/HyracksContext.java
+++ b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/runtime/HyracksContext.java
@@ -12,11 +12,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.context;
+package edu.uci.ics.hyracks.control.nc.runtime;
 
 import edu.uci.ics.hyracks.api.context.IHyracksContext;
 import edu.uci.ics.hyracks.api.resources.IResourceManager;
-import edu.uci.ics.hyracks.resources.ResourceManager;
 
 public class HyracksContext implements IHyracksContext {
     private final IResourceManager resourceManager;
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/runtime/OperatorRunnable.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/runtime/OperatorRunnable.java
similarity index 97%
rename from hyracks-runtime/src/main/java/edu/uci/ics/hyracks/runtime/OperatorRunnable.java
rename to hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/runtime/OperatorRunnable.java
index 6ea3bf1..39d98b1 100644
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/runtime/OperatorRunnable.java
+++ b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/runtime/OperatorRunnable.java
@@ -12,7 +12,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.runtime;
+package edu.uci.ics.hyracks.control.nc.runtime;
 
 import java.nio.ByteBuffer;
 
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/resources/ResourceManager.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/runtime/ResourceManager.java
similarity index 96%
rename from hyracks-runtime/src/main/java/edu/uci/ics/hyracks/resources/ResourceManager.java
rename to hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/runtime/ResourceManager.java
index eff017a..72202e3 100644
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/resources/ResourceManager.java
+++ b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/runtime/ResourceManager.java
@@ -12,7 +12,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.resources;
+package edu.uci.ics.hyracks.control.nc.runtime;
 
 import java.io.File;
 import java.io.IOException;
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/AbstractRemoteService.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/AbstractRemoteService.java
deleted file mode 100644
index 9c8f3dd..0000000
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/AbstractRemoteService.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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 edu.uci.ics.hyracks.controller;
-
-import java.rmi.RemoteException;
-import java.rmi.server.UnicastRemoteObject;
-
-import edu.uci.ics.hyracks.service.IService;
-
-public abstract class AbstractRemoteService extends UnicastRemoteObject implements IService {
-    private static final long serialVersionUID = 1L;
-
-    public AbstractRemoteService() throws RemoteException {
-    }
-}
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/NodeCapability.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/NodeCapability.java
deleted file mode 100644
index 65fcd44..0000000
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/NodeCapability.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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 edu.uci.ics.hyracks.controller;
-
-import java.io.Serializable;
-
-public class NodeCapability implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    private int cpuCount;
-
-    public int getCPUCount() {
-        return cpuCount;
-    }
-
-    public void setCPUCount(int cpuCount) {
-        this.cpuCount = cpuCount;
-    }
-}
\ No newline at end of file
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/NodeParameters.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/NodeParameters.java
deleted file mode 100644
index b04ad9d..0000000
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/NodeParameters.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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 edu.uci.ics.hyracks.controller;
-
-import java.io.Serializable;
-
-public class NodeParameters implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    private int heartbeatPeriod;
-
-    public int getHeartbeatPeriod() {
-        return heartbeatPeriod;
-    }
-
-    public void setHeartbeatPeriod(int heartbeatPeriod) {
-        this.heartbeatPeriod = heartbeatPeriod;
-    }
-}
\ No newline at end of file
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/job/JobPlan.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/job/JobPlan.java
deleted file mode 100644
index 5516870..0000000
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/job/JobPlan.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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 edu.uci.ics.hyracks.job;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import edu.uci.ics.hyracks.api.dataflow.ActivityNodeId;
-import edu.uci.ics.hyracks.api.dataflow.IActivityNode;
-import edu.uci.ics.hyracks.api.dataflow.IConnectorDescriptor;
-import edu.uci.ics.hyracks.api.dataflow.OperatorDescriptorId;
-import edu.uci.ics.hyracks.api.dataflow.value.RecordDescriptor;
-import edu.uci.ics.hyracks.api.job.JobFlag;
-import edu.uci.ics.hyracks.api.job.JobSpecification;
-
-public class JobPlan implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    private final JobSpecification jobSpec;
-
-    private final EnumSet<JobFlag> jobFlags;
-
-    private final Map<ActivityNodeId, IActivityNode> activityNodes;
-
-    private final Map<ActivityNodeId, Set<ActivityNodeId>> blocker2blockedMap;
-
-    private final Map<ActivityNodeId, Set<ActivityNodeId>> blocked2blockerMap;
-
-    private final Map<OperatorDescriptorId, Set<ActivityNodeId>> operatorTaskMap;
-
-    private final Map<ActivityNodeId, List<Integer>> taskInputMap;
-
-    private final Map<ActivityNodeId, List<Integer>> taskOutputMap;
-
-    private final Map<OperatorDescriptorId, List<ActivityNodeId>> operatorInputMap;
-
-    private final Map<OperatorDescriptorId, List<ActivityNodeId>> operatorOutputMap;
-
-    private JobStage endStage;
-
-    public JobPlan(JobSpecification jobSpec, EnumSet<JobFlag> jobFlags) {
-        this.jobSpec = jobSpec;
-        this.jobFlags = jobFlags;
-        activityNodes = new HashMap<ActivityNodeId, IActivityNode>();
-        blocker2blockedMap = new HashMap<ActivityNodeId, Set<ActivityNodeId>>();
-        blocked2blockerMap = new HashMap<ActivityNodeId, Set<ActivityNodeId>>();
-        operatorTaskMap = new HashMap<OperatorDescriptorId, Set<ActivityNodeId>>();
-        taskInputMap = new HashMap<ActivityNodeId, List<Integer>>();
-        taskOutputMap = new HashMap<ActivityNodeId, List<Integer>>();
-        operatorInputMap = new HashMap<OperatorDescriptorId, List<ActivityNodeId>>();
-        operatorOutputMap = new HashMap<OperatorDescriptorId, List<ActivityNodeId>>();
-    }
-
-    public JobSpecification getJobSpecification() {
-        return jobSpec;
-    }
-
-    public EnumSet<JobFlag> getJobFlags() {
-        return jobFlags;
-    }
-
-    public Map<ActivityNodeId, IActivityNode> getActivityNodeMap() {
-        return activityNodes;
-    }
-
-    public Map<ActivityNodeId, Set<ActivityNodeId>> getBlocker2BlockedMap() {
-        return blocker2blockedMap;
-    }
-
-    public Map<ActivityNodeId, Set<ActivityNodeId>> getBlocked2BlockerMap() {
-        return blocked2blockerMap;
-    }
-
-    public Map<OperatorDescriptorId, Set<ActivityNodeId>> getOperatorTaskMap() {
-        return operatorTaskMap;
-    }
-
-    public Map<ActivityNodeId, List<Integer>> getTaskInputMap() {
-        return taskInputMap;
-    }
-
-    public Map<ActivityNodeId, List<Integer>> getTaskOutputMap() {
-        return taskOutputMap;
-    }
-
-    public Map<OperatorDescriptorId, List<ActivityNodeId>> getOperatorInputMap() {
-        return operatorInputMap;
-    }
-
-    public Map<OperatorDescriptorId, List<ActivityNodeId>> getOperatorOutputMap() {
-        return operatorOutputMap;
-    }
-
-    public void setEndStage(JobStage endStage) {
-        this.endStage = endStage;
-    }
-
-    public JobStage getEndStage() {
-        return endStage;
-    }
-
-    public List<IConnectorDescriptor> getTaskInputs(ActivityNodeId hanId) {
-        List<Integer> inputIndexes = taskInputMap.get(hanId);
-        if (inputIndexes == null) {
-            return null;
-        }
-        OperatorDescriptorId ownerId = hanId.getOperatorDescriptorId();
-        List<IConnectorDescriptor> inputs = new ArrayList<IConnectorDescriptor>();
-        for (Integer i : inputIndexes) {
-            inputs.add(jobSpec.getInputConnectorDescriptor(ownerId, i));
-        }
-        return inputs;
-    }
-
-    public List<IConnectorDescriptor> getTaskOutputs(ActivityNodeId hanId) {
-        List<Integer> outputIndexes = taskOutputMap.get(hanId);
-        if (outputIndexes == null) {
-            return null;
-        }
-        OperatorDescriptorId ownerId = hanId.getOperatorDescriptorId();
-        List<IConnectorDescriptor> outputs = new ArrayList<IConnectorDescriptor>();
-        for (Integer i : outputIndexes) {
-            outputs.add(jobSpec.getOutputConnectorDescriptor(ownerId, i));
-        }
-        return outputs;
-    }
-
-    public RecordDescriptor getTaskInputRecordDescriptor(ActivityNodeId hanId, int inputIndex) {
-        int opInputIndex = getTaskInputMap().get(hanId).get(inputIndex);
-        return jobSpec.getOperatorInputRecordDescriptor(hanId.getOperatorDescriptorId(), opInputIndex);
-    }
-
-    public RecordDescriptor getTaskOutputRecordDescriptor(ActivityNodeId hanId, int outputIndex) {
-        int opOutputIndex = getTaskOutputMap().get(hanId).get(outputIndex);
-        return jobSpec.getOperatorOutputRecordDescriptor(hanId.getOperatorDescriptorId(), opOutputIndex);
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder buffer = new StringBuilder();
-        buffer.append("ActivityNodes: " + activityNodes);
-        buffer.append('\n');
-        buffer.append("Blocker->Blocked: " + blocker2blockedMap);
-        buffer.append('\n');
-        buffer.append("Blocked->Blocker: " + blocked2blockerMap);
-        buffer.append('\n');
-        return buffer.toString();
-    }
-}
\ No newline at end of file
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/job/JobStage.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/job/JobStage.java
deleted file mode 100644
index 0048ce9..0000000
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/job/JobStage.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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 edu.uci.ics.hyracks.job;
-
-import java.io.Serializable;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.UUID;
-
-import edu.uci.ics.hyracks.api.dataflow.ActivityNodeId;
-
-public class JobStage implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    private final UUID id;
-
-    private final Set<ActivityNodeId> tasks;
-
-    private final Set<JobStage> dependencies;
-
-    private final Set<JobStage> dependents;
-
-    private boolean started;
-
-    public JobStage(Set<ActivityNodeId> tasks) {
-        this.id = UUID.randomUUID();
-        this.tasks = tasks;
-        dependencies = new HashSet<JobStage>();
-        dependents = new HashSet<JobStage>();
-    }
-
-    public UUID getId() {
-        return id;
-    }
-
-    public Set<ActivityNodeId> getTasks() {
-        return tasks;
-    }
-
-    public void addDependency(JobStage stage) {
-        dependencies.add(stage);
-    }
-
-    public void addDependent(JobStage stage) {
-        dependents.add(stage);
-    }
-
-    public Set<JobStage> getDependencies() {
-        return dependencies;
-    }
-
-    @Override
-    public int hashCode() {
-        return id == null ? 0 : id.hashCode();
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (!(o instanceof JobStage)) {
-            return false;
-        }
-        return id == ((JobStage) o).id;
-    }
-
-    @Override
-    public String toString() {
-        return "SID:" + id + ": " + tasks;
-    }
-
-    public boolean isStarted() {
-        return started;
-    }
-
-    public void setStarted() {
-        started = true;
-    }
-}
\ No newline at end of file
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/service/AbstractService.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/service/AbstractService.java
deleted file mode 100644
index fcb6ea4..0000000
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/service/AbstractService.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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 edu.uci.ics.hyracks.service;
-
-public abstract class AbstractService implements IService {
-}
\ No newline at end of file
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/service/ILifeCycle.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/service/ILifeCycle.java
deleted file mode 100644
index e73f5b0..0000000
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/service/ILifeCycle.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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 edu.uci.ics.hyracks.service;
-
-public interface ILifeCycle {
-    public void start() throws Exception;
-
-    public void stop() throws Exception;
-}
\ No newline at end of file
diff --git a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/service/IService.java b/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/service/IService.java
deleted file mode 100644
index aaf7e0e..0000000
--- a/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/service/IService.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright 2009-2010 by The Regents of the University of California
- * Licensed 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 from
- * 
- *     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 edu.uci.ics.hyracks.service;
-
-
-public interface IService extends ILifeCycle {
-}
\ No newline at end of file
diff --git a/hyracks-runtime/src/main/resources/edu/uci/ics/hyracks/controller/clustercontroller/scheduler.olg b/hyracks-runtime/src/main/resources/edu/uci/ics/hyracks/control/cc/scheduler.olg
similarity index 99%
rename from hyracks-runtime/src/main/resources/edu/uci/ics/hyracks/controller/clustercontroller/scheduler.olg
rename to hyracks-runtime/src/main/resources/edu/uci/ics/hyracks/control/cc/scheduler.olg
index d346467..b230e0e 100644
--- a/hyracks-runtime/src/main/resources/edu/uci/ics/hyracks/controller/clustercontroller/scheduler.olg
+++ b/hyracks-runtime/src/main/resources/edu/uci/ics/hyracks/control/cc/scheduler.olg
@@ -12,7 +12,7 @@
 import edu.uci.ics.hyracks.api.dataflow.ConnectorDescriptorId;
 import edu.uci.ics.hyracks.api.dataflow.IConnectorDescriptor;
 import edu.uci.ics.hyracks.api.job.JobStatus;
-import edu.uci.ics.hyracks.job.JobPlan;
+import edu.uci.ics.hyracks.control.common.job.JobPlan;
 
 define(activitystage_temp, keys(), {UUID, OperatorDescriptorId, ActivityNodeId, Integer});