Refactored control

git-svn-id: https://hyracks.googlecode.com/svn/trunk@50 123451ca-8445-de46-9d55-352943316053
diff --git a/hyracks/hyracks-control-common/.classpath b/hyracks/hyracks-control-common/.classpath
new file mode 100644
index 0000000..88cebb7
--- /dev/null
+++ b/hyracks/hyracks-control-common/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/main/java"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/hyracks/hyracks-control-common/.project b/hyracks/hyracks-control-common/.project
new file mode 100644
index 0000000..f6c06b0
--- /dev/null
+++ b/hyracks/hyracks-control-common/.project
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>hyracks-control-common</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.maven.ide.eclipse.maven2Builder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.maven.ide.eclipse.maven2Nature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
diff --git a/hyracks/hyracks-control-common/.settings/org.eclipse.jdt.core.prefs b/hyracks/hyracks-control-common/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..9387c03
--- /dev/null
+++ b/hyracks/hyracks-control-common/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,6 @@
+#Fri Jul 30 07:32:49 PDT 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/hyracks/hyracks-control-common/.settings/org.maven.ide.eclipse.prefs b/hyracks/hyracks-control-common/.settings/org.maven.ide.eclipse.prefs
new file mode 100644
index 0000000..7e87666
--- /dev/null
+++ b/hyracks/hyracks-control-common/.settings/org.maven.ide.eclipse.prefs
@@ -0,0 +1,9 @@
+#Fri Jul 30 07:32:48 PDT 2010
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
diff --git a/hyracks/hyracks-control-common/pom.xml b/hyracks/hyracks-control-common/pom.xml
new file mode 100644
index 0000000..e744b36
--- /dev/null
+++ b/hyracks/hyracks-control-common/pom.xml
@@ -0,0 +1,28 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>edu.uci.ics.hyracks</groupId>
+  <artifactId>hyracks-control-common</artifactId>
+  <version>0.1.0</version>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>2.0.2</version>
+        <configuration>
+          <source>1.6</source>
+          <target>1.6</target>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+  	<dependency>
+  		<groupId>edu.uci.ics.hyracks</groupId>
+  		<artifactId>hyracks-api</artifactId>
+  		<version>0.1.0</version>
+  		<type>jar</type>
+  		<scope>compile</scope>
+  	</dependency>
+  </dependencies>
+</project>
diff --git a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/AbstractRemoteService.java b/hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/AbstractRemoteService.java
similarity index 89%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/AbstractRemoteService.java
rename to hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/AbstractRemoteService.java
index 9c8f3dd..cf64554 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/AbstractRemoteService.java
+++ b/hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/AbstractRemoteService.java
@@ -12,12 +12,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.controller;
+package edu.uci.ics.hyracks.control.common;
 
 import java.rmi.RemoteException;
 import java.rmi.server.UnicastRemoteObject;
 
-import edu.uci.ics.hyracks.service.IService;
+import edu.uci.ics.hyracks.control.common.service.IService;
 
 public abstract class AbstractRemoteService extends UnicastRemoteObject implements IService {
     private static final long serialVersionUID = 1L;
diff --git a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/NodeCapability.java b/hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/NodeCapability.java
similarity index 95%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/NodeCapability.java
rename to hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/NodeCapability.java
index 65fcd44..d78bd74 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/NodeCapability.java
+++ b/hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/NodeCapability.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;
+package edu.uci.ics.hyracks.control.common;
 
 import java.io.Serializable;
 
diff --git a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/NodeParameters.java b/hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/NodeParameters.java
similarity index 95%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/NodeParameters.java
rename to hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/NodeParameters.java
index b04ad9d..7e6f3e9 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/NodeParameters.java
+++ b/hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/NodeParameters.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;
+package edu.uci.ics.hyracks.control.common;
 
 import java.io.Serializable;
 
diff --git a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/Endpoint.java b/hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/comm/Endpoint.java
similarity index 96%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/Endpoint.java
rename to hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/comm/Endpoint.java
index 245c777..d879d99 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/Endpoint.java
+++ b/hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/comm/Endpoint.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.common.comm;
 
 import java.io.Serializable;
 import java.util.UUID;
diff --git a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/NetworkAddress.java b/hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/comm/NetworkAddress.java
similarity index 96%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/NetworkAddress.java
rename to hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/comm/NetworkAddress.java
index 15db351..0b7ed04 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/NetworkAddress.java
+++ b/hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/comm/NetworkAddress.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.common.comm;
 
 import java.io.Serializable;
 import java.net.InetAddress;
diff --git a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/job/JobPlan.java b/hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/job/JobPlan.java
similarity index 98%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/job/JobPlan.java
rename to hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/job/JobPlan.java
index 5516870..016a6d4 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/job/JobPlan.java
+++ b/hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/job/JobPlan.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.common.job;
 
 import java.io.Serializable;
 import java.util.ArrayList;
diff --git a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/job/JobStage.java b/hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/job/JobStage.java
similarity index 97%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/job/JobStage.java
rename to hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/job/JobStage.java
index 0048ce9..2514866 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/job/JobStage.java
+++ b/hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/job/JobStage.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.common.job;
 
 import java.io.Serializable;
 import java.util.HashSet;
diff --git a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/service/AbstractService.java b/hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/service/AbstractService.java
similarity index 92%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/service/AbstractService.java
rename to hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/service/AbstractService.java
index fcb6ea4..4f9cb92 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/service/AbstractService.java
+++ b/hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/service/AbstractService.java
@@ -12,7 +12,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.service;
+package edu.uci.ics.hyracks.control.common.service;
 
 public abstract class AbstractService implements IService {
 }
\ No newline at end of file
diff --git a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/service/ILifeCycle.java b/hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/service/ILifeCycle.java
similarity index 93%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/service/ILifeCycle.java
rename to hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/service/ILifeCycle.java
index e73f5b0..c9f5abb 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/service/ILifeCycle.java
+++ b/hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/service/ILifeCycle.java
@@ -12,7 +12,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.service;
+package edu.uci.ics.hyracks.control.common.service;
 
 public interface ILifeCycle {
     public void start() throws Exception;
diff --git a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/service/IService.java b/hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/service/IService.java
similarity index 92%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/service/IService.java
rename to hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/service/IService.java
index aaf7e0e..6bde315 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/service/IService.java
+++ b/hyracks/hyracks-control-common/src/main/java/edu/uci/ics/hyracks/control/common/service/IService.java
@@ -12,7 +12,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package edu.uci.ics.hyracks.service;
+package edu.uci.ics.hyracks.control.common.service;
 
 
 public interface IService extends ILifeCycle {
diff --git a/hyracks/hyracks-runtime/pom.xml b/hyracks/hyracks-runtime/pom.xml
index c779372..5091865 100644
--- a/hyracks/hyracks-runtime/pom.xml
+++ b/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/IReceiverProtocolStack.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/IReceiverProtocolStack.java
deleted file mode 100644
index b7effd5..0000000
--- a/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/ISenderProtocolStack.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/ISenderProtocolStack.java
deleted file mode 100644
index e038379..0000000
--- a/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/config/CCConfig.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/CCConfig.java
similarity index 97%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/config/CCConfig.java
rename to hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/CCConfig.java
index 3d3652a..c7597ee 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/config/CCConfig.java
+++ b/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/driver/CCDriver.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/CCDriver.java
similarity index 88%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/driver/CCDriver.java
rename to hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/CCDriver.java
index bb1ba84..8104362 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/driver/CCDriver.java
+++ b/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/ClusterControllerService.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/ClusterControllerService.java
similarity index 97%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/ClusterControllerService.java
rename to hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/ClusterControllerService.java
index 94413f4..1623bf4 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/ClusterControllerService.java
+++ b/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/IClusterController.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/IClusterController.java
similarity index 88%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/IClusterController.java
rename to hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/IClusterController.java
index f59e712..03ca317 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/IClusterController.java
+++ b/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/IJobManager.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/IJobManager.java
similarity index 96%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/IJobManager.java
rename to hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/IJobManager.java
index e364423..9d500c0 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/IJobManager.java
+++ b/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/JOLJobManagerImpl.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/JOLJobManagerImpl.java
similarity index 99%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/JOLJobManagerImpl.java
rename to hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/JOLJobManagerImpl.java
index 11d5ba5..d7fd61d 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/JOLJobManagerImpl.java
+++ b/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/JobPlanBuilder.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/JobPlanBuilder.java
similarity index 96%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/JobPlanBuilder.java
rename to hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/JobPlanBuilder.java
index 8781233..fcb796e 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/JobPlanBuilder.java
+++ b/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/JobPlanner.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/JobPlanner.java
similarity index 95%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/JobPlanner.java
rename to hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/JobPlanner.java
index 314c600..956c658 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/JobPlanner.java
+++ b/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/NodeControllerState.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/NodeControllerState.java
similarity index 81%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/NodeControllerState.java
rename to hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/NodeControllerState.java
index a1dac8c..10bcc51 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/NodeControllerState.java
+++ b/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/StageProgress.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/StageProgress.java
similarity index 96%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/StageProgress.java
rename to hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/StageProgress.java
index 69f7380..438e235 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/clustercontroller/StageProgress.java
+++ b/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/job/IOperatorDescriptorVisitor.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/job/IOperatorDescriptorVisitor.java
similarity index 94%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/job/IOperatorDescriptorVisitor.java
rename to hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/job/IOperatorDescriptorVisitor.java
index 0e63c94..65d8771 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/job/IOperatorDescriptorVisitor.java
+++ b/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/job/PlanUtils.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/job/PlanUtils.java
similarity index 96%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/job/PlanUtils.java
rename to hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/job/PlanUtils.java
index e2337f7..274ffdb 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/job/PlanUtils.java
+++ b/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/web/WebServer.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/web/WebServer.java
similarity index 97%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/web/WebServer.java
rename to hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/cc/web/WebServer.java
index b6ab52b..dfffcb3 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/web/WebServer.java
+++ b/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/nodecontroller/INodeController.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/INodeController.java
similarity index 86%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/nodecontroller/INodeController.java
rename to hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/INodeController.java
index 6eaacb1..e8ea230 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/nodecontroller/INodeController.java
+++ b/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/nodecontroller/Joblet.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/Joblet.java
similarity index 98%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/nodecontroller/Joblet.java
rename to hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/Joblet.java
index 7f0a44e..eb7ac72 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/nodecontroller/Joblet.java
+++ b/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/config/NCConfig.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/NCConfig.java
similarity index 97%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/config/NCConfig.java
rename to hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/NCConfig.java
index c95f1ad..62e43ec 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/config/NCConfig.java
+++ b/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/driver/NCDriver.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/NCDriver.java
similarity index 92%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/driver/NCDriver.java
rename to hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/NCDriver.java
index 3c856ab..71206c3 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/driver/NCDriver.java
+++ b/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/nodecontroller/NodeControllerService.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/NodeControllerService.java
similarity index 96%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/nodecontroller/NodeControllerService.java
rename to hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/NodeControllerService.java
index 461fc18..c2482ea 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/nodecontroller/NodeControllerService.java
+++ b/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/nodecontroller/Stagelet.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/Stagelet.java
similarity index 96%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/nodecontroller/Stagelet.java
rename to hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/Stagelet.java
index c9bbc29..696ce29 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/controller/nodecontroller/Stagelet.java
+++ b/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/ConnectionEntry.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/comm/ConnectionEntry.java
similarity index 98%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/ConnectionEntry.java
rename to hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/comm/ConnectionEntry.java
index bfc79e7..20d41d6 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/ConnectionEntry.java
+++ b/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/ConnectionManager.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/comm/ConnectionManager.java
similarity index 99%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/ConnectionManager.java
rename to hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/comm/ConnectionManager.java
index 45c7221..452f25e 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/ConnectionManager.java
+++ b/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/DemuxDataReceiveListenerFactory.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/comm/DemuxDataReceiveListenerFactory.java
similarity index 98%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/DemuxDataReceiveListenerFactory.java
rename to hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/comm/DemuxDataReceiveListenerFactory.java
index 403d4e8..6b4c041 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/comm/DemuxDataReceiveListenerFactory.java
+++ b/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/context/HyracksContext.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/runtime/HyracksContext.java
similarity index 92%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/context/HyracksContext.java
rename to hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/runtime/HyracksContext.java
index b061919..f61ff8b 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/context/HyracksContext.java
+++ b/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/runtime/OperatorRunnable.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/runtime/OperatorRunnable.java
similarity index 97%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/runtime/OperatorRunnable.java
rename to hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/runtime/OperatorRunnable.java
index 6ea3bf1..39d98b1 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/runtime/OperatorRunnable.java
+++ b/hyracks/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/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/resources/ResourceManager.java b/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/runtime/ResourceManager.java
similarity index 96%
rename from hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/resources/ResourceManager.java
rename to hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/control/nc/runtime/ResourceManager.java
index eff017a..72202e3 100644
--- a/hyracks/hyracks-runtime/src/main/java/edu/uci/ics/hyracks/resources/ResourceManager.java
+++ b/hyracks/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/hyracks-runtime/src/main/resources/edu/uci/ics/hyracks/controller/clustercontroller/scheduler.olg b/hyracks/hyracks-runtime/src/main/resources/edu/uci/ics/hyracks/control/cc/scheduler.olg
similarity index 99%
rename from hyracks/hyracks-runtime/src/main/resources/edu/uci/ics/hyracks/controller/clustercontroller/scheduler.olg
rename to hyracks/hyracks-runtime/src/main/resources/edu/uci/ics/hyracks/control/cc/scheduler.olg
index d346467..b230e0e 100644
--- a/hyracks/hyracks-runtime/src/main/resources/edu/uci/ics/hyracks/controller/clustercontroller/scheduler.olg
+++ b/hyracks/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});
 
diff --git a/hyracks/hyracks-server/pom.xml b/hyracks/hyracks-server/pom.xml
index 969d8cb..7179c2a 100644
--- a/hyracks/hyracks-server/pom.xml
+++ b/hyracks/hyracks-server/pom.xml
@@ -30,11 +30,11 @@
             <configuration>
               <programs>
                 <program>
-                  <mainClass>edu.uci.ics.hyracks.driver.CCDriver</mainClass>
+                  <mainClass>edu.uci.ics.hyracks.control.cc.CCDriver</mainClass>
                   <name>hyrackscc</name>
                 </program>
                 <program>
-                  <mainClass>edu.uci.ics.hyracks.driver.NCDriver</mainClass>
+                  <mainClass>edu.uci.ics.hyracks.control.nc.NCDriver</mainClass>
                   <name>hyracksnc</name>
                 </program>
               </programs>
diff --git a/hyracks/hyracks-server/src/test/java/edu/uci/ics/hyracks/tests/comm/SerializationDeserializationTest.java b/hyracks/hyracks-server/src/test/java/edu/uci/ics/hyracks/tests/comm/SerializationDeserializationTest.java
index d0e5029..ffcf92f 100644
--- a/hyracks/hyracks-server/src/test/java/edu/uci/ics/hyracks/tests/comm/SerializationDeserializationTest.java
+++ b/hyracks/hyracks-server/src/test/java/edu/uci/ics/hyracks/tests/comm/SerializationDeserializationTest.java
@@ -31,7 +31,7 @@
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.dataflow.value.RecordDescriptor;
 import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
-import edu.uci.ics.hyracks.context.HyracksContext;
+import edu.uci.ics.hyracks.control.nc.runtime.HyracksContext;
 import edu.uci.ics.hyracks.dataflow.common.comm.io.FrameDeserializingDataReader;
 import edu.uci.ics.hyracks.dataflow.common.comm.io.SerializingDataWriter;
 import edu.uci.ics.hyracks.dataflow.common.data.marshalling.IntegerSerializerDeserializer;
diff --git a/hyracks/hyracks-server/src/test/java/edu/uci/ics/hyracks/tests/integration/AbstractIntegrationTest.java b/hyracks/hyracks-server/src/test/java/edu/uci/ics/hyracks/tests/integration/AbstractIntegrationTest.java
index 30b6ce4..9050e23 100644
--- a/hyracks/hyracks-server/src/test/java/edu/uci/ics/hyracks/tests/integration/AbstractIntegrationTest.java
+++ b/hyracks/hyracks-server/src/test/java/edu/uci/ics/hyracks/tests/integration/AbstractIntegrationTest.java
@@ -24,10 +24,10 @@
 import edu.uci.ics.hyracks.api.client.IHyracksClientConnection;
 import edu.uci.ics.hyracks.api.job.JobFlag;
 import edu.uci.ics.hyracks.api.job.JobSpecification;
-import edu.uci.ics.hyracks.config.CCConfig;
-import edu.uci.ics.hyracks.config.NCConfig;
-import edu.uci.ics.hyracks.controller.clustercontroller.ClusterControllerService;
-import edu.uci.ics.hyracks.controller.nodecontroller.NodeControllerService;
+import edu.uci.ics.hyracks.control.cc.CCConfig;
+import edu.uci.ics.hyracks.control.cc.ClusterControllerService;
+import edu.uci.ics.hyracks.control.nc.NCConfig;
+import edu.uci.ics.hyracks.control.nc.NodeControllerService;
 
 public abstract class AbstractIntegrationTest {
     public static final String NC1_ID = "nc1";
diff --git a/hyracks/pom.xml b/hyracks/pom.xml
index 188fad6..2020cb6 100644
--- a/hyracks/pom.xml
+++ b/hyracks/pom.xml
@@ -9,6 +9,7 @@
     <module>hyracks-api</module>
     <module>hyracks-dataflow-common</module>
     <module>hyracks-dataflow-std</module>
+    <module>hyracks-control-common</module>
     <module>hyracks-runtime</module>
     <module>hyracks-server</module>
   </modules>