You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@carbondata.apache.org by qi...@apache.org on 2018/08/06 11:04:50 UTC

[3/5] carbondata git commit: [CARBONDATA-2825][CARBONDATA-2828] CarbonStore and InternalCarbonStore API This closes #2589

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/master/Master.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/master/Master.java b/store/core/src/main/java/org/apache/carbondata/store/impl/master/Master.java
index 59d4aa3..dbb0116 100644
--- a/store/core/src/main/java/org/apache/carbondata/store/impl/master/Master.java
+++ b/store/core/src/main/java/org/apache/carbondata/store/impl/master/Master.java
@@ -19,57 +19,62 @@ package org.apache.carbondata.store.impl.master;
 
 import java.io.IOException;
 import java.net.BindException;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 import java.util.concurrent.ConcurrentHashMap;
 
+import org.apache.carbondata.common.annotations.InterfaceAudience;
 import org.apache.carbondata.common.logging.LogService;
 import org.apache.carbondata.common.logging.LogServiceFactory;
-import org.apache.carbondata.store.api.conf.StoreConf;
-import org.apache.carbondata.store.impl.rpc.RegistryService;
-import org.apache.carbondata.store.impl.rpc.ServiceFactory;
-import org.apache.carbondata.store.impl.rpc.StoreService;
-import org.apache.carbondata.store.impl.rpc.model.RegisterWorkerRequest;
-import org.apache.carbondata.store.impl.rpc.model.RegisterWorkerResponse;
-import org.apache.carbondata.store.util.StoreUtil;
+import org.apache.carbondata.sdk.store.conf.StoreConf;
+import org.apache.carbondata.sdk.store.service.StoreService;
+import org.apache.carbondata.sdk.store.util.StoreUtil;
+import org.apache.carbondata.store.impl.Schedulable;
+import org.apache.carbondata.store.impl.service.PruneService;
+import org.apache.carbondata.store.impl.service.RegistryService;
+import org.apache.carbondata.store.impl.service.model.RegisterWorkerRequest;
+import org.apache.carbondata.store.impl.service.model.RegisterWorkerResponse;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.ipc.RPC;
 
 /**
- * Master of CarbonSearch.
- * It provides a Registry service for worker to register.
+ * Master of CarbonStore.
+ * It provides a Registry service and Prune service.
  */
-class Master {
+@InterfaceAudience.Internal
+public class Master {
 
   private static Master instance = null;
 
   private static LogService LOGGER = LogServiceFactory.getLogService(Master.class.getName());
 
-  // worker host address map to EndpointRef
-  private StoreConf conf;
+  private StoreConf storeConf;
   private Configuration hadoopConf;
   private RPC.Server registryServer = null;
+  private RPC.Server pruneServer = null;
+  private RPC.Server storeServer = null;
 
   // mapping of worker IP address to worker instance
   Map<String, Schedulable> workers = new ConcurrentHashMap<>();
 
-  private Master(StoreConf conf) {
-    this.conf = conf;
-    this.hadoopConf = conf.newHadoopConf();
+  public Master(StoreConf storeConf) {
+    this.storeConf = storeConf;
+    this.hadoopConf = storeConf.newHadoopConf();
   }
 
   /**
-   * start service and listen on port passed in constructor
+   * start registry service
    */
-  public void startService() throws IOException {
+  private void startRegistryService() throws IOException {
     if (registryServer == null) {
-
       BindException exception;
       // we will try to create service at worse case 100 times
       int numTry = 100;
-      String host = conf.masterHost();
-      int port = conf.masterPort();
+      String host = storeConf.masterHost();
+      int port = storeConf.registryServicePort();
       LOGGER.info("building registry-service on " + host + ":" + port);
 
       RegistryService registryService = new RegistryServiceImpl(this);
@@ -99,11 +104,11 @@ class Master {
       }
       LOGGER.info("registry-service started");
     } else {
-      LOGGER.info("Search mode master has already started");
+      LOGGER.info("registry-service has already started");
     }
   }
 
-  public void stopService() throws InterruptedException {
+  private void stopRegistryService() throws InterruptedException {
     if (registryServer != null) {
       registryServer.stop();
       registryServer.join();
@@ -112,9 +117,110 @@ class Master {
   }
 
   /**
+   * start prune service
+   */
+  private void startPruneService() throws IOException {
+    if (pruneServer == null) {
+      BindException exception;
+      // we will try to create service at worse case 100 times
+      int numTry = 100;
+      String host = storeConf.masterHost();
+      int port = storeConf.pruneServicePort();
+      LOGGER.info("building prune-service on " + host + ":" + port);
+
+      PruneService pruneService = new PruneServiceImpl(storeConf, new Scheduler(this));
+      do {
+        try {
+          pruneServer = new RPC.Builder(hadoopConf)
+              .setBindAddress(host)
+              .setPort(port)
+              .setProtocol(PruneService.class)
+              .setInstance(pruneService)
+              .build();
+          pruneServer.start();
+          numTry = 0;
+          exception = null;
+        } catch (BindException e) {
+          // port is occupied, increase the port number and try again
+          exception = e;
+          LOGGER.error(e, "start prune-service failed");
+          port = port + 1;
+          numTry = numTry - 1;
+        }
+      } while (numTry > 0);
+      if (exception != null) {
+        // we have tried many times, but still failed to find an available port
+        throw exception;
+      }
+      LOGGER.info("prune-service started");
+    } else {
+      LOGGER.info("prune-service has already started");
+    }
+  }
+
+  private void stopPruneService() throws InterruptedException {
+    if (pruneServer != null) {
+      pruneServer.stop();
+      pruneServer.join();
+      pruneServer = null;
+    }
+  }
+
+  /**
+   * start store service
+   */
+  private void startStoreService() throws IOException {
+    if (storeServer == null) {
+      BindException exception;
+      // we will try to create service at worse case 100 times
+      int numTry = 100;
+      String host = storeConf.masterHost();
+      int port = storeConf.storeServicePort();
+      LOGGER.info("building store-service on " + host + ":" + port);
+
+      StoreService storeService = new StoreServiceImpl(storeConf);
+      do {
+        try {
+          storeServer = new RPC.Builder(hadoopConf)
+              .setBindAddress(host)
+              .setPort(port)
+              .setProtocol(StoreService.class)
+              .setInstance(storeService)
+              .build();
+
+          storeServer.start();
+          numTry = 0;
+          exception = null;
+        } catch (BindException e) {
+          // port is occupied, increase the port number and try again
+          exception = e;
+          LOGGER.error(e, "start store-service failed");
+          port = port + 1;
+          numTry = numTry - 1;
+        }
+      } while (numTry > 0);
+      if (exception != null) {
+        // we have tried many times, but still failed to find an available port
+        throw exception;
+      }
+      LOGGER.info("store-service started");
+    } else {
+      LOGGER.info("store-service has already started");
+    }
+  }
+
+  private void stopStoreService() throws InterruptedException {
+    if (storeServer != null) {
+      storeServer.stop();
+      storeServer.join();
+      storeServer = null;
+    }
+  }
+
+  /**
    * A new searcher is trying to register, add it to the map and connect to this searcher
    */
-  public RegisterWorkerResponse addWorker(RegisterWorkerRequest request) throws IOException {
+  RegisterWorkerResponse addWorker(RegisterWorkerRequest request) throws IOException {
     LOGGER.info(
         "Receive Register request from worker " + request.getHostAddress() + ":" + request.getPort()
             + " with " + request.getCores() + " cores");
@@ -125,9 +231,7 @@ class Master {
         "connecting to worker " + request.getHostAddress() + ":" + request.getPort() + ", workerId "
             + workerId);
 
-    StoreService searchService = ServiceFactory.createStoreService(workerAddress, workerPort);
-    addWorker(
-        new Schedulable(workerId, workerAddress, workerPort, request.getCores(), searchService));
+    addWorker(new Schedulable(workerId, workerAddress, workerPort, request.getCores()));
     LOGGER.info("worker " + request + " registered");
     return new RegisterWorkerResponse(workerId);
   }
@@ -146,7 +250,16 @@ class Master {
     return instance;
   }
 
-  public static void main(String[] args) throws InterruptedException {
+  public void stopService() throws InterruptedException {
+    stopRegistryService();
+    stopPruneService();
+  }
+
+  public List<String> getAllWorkerAddresses() {
+    return new ArrayList<>(workers.keySet());
+  }
+
+  public static void main(String[] args) throws InterruptedException, IOException {
     if (args.length != 2) {
       System.err.println("Usage: Master <log4j file> <properties file>");
       return;
@@ -155,7 +268,10 @@ class Master {
     StoreUtil.initLog4j(args[0]);
     StoreConf conf = new StoreConf(args[1]);
     Master master = getInstance(conf);
-    master.stopService();
+    master.startStoreService();
+    master.startRegistryService();
+    master.startPruneService();
+    Thread.sleep(Long.MAX_VALUE);
   }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/master/PruneServiceImpl.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/master/PruneServiceImpl.java b/store/core/src/main/java/org/apache/carbondata/store/impl/master/PruneServiceImpl.java
new file mode 100644
index 0000000..726c442
--- /dev/null
+++ b/store/core/src/main/java/org/apache/carbondata/store/impl/master/PruneServiceImpl.java
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.carbondata.store.impl.master;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+import org.apache.carbondata.core.metadata.schema.table.TableInfo;
+import org.apache.carbondata.hadoop.CarbonInputSplit;
+import org.apache.carbondata.sdk.store.conf.StoreConf;
+import org.apache.carbondata.sdk.store.exception.CarbonException;
+import org.apache.carbondata.store.devapi.ScanUnit;
+import org.apache.carbondata.store.impl.BlockScanUnit;
+import org.apache.carbondata.store.impl.IndexOperation;
+import org.apache.carbondata.store.impl.MetaOperation;
+import org.apache.carbondata.store.impl.Schedulable;
+import org.apache.carbondata.store.impl.service.PruneService;
+import org.apache.carbondata.store.impl.service.model.PruneRequest;
+import org.apache.carbondata.store.impl.service.model.PruneResponse;
+
+import org.apache.hadoop.ipc.ProtocolSignature;
+
+public class PruneServiceImpl implements PruneService {
+
+  private StoreConf storeConf;
+  private Scheduler scheduler;
+
+  PruneServiceImpl(StoreConf storeConf, Scheduler scheduler) {
+    this.storeConf = storeConf;
+    this.scheduler = scheduler;
+  }
+
+  @Override
+  public PruneResponse prune(PruneRequest request) throws CarbonException {
+    TableInfo tableInfo = MetaOperation.getTable(request.getTable(), storeConf);
+    try {
+      List<CarbonInputSplit> splits =
+          IndexOperation.pruneBlock(tableInfo, request.getFilterExpression());
+      List<ScanUnit> output = splits.stream()
+          .map((Function<CarbonInputSplit, ScanUnit>) inputSplit -> {
+            Schedulable worker;
+            String[] locations;
+            try {
+              locations = inputSplit.getLocations();
+              if (locations.length == 0) {
+                worker = scheduler.pickNexWorker();
+              } else {
+                worker = scheduler.pickWorker(locations[0]);
+              }
+            } catch (IOException e) {
+              // ignore it and pick next worker as no locality
+              worker = scheduler.pickNexWorker();
+            }
+            return new BlockScanUnit(inputSplit, worker);
+          }).collect(Collectors.toList());
+      return new PruneResponse(output);
+    } catch (IOException e) {
+      throw new CarbonException(e);
+    }
+  }
+
+  @Override
+  public long getProtocolVersion(String protocol, long clientVersion) throws IOException {
+    return versionID;
+  }
+
+  @Override
+  public ProtocolSignature getProtocolSignature(String protocol, long clientVersion,
+      int clientMethodsHash) throws IOException {
+    return null;
+  }
+}

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/master/RegistryServiceImpl.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/master/RegistryServiceImpl.java b/store/core/src/main/java/org/apache/carbondata/store/impl/master/RegistryServiceImpl.java
index 492006b..ce2be99 100644
--- a/store/core/src/main/java/org/apache/carbondata/store/impl/master/RegistryServiceImpl.java
+++ b/store/core/src/main/java/org/apache/carbondata/store/impl/master/RegistryServiceImpl.java
@@ -20,14 +20,14 @@ package org.apache.carbondata.store.impl.master;
 import java.io.IOException;
 
 import org.apache.carbondata.common.annotations.InterfaceAudience;
-import org.apache.carbondata.store.impl.rpc.RegistryService;
-import org.apache.carbondata.store.impl.rpc.model.RegisterWorkerRequest;
-import org.apache.carbondata.store.impl.rpc.model.RegisterWorkerResponse;
+import org.apache.carbondata.store.impl.service.RegistryService;
+import org.apache.carbondata.store.impl.service.model.RegisterWorkerRequest;
+import org.apache.carbondata.store.impl.service.model.RegisterWorkerResponse;
 
 import org.apache.hadoop.ipc.ProtocolSignature;
 
 @InterfaceAudience.Internal
-class RegistryServiceImpl implements RegistryService {
+class egistryServiceImpl implements RegistryService {
 
   private Master master;
 

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/master/Schedulable.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/master/Schedulable.java b/store/core/src/main/java/org/apache/carbondata/store/impl/master/Schedulable.java
deleted file mode 100644
index 57d41f0..0000000
--- a/store/core/src/main/java/org/apache/carbondata/store/impl/master/Schedulable.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.carbondata.store.impl.master;
-
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.apache.carbondata.common.annotations.InterfaceAudience;
-import org.apache.carbondata.store.impl.rpc.StoreService;
-
-@InterfaceAudience.Internal
-public class Schedulable {
-
-  private String id;
-  private String address;
-  private int port;
-  private int cores;
-  public StoreService service;
-  public AtomicInteger workload;
-
-  public Schedulable(String id, String address, int port, int cores, StoreService service) {
-    this.id = id;
-    this.address = address;
-    this.port = port;
-    this.cores = cores;
-    this.service = service;
-    this.workload = new AtomicInteger();
-  }
-
-  public String getId() {
-    return id;
-  }
-
-  public void setId(String id) {
-    this.id = id;
-  }
-
-  public String getAddress() {
-    return address;
-  }
-
-  public void setAddress(String address) {
-    this.address = address;
-  }
-
-  public int getPort() {
-    return port;
-  }
-
-  public void setPort(int port) {
-    this.port = port;
-  }
-
-  int getCores() {
-    return cores;
-  }
-
-  @Override public String toString() {
-    return "Schedulable{" + "id='" + id + '\'' + ", address='" + address + '\'' + ", port=" + port
-        + '}';
-  }
-}

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/master/Scheduler.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/master/Scheduler.java b/store/core/src/main/java/org/apache/carbondata/store/impl/master/Scheduler.java
index 96a1375..4ede670 100644
--- a/store/core/src/main/java/org/apache/carbondata/store/impl/master/Scheduler.java
+++ b/store/core/src/main/java/org/apache/carbondata/store/impl/master/Scheduler.java
@@ -17,69 +17,33 @@
 
 package org.apache.carbondata.store.impl.master;
 
-import java.io.IOException;
 import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
 import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.carbondata.common.annotations.InterfaceAudience;
 import org.apache.carbondata.common.logging.LogService;
 import org.apache.carbondata.common.logging.LogServiceFactory;
 import org.apache.carbondata.core.util.CarbonProperties;
-import org.apache.carbondata.store.api.conf.StoreConf;
-import org.apache.carbondata.store.api.exception.SchedulerException;
-import org.apache.carbondata.store.impl.rpc.model.BaseResponse;
-import org.apache.carbondata.store.impl.rpc.model.LoadDataRequest;
-import org.apache.carbondata.store.impl.rpc.model.QueryResponse;
-import org.apache.carbondata.store.impl.rpc.model.Scan;
-import org.apache.carbondata.store.impl.rpc.model.ShutdownRequest;
+import org.apache.carbondata.sdk.store.exception.SchedulerException;
+import org.apache.carbondata.store.impl.Schedulable;
 
 /**
  * [[Master]] uses Scheduler to pick a Worker to send request
  */
 @InterfaceAudience.Internal
-public class Scheduler {
+class Scheduler {
 
   private static LogService LOGGER = LogServiceFactory.getLogService(Scheduler.class.getName());
 
   private AtomicInteger count = new AtomicInteger(0);
-  private ExecutorService executors = Executors.newCachedThreadPool();
-  private Master master;
-
-  public Scheduler(StoreConf storeConf) throws IOException {
-    master = Master.getInstance(storeConf);
-    master.startService();
-  }
-
-  /**
-   * Pick a Worker according to the address and workload of the Worker
-   * Invoke the RPC and return Future result
-   */
-  public Future<QueryResponse> sendRequestAsync(
-      final Schedulable worker, final Scan scan) {
-    LOGGER.info("sending search request to worker " + worker);
-    worker.workload.incrementAndGet();
-    return executors.submit(new Callable<QueryResponse>() {
-      @Override public QueryResponse call() {
-        return worker.service.query(scan);
-      }
-    });
-  }
 
-  public BaseResponse sendRequest(final Schedulable worker,
-      final LoadDataRequest request) {
+  private Master master;
 
-    LOGGER.info("sending load data request to worker " + worker);
-    worker.workload.incrementAndGet();
-    return worker.service.loadData(request);
+  Scheduler(Master master) {
+    this.master = master;
   }
 
-  public Schedulable pickWorker(String splitAddress) {
+  Schedulable pickWorker(String splitAddress) {
     Schedulable worker = master.workers.get(splitAddress);
     // no local worker available, choose one worker randomly
     if (worker == null) {
@@ -107,31 +71,12 @@ public class Scheduler {
     return worker;
   }
 
-  public Schedulable pickNexWorker() {
+  Schedulable pickNexWorker() {
     if (master.workers.size() == 0) {
       throw new SchedulerException("No worker is available");
     }
     int index = count.getAndIncrement() % master.workers.size();
     return new ArrayList<>(master.workers.values()).get(index);
   }
-
-  public void stopAllWorkers() throws IOException {
-    for (Map.Entry<String, Schedulable> entry : master.workers.entrySet()) {
-      try {
-        entry.getValue().service.shutdown(new ShutdownRequest("user"));
-      } catch (Throwable throwable) {
-        throw new IOException(throwable);
-      }
-      master.workers.remove(entry.getKey());
-    }
-  }
-
-  public void stopService() throws InterruptedException {
-    master.stopService();
-  }
-
-  public List<String> getAllWorkerAddresses() {
-    return new ArrayList<>(master.workers.keySet());
-  }
 }
 

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/master/StoreServiceImpl.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/master/StoreServiceImpl.java b/store/core/src/main/java/org/apache/carbondata/store/impl/master/StoreServiceImpl.java
new file mode 100644
index 0000000..5d0fd88
--- /dev/null
+++ b/store/core/src/main/java/org/apache/carbondata/store/impl/master/StoreServiceImpl.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.carbondata.store.impl.master;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.apache.carbondata.core.datastore.row.CarbonRow;
+import org.apache.carbondata.core.metadata.schema.table.TableInfo;
+import org.apache.carbondata.sdk.store.conf.StoreConf;
+import org.apache.carbondata.sdk.store.descriptor.LoadDescriptor;
+import org.apache.carbondata.sdk.store.descriptor.ScanDescriptor;
+import org.apache.carbondata.sdk.store.descriptor.TableDescriptor;
+import org.apache.carbondata.sdk.store.descriptor.TableIdentifier;
+import org.apache.carbondata.sdk.store.exception.CarbonException;
+import org.apache.carbondata.sdk.store.service.StoreService;
+import org.apache.carbondata.store.impl.LocalCarbonStore;
+import org.apache.carbondata.store.impl.MetaOperation;
+
+import org.apache.hadoop.ipc.ProtocolSignature;
+
+public class StoreServiceImpl implements StoreService {
+
+  // TODO: simple implementation, load and scan inside master
+  private LocalCarbonStore localStore;
+
+  private MetaOperation metaOperation;
+
+  StoreServiceImpl(StoreConf storeConf) {
+    localStore = new LocalCarbonStore(storeConf);
+    metaOperation = new MetaOperation(storeConf);
+  }
+
+  @Override
+  public void createTable(TableDescriptor descriptor) throws CarbonException {
+    metaOperation.createTable(descriptor);
+  }
+
+  @Override
+  public void dropTable(TableIdentifier identifier) throws CarbonException {
+    metaOperation.dropTable(identifier);
+  }
+
+  @Override
+  public TableInfo getTable(TableIdentifier identifier) throws CarbonException {
+    return metaOperation.getTable(identifier);
+  }
+
+  @Override
+  public List<TableDescriptor> listTable() throws CarbonException {
+    return metaOperation.listTable();
+  }
+
+  @Override
+  public TableDescriptor getDescriptor(TableIdentifier identifier) throws CarbonException {
+    return metaOperation.getDescriptor(identifier);
+  }
+
+  @Override
+  public void alterTable(TableIdentifier identifier, TableDescriptor newTable)
+      throws CarbonException {
+    metaOperation.alterTable(identifier, newTable);
+  }
+
+  @Override
+  public void loadData(LoadDescriptor loadDescriptor) throws CarbonException {
+    localStore.loadData(loadDescriptor);
+  }
+
+  @Override
+  public List<CarbonRow> scan(ScanDescriptor scanDescriptor) throws CarbonException {
+    return localStore.scan(scanDescriptor);
+  }
+
+  @Override
+  public long getProtocolVersion(String protocol, long clientVersion) throws IOException {
+    return versionID;
+  }
+
+  @Override
+  public ProtocolSignature getProtocolSignature(String protocol, long clientVersion,
+      int clientMethodsHash) throws IOException {
+    return null;
+  }
+}

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/RegistryService.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/RegistryService.java b/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/RegistryService.java
deleted file mode 100644
index a40f741..0000000
--- a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/RegistryService.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.carbondata.store.impl.rpc;
-
-import java.io.IOException;
-
-import org.apache.carbondata.common.annotations.InterfaceAudience;
-import org.apache.carbondata.store.impl.rpc.model.RegisterWorkerRequest;
-import org.apache.carbondata.store.impl.rpc.model.RegisterWorkerResponse;
-
-import org.apache.hadoop.ipc.VersionedProtocol;
-
-@InterfaceAudience.Internal
-public interface RegistryService extends VersionedProtocol {
-  long versionID = 1L;
-  RegisterWorkerResponse registerWorker(RegisterWorkerRequest request) throws IOException;
-}

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/ServiceFactory.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/ServiceFactory.java b/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/ServiceFactory.java
deleted file mode 100644
index 852f14f..0000000
--- a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/ServiceFactory.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.carbondata.store.impl.rpc;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-
-import org.apache.carbondata.common.annotations.InterfaceAudience;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.ipc.RPC;
-
-@InterfaceAudience.Internal
-public class ServiceFactory {
-
-  public static StoreService createStoreService(String host, int port) throws IOException {
-    InetSocketAddress address = new InetSocketAddress(InetAddress.getByName(host), port);
-    return RPC.getProxy(
-        StoreService.class, StoreService.versionID, address, new Configuration());
-  }
-
-  public static RegistryService createRegistryService(String host, int port) throws IOException {
-    InetSocketAddress address = new InetSocketAddress(InetAddress.getByName(host), port);
-    return RPC.getProxy(
-        RegistryService.class, RegistryService.versionID, address, new Configuration());
-  }
-}

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/StoreService.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/StoreService.java b/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/StoreService.java
deleted file mode 100644
index 36702d9..0000000
--- a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/StoreService.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.carbondata.store.impl.rpc;
-
-import org.apache.carbondata.common.annotations.InterfaceAudience;
-import org.apache.carbondata.store.impl.rpc.model.BaseResponse;
-import org.apache.carbondata.store.impl.rpc.model.LoadDataRequest;
-import org.apache.carbondata.store.impl.rpc.model.QueryResponse;
-import org.apache.carbondata.store.impl.rpc.model.Scan;
-import org.apache.carbondata.store.impl.rpc.model.ShutdownRequest;
-import org.apache.carbondata.store.impl.rpc.model.ShutdownResponse;
-
-import org.apache.hadoop.ipc.VersionedProtocol;
-
-@InterfaceAudience.Internal
-public interface StoreService extends VersionedProtocol {
-
-  long versionID = 1L;
-
-  BaseResponse loadData(LoadDataRequest request);
-
-  QueryResponse query(Scan scan);
-
-  ShutdownResponse shutdown(ShutdownRequest request);
-}

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/BaseResponse.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/BaseResponse.java b/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/BaseResponse.java
deleted file mode 100644
index b11aa69..0000000
--- a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/BaseResponse.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.carbondata.store.impl.rpc.model;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.Serializable;
-
-import org.apache.carbondata.common.annotations.InterfaceAudience;
-
-import org.apache.hadoop.io.Writable;
-
-@InterfaceAudience.Internal
-public class BaseResponse implements Serializable, Writable {
-  private int status;
-  private String message;
-
-  public BaseResponse() {
-  }
-
-  public BaseResponse(int status, String message) {
-    this.status = status;
-    this.message = message;
-  }
-
-  public int getStatus() {
-    return status;
-  }
-
-  public void setStatus(int status) {
-    this.status = status;
-  }
-
-  public String getMessage() {
-    return message;
-  }
-
-  public void setMessage(String message) {
-    this.message = message;
-  }
-
-  @Override
-  public void write(DataOutput out) throws IOException {
-    out.writeInt(status);
-    out.writeUTF(message);
-  }
-
-  @Override
-  public void readFields(DataInput in) throws IOException {
-    status = in.readInt();
-    message = in.readUTF();
-  }
-}

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/LoadDataRequest.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/LoadDataRequest.java b/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/LoadDataRequest.java
deleted file mode 100644
index e6c8048..0000000
--- a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/LoadDataRequest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.carbondata.store.impl.rpc.model;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.Serializable;
-
-import org.apache.carbondata.processing.loading.model.CarbonLoadModel;
-import org.apache.carbondata.store.util.StoreUtil;
-
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableUtils;
-
-public class LoadDataRequest implements Serializable, Writable {
-
-  private CarbonLoadModel model;
-
-  public LoadDataRequest() {
-  }
-
-  public LoadDataRequest(CarbonLoadModel model) {
-    this.model = model;
-  }
-
-  public CarbonLoadModel getModel() {
-    return model;
-  }
-
-  public void setModel(CarbonLoadModel model) {
-    this.model = model;
-  }
-
-  @Override
-  public void write(DataOutput out) throws IOException {
-    WritableUtils.writeCompressedByteArray(out, StoreUtil.serialize(model));
-  }
-
-  @Override
-  public void readFields(DataInput in) throws IOException {
-    byte[] bytes = WritableUtils.readCompressedByteArray(in);
-    model = (CarbonLoadModel) StoreUtil.deserialize(bytes);
-  }
-}

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/QueryResponse.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/QueryResponse.java b/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/QueryResponse.java
deleted file mode 100644
index 304fd0f..0000000
--- a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/QueryResponse.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.carbondata.store.impl.rpc.model;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.Serializable;
-
-import org.apache.carbondata.common.annotations.InterfaceAudience;
-import org.apache.carbondata.core.util.ObjectSerializationUtil;
-
-import org.apache.hadoop.io.Writable;
-import org.apache.hadoop.io.WritableUtils;
-
-@InterfaceAudience.Internal
-public class QueryResponse extends BaseResponse implements Serializable, Writable {
-  private int queryId;
-  private Object[][] rows;
-
-  public QueryResponse() {
-    super();
-  }
-
-  public QueryResponse(int queryId, int status, String message, Object[][] rows) {
-    super(status, message);
-    this.queryId = queryId;
-    this.rows = rows;
-  }
-
-  public int getQueryId() {
-    return queryId;
-  }
-
-
-  public Object[][] getRows() {
-    return rows;
-  }
-
-  @Override
-  public void write(DataOutput out) throws IOException {
-    super.write(out);
-    out.writeInt(queryId);
-    WritableUtils.writeCompressedByteArray(out, ObjectSerializationUtil.serialize(rows));
-  }
-
-  @Override
-  public void readFields(DataInput in) throws IOException {
-    super.readFields(in);
-    queryId = in.readInt();
-    try {
-      rows = (Object[][])ObjectSerializationUtil.deserialize(
-          WritableUtils.readCompressedByteArray(in));
-    } catch (ClassNotFoundException e) {
-      throw new IOException(e);
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/RegisterWorkerRequest.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/RegisterWorkerRequest.java b/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/RegisterWorkerRequest.java
deleted file mode 100644
index 5f223d6..0000000
--- a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/RegisterWorkerRequest.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.carbondata.store.impl.rpc.model;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.Serializable;
-
-import org.apache.carbondata.common.annotations.InterfaceAudience;
-
-import org.apache.hadoop.io.Writable;
-
-@InterfaceAudience.Internal
-public class RegisterWorkerRequest implements Serializable, Writable {
-  private String hostAddress;
-  private int port;
-  private int cores;
-
-  public RegisterWorkerRequest() {
-  }
-
-  public RegisterWorkerRequest(String hostAddress, int port, int cores) {
-    this.hostAddress = hostAddress;
-    this.port = port;
-    this.cores = cores;
-  }
-
-  public String getHostAddress() {
-    return hostAddress;
-  }
-
-  public int getPort() {
-    return port;
-  }
-
-  public int getCores() {
-    return cores;
-  }
-
-  @Override
-  public void write(DataOutput out) throws IOException {
-    out.writeUTF(hostAddress);
-    out.writeInt(port);
-    out.writeInt(cores);
-  }
-
-  @Override
-  public void readFields(DataInput in) throws IOException {
-    hostAddress = in.readUTF();
-    port = in.readInt();
-    cores = in.readInt();
-  }
-
-  @Override public String toString() {
-    return "RegisterWorkerRequest{" + "hostAddress='" + hostAddress + '\'' + ", port=" + port + '}';
-  }
-}

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/RegisterWorkerResponse.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/RegisterWorkerResponse.java b/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/RegisterWorkerResponse.java
deleted file mode 100644
index 16915e9..0000000
--- a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/RegisterWorkerResponse.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.carbondata.store.impl.rpc.model;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.Serializable;
-
-import org.apache.carbondata.common.annotations.InterfaceAudience;
-
-import org.apache.hadoop.io.Writable;
-
-@InterfaceAudience.Internal
-public class RegisterWorkerResponse implements Serializable, Writable {
-
-  private String workerId;
-
-  public RegisterWorkerResponse() {
-  }
-
-  public RegisterWorkerResponse(String workerId) {
-    this.workerId = workerId;
-  }
-
-  public String getWorkerId() {
-    return workerId;
-  }
-
-  @Override
-  public void write(DataOutput out) throws IOException {
-    out.writeUTF(workerId);
-  }
-
-  @Override
-  public void readFields(DataInput in) throws IOException {
-    workerId = in.readUTF();
-  }
-}

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/Scan.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/Scan.java b/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/Scan.java
deleted file mode 100644
index 86767e5..0000000
--- a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/Scan.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.carbondata.store.impl.rpc.model;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.Serializable;
-
-import org.apache.carbondata.common.annotations.InterfaceAudience;
-import org.apache.carbondata.core.metadata.schema.table.TableInfo;
-import org.apache.carbondata.core.scan.expression.Expression;
-import org.apache.carbondata.core.util.ObjectSerializationUtil;
-import org.apache.carbondata.hadoop.CarbonMultiBlockSplit;
-
-import org.apache.hadoop.io.Writable;
-
-@InterfaceAudience.Internal
-public class Scan implements Serializable, Writable {
-  private int requestId;
-  private CarbonMultiBlockSplit split;
-  private TableInfo tableInfo;
-  private String[] projectColumns;
-  private Expression filterExpression;
-  private long limit;
-
-  public Scan() {
-  }
-
-  public Scan(int requestId, CarbonMultiBlockSplit split,
-      TableInfo tableInfo, String[] projectColumns, Expression filterExpression, long limit) {
-    this.requestId = requestId;
-    this.split = split;
-    this.tableInfo = tableInfo;
-    this.projectColumns = projectColumns;
-    this.filterExpression = filterExpression;
-    this.limit = limit;
-  }
-
-  public int getRequestId() {
-    return requestId;
-  }
-
-  public CarbonMultiBlockSplit getSplit() {
-    return split;
-  }
-
-  public TableInfo getTableInfo() {
-    return tableInfo;
-  }
-
-  public String[] getProjectColumns() {
-    return projectColumns;
-  }
-
-  public Expression getFilterExpression() {
-    return filterExpression;
-  }
-
-  public long getLimit() {
-    return limit;
-  }
-
-  @Override
-  public void write(DataOutput out) throws IOException {
-    out.writeInt(requestId);
-    split.write(out);
-    tableInfo.write(out);
-    out.writeInt(projectColumns.length);
-    for (String projectColumn : projectColumns) {
-      out.writeUTF(projectColumn);
-    }
-    String filter = ObjectSerializationUtil.convertObjectToString(filterExpression);
-    out.writeUTF(filter);
-    out.writeLong(limit);
-  }
-
-  @Override
-  public void readFields(DataInput in) throws IOException {
-    requestId = in.readInt();
-    split = new CarbonMultiBlockSplit();
-    split.readFields(in);
-    tableInfo = new TableInfo();
-    tableInfo.readFields(in);
-    projectColumns = new String[in.readInt()];
-    for (int i = 0; i < projectColumns.length; i++) {
-      projectColumns[i] = in.readUTF();
-    }
-    String filter = in.readUTF();
-    filterExpression = (Expression) ObjectSerializationUtil.convertStringToObject(filter);
-    limit = in.readLong();
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/ShutdownRequest.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/ShutdownRequest.java b/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/ShutdownRequest.java
deleted file mode 100644
index 311963d..0000000
--- a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/ShutdownRequest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.carbondata.store.impl.rpc.model;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.Serializable;
-
-import org.apache.carbondata.common.annotations.InterfaceAudience;
-
-import org.apache.hadoop.io.Writable;
-
-@InterfaceAudience.Internal
-public class ShutdownRequest implements Serializable, Writable {
-  private String reason;
-
-  public ShutdownRequest() {
-  }
-
-  public ShutdownRequest(String reason) {
-    this.reason = reason;
-  }
-
-  public String getReason() {
-    return reason;
-  }
-
-  @Override
-  public void write(DataOutput out) throws IOException {
-    out.writeUTF(reason);
-  }
-
-  @Override
-  public void readFields(DataInput in) throws IOException {
-    reason = in.readUTF();
-  }
-}

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/ShutdownResponse.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/ShutdownResponse.java b/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/ShutdownResponse.java
deleted file mode 100644
index 0143f48..0000000
--- a/store/core/src/main/java/org/apache/carbondata/store/impl/rpc/model/ShutdownResponse.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.carbondata.store.impl.rpc.model;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.Serializable;
-
-import org.apache.carbondata.common.annotations.InterfaceAudience;
-
-import org.apache.hadoop.io.Writable;
-
-@InterfaceAudience.Internal
-public class ShutdownResponse implements Serializable, Writable {
-  private int status;
-  private String message;
-
-  public ShutdownResponse() {
-  }
-
-  public ShutdownResponse(int status, String message) {
-    this.status = status;
-    this.message = message;
-  }
-
-  public int getStatus() {
-    return status;
-  }
-
-  public String getMessage() {
-    return message;
-  }
-
-  @Override
-  public void write(DataOutput out) throws IOException {
-    out.writeInt(status);
-    out.writeUTF(message);
-  }
-
-  @Override
-  public void readFields(DataInput in) throws IOException {
-    status = in.readInt();
-    message = in.readUTF();
-  }
-}

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/service/DataService.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/service/DataService.java b/store/core/src/main/java/org/apache/carbondata/store/impl/service/DataService.java
new file mode 100644
index 0000000..670540b
--- /dev/null
+++ b/store/core/src/main/java/org/apache/carbondata/store/impl/service/DataService.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.carbondata.store.impl.service;
+
+import java.io.Closeable;
+import java.util.Iterator;
+
+import org.apache.carbondata.core.datastore.row.CarbonRow;
+import org.apache.carbondata.sdk.store.exception.CarbonException;
+import org.apache.carbondata.store.devapi.ResultBatch;
+import org.apache.carbondata.store.devapi.ScanUnit;
+import org.apache.carbondata.store.impl.service.model.BaseResponse;
+import org.apache.carbondata.store.impl.service.model.LoadDataRequest;
+import org.apache.carbondata.store.impl.service.model.ScanRequest;
+import org.apache.carbondata.store.impl.service.model.ScanResponse;
+
+import org.apache.hadoop.ipc.VersionedProtocol;
+
+public interface DataService extends VersionedProtocol, Closeable {
+
+  long versionID = 1L;
+
+  /**
+   * Load data into a Table
+   * @param load descriptor for load operation
+   * @throws CarbonException if any error occurs
+   */
+  BaseResponse loadData(LoadDataRequest load) throws CarbonException;
+
+  /**
+   * Scan a Table and return matched rows
+   * @param scan descriptor for scan operation, including required column, filter, etc
+   * @return matched rows
+   * @throws CarbonException if any error occurs
+   */
+  ScanResponse scan(ScanRequest scan) throws CarbonException;
+
+}

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/service/PruneService.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/service/PruneService.java b/store/core/src/main/java/org/apache/carbondata/store/impl/service/PruneService.java
new file mode 100644
index 0000000..d69db96
--- /dev/null
+++ b/store/core/src/main/java/org/apache/carbondata/store/impl/service/PruneService.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.carbondata.store.impl.service;
+
+import org.apache.carbondata.common.annotations.InterfaceAudience;
+import org.apache.carbondata.sdk.store.exception.CarbonException;
+import org.apache.carbondata.store.impl.service.model.PruneRequest;
+import org.apache.carbondata.store.impl.service.model.PruneResponse;
+
+import org.apache.hadoop.ipc.VersionedProtocol;
+
+@InterfaceAudience.Internal
+public interface PruneService extends VersionedProtocol {
+  long versionID = 1L;
+
+  /**
+   * Leveraging index and segment information to skip blocks,
+   * return a list of block eligible for scanning
+   *
+   * @param request prune request containing table identifier
+   *                and filter expression
+   * @return prune result containing blocks to scan
+   * @throws CarbonException if any error occurs
+   */
+  PruneResponse prune(PruneRequest request) throws CarbonException;
+}

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/service/RegistryService.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/service/RegistryService.java b/store/core/src/main/java/org/apache/carbondata/store/impl/service/RegistryService.java
new file mode 100644
index 0000000..f635050
--- /dev/null
+++ b/store/core/src/main/java/org/apache/carbondata/store/impl/service/RegistryService.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.carbondata.store.impl.service;
+
+import java.io.IOException;
+
+import org.apache.carbondata.common.annotations.InterfaceAudience;
+import org.apache.carbondata.store.impl.service.model.RegisterWorkerRequest;
+import org.apache.carbondata.store.impl.service.model.RegisterWorkerResponse;
+
+import org.apache.hadoop.ipc.VersionedProtocol;
+
+@InterfaceAudience.Internal
+public interface RegistryService extends VersionedProtocol {
+  long versionID = 1L;
+  RegisterWorkerResponse registerWorker(RegisterWorkerRequest request) throws IOException;
+}

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/service/ServiceFactory.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/service/ServiceFactory.java b/store/core/src/main/java/org/apache/carbondata/store/impl/service/ServiceFactory.java
new file mode 100644
index 0000000..41daf0f
--- /dev/null
+++ b/store/core/src/main/java/org/apache/carbondata/store/impl/service/ServiceFactory.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.carbondata.store.impl.service;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+
+import org.apache.carbondata.common.annotations.InterfaceAudience;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.ipc.RPC;
+
+@InterfaceAudience.Internal
+public class ServiceFactory {
+
+  public static RegistryService createRegistryService(String host, int port) throws IOException {
+    InetSocketAddress address = new InetSocketAddress(InetAddress.getByName(host), port);
+    return RPC.getProxy(
+        RegistryService.class, RegistryService.versionID, address, new Configuration());
+  }
+
+  public static PruneService createPruneService(String host, int port) throws IOException {
+    InetSocketAddress address = new InetSocketAddress(InetAddress.getByName(host), port);
+    return RPC.getProxy(
+        PruneService.class, PruneService.versionID, address, new Configuration());
+  }
+
+  public static DataService createDataService(String host, int port) throws IOException {
+    InetSocketAddress address = new InetSocketAddress(InetAddress.getByName(host), port);
+    return RPC.getProxy(
+        DataService.class, DataService.versionID, address, new Configuration());
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/BaseResponse.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/BaseResponse.java b/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/BaseResponse.java
new file mode 100644
index 0000000..49478e5
--- /dev/null
+++ b/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/BaseResponse.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.carbondata.store.impl.service.model;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.io.Serializable;
+
+import org.apache.carbondata.common.annotations.InterfaceAudience;
+
+import org.apache.hadoop.io.Writable;
+
+@InterfaceAudience.Internal
+public class BaseResponse implements Serializable, Writable {
+  private int status;
+  private String message;
+
+  public BaseResponse() {
+  }
+
+  public BaseResponse(int status, String message) {
+    this.status = status;
+    this.message = message;
+  }
+
+  public int getStatus() {
+    return status;
+  }
+
+  public void setStatus(int status) {
+    this.status = status;
+  }
+
+  public String getMessage() {
+    return message;
+  }
+
+  public void setMessage(String message) {
+    this.message = message;
+  }
+
+  @Override
+  public void write(DataOutput out) throws IOException {
+    out.writeInt(status);
+    out.writeUTF(message);
+  }
+
+  @Override
+  public void readFields(DataInput in) throws IOException {
+    status = in.readInt();
+    message = in.readUTF();
+  }
+}

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/LoadDataRequest.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/LoadDataRequest.java b/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/LoadDataRequest.java
new file mode 100644
index 0000000..aa15fa9
--- /dev/null
+++ b/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/LoadDataRequest.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.carbondata.store.impl.service.model;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.io.Serializable;
+
+import org.apache.carbondata.processing.loading.model.CarbonLoadModel;
+import org.apache.carbondata.sdk.store.util.StoreUtil;
+
+import org.apache.hadoop.io.Writable;
+import org.apache.hadoop.io.WritableUtils;
+
+public class LoadDataRequest implements Serializable, Writable {
+
+  private CarbonLoadModel model;
+
+  public LoadDataRequest() {
+  }
+
+  public LoadDataRequest(CarbonLoadModel model) {
+    this.model = model;
+  }
+
+  public CarbonLoadModel getModel() {
+    return model;
+  }
+
+  public void setModel(CarbonLoadModel model) {
+    this.model = model;
+  }
+
+  @Override
+  public void write(DataOutput out) throws IOException {
+    WritableUtils.writeCompressedByteArray(out, StoreUtil.serialize(model));
+  }
+
+  @Override
+  public void readFields(DataInput in) throws IOException {
+    byte[] bytes = WritableUtils.readCompressedByteArray(in);
+    model = (CarbonLoadModel) StoreUtil.deserialize(bytes);
+  }
+}

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/PruneRequest.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/PruneRequest.java b/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/PruneRequest.java
new file mode 100644
index 0000000..ace35f3
--- /dev/null
+++ b/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/PruneRequest.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.carbondata.store.impl.service.model;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.io.Serializable;
+
+import org.apache.carbondata.core.scan.expression.Expression;
+import org.apache.carbondata.core.util.ObjectSerializationUtil;
+import org.apache.carbondata.sdk.store.descriptor.TableIdentifier;
+
+import org.apache.hadoop.io.Writable;
+
+public class PruneRequest implements Serializable, Writable {
+
+  private TableIdentifier table;
+  private Expression filterExpression;
+
+  public PruneRequest() {
+  }
+
+  public PruneRequest(TableIdentifier table, Expression filterExpression) {
+    this.table = table;
+    this.filterExpression = filterExpression;
+  }
+
+  public TableIdentifier getTable() {
+    return table;
+  }
+
+  public Expression getFilterExpression() {
+    return filterExpression;
+  }
+
+  @Override
+  public void write(DataOutput out) throws IOException {
+    table.write(out);
+    out.writeUTF(ObjectSerializationUtil.convertObjectToString(filterExpression));
+  }
+
+  @Override
+  public void readFields(DataInput in) throws IOException {
+    table = new TableIdentifier();
+    table.readFields(in);
+    filterExpression = (Expression) (ObjectSerializationUtil.convertStringToObject(in.readUTF()));
+  }
+}

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/PruneResponse.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/PruneResponse.java b/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/PruneResponse.java
new file mode 100644
index 0000000..111528b
--- /dev/null
+++ b/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/PruneResponse.java
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.carbondata.store.impl.service.model;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.carbondata.common.annotations.InterfaceAudience;
+import org.apache.carbondata.store.devapi.ScanUnit;
+import org.apache.carbondata.store.impl.BlockScanUnit;
+
+import org.apache.hadoop.io.Writable;
+
+@InterfaceAudience.Internal
+public class PruneResponse implements Serializable, Writable {
+
+  private List<ScanUnit> scanUnits;
+
+  public PruneResponse() {
+  }
+
+  public PruneResponse(List<ScanUnit> scanUnits) {
+    this.scanUnits = scanUnits;
+  }
+
+  public List<ScanUnit> getScanUnits() {
+    return scanUnits;
+  }
+
+  @Override
+  public void write(DataOutput out) throws IOException {
+    out.writeInt(scanUnits.size());
+    for (ScanUnit scanUnit : scanUnits) {
+      scanUnit.write(out);
+    }
+  }
+
+  @Override
+  public void readFields(DataInput in) throws IOException {
+    int size = in.readInt();
+    scanUnits = new ArrayList<>(size);
+    for (int i = 0; i < size; i++) {
+      BlockScanUnit scanUnit = new BlockScanUnit();
+      scanUnit.readFields(in);
+      scanUnits.add(scanUnit);
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/RegisterWorkerRequest.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/RegisterWorkerRequest.java b/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/RegisterWorkerRequest.java
new file mode 100644
index 0000000..54e7271
--- /dev/null
+++ b/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/RegisterWorkerRequest.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.carbondata.store.impl.service.model;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.io.Serializable;
+
+import org.apache.carbondata.common.annotations.InterfaceAudience;
+
+import org.apache.hadoop.io.Writable;
+
+@InterfaceAudience.Internal
+public class RegisterWorkerRequest implements Serializable, Writable {
+  private String hostAddress;
+  private int port;
+  private int cores;
+
+  public RegisterWorkerRequest() {
+  }
+
+  public RegisterWorkerRequest(String hostAddress, int port, int cores) {
+    this.hostAddress = hostAddress;
+    this.port = port;
+    this.cores = cores;
+  }
+
+  public String getHostAddress() {
+    return hostAddress;
+  }
+
+  public int getPort() {
+    return port;
+  }
+
+  public int getCores() {
+    return cores;
+  }
+
+  @Override
+  public void write(DataOutput out) throws IOException {
+    out.writeUTF(hostAddress);
+    out.writeInt(port);
+    out.writeInt(cores);
+  }
+
+  @Override
+  public void readFields(DataInput in) throws IOException {
+    hostAddress = in.readUTF();
+    port = in.readInt();
+    cores = in.readInt();
+  }
+
+  @Override public String toString() {
+    return "RegisterWorkerRequest{" + "hostAddress='" + hostAddress + '\'' + ", port=" + port + '}';
+  }
+}

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/RegisterWorkerResponse.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/RegisterWorkerResponse.java b/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/RegisterWorkerResponse.java
new file mode 100644
index 0000000..5bbfa67
--- /dev/null
+++ b/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/RegisterWorkerResponse.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.carbondata.store.impl.service.model;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.io.Serializable;
+
+import org.apache.carbondata.common.annotations.InterfaceAudience;
+
+import org.apache.hadoop.io.Writable;
+
+@InterfaceAudience.Internal
+public class RegisterWorkerResponse implements Serializable, Writable {
+
+  private String workerId;
+
+  public RegisterWorkerResponse() {
+  }
+
+  public RegisterWorkerResponse(String workerId) {
+    this.workerId = workerId;
+  }
+
+  public String getWorkerId() {
+    return workerId;
+  }
+
+  @Override
+  public void write(DataOutput out) throws IOException {
+    out.writeUTF(workerId);
+  }
+
+  @Override
+  public void readFields(DataInput in) throws IOException {
+    workerId = in.readUTF();
+  }
+}

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/ScanRequest.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/ScanRequest.java b/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/ScanRequest.java
new file mode 100644
index 0000000..d7b60ba
--- /dev/null
+++ b/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/ScanRequest.java
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.carbondata.store.impl.service.model;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.io.Serializable;
+
+import org.apache.carbondata.common.annotations.InterfaceAudience;
+import org.apache.carbondata.core.metadata.schema.table.TableInfo;
+import org.apache.carbondata.core.scan.expression.Expression;
+import org.apache.carbondata.core.util.ObjectSerializationUtil;
+import org.apache.carbondata.hadoop.CarbonMultiBlockSplit;
+
+import org.apache.hadoop.io.Writable;
+
+@InterfaceAudience.Internal
+public class ScanRequest implements Serializable, Writable {
+  private int requestId;
+  private CarbonMultiBlockSplit split;
+  private TableInfo tableInfo;
+  private String[] projectColumns;
+  private Expression filterExpression;
+  private long limit;
+
+  public ScanRequest() {
+  }
+
+  public ScanRequest(int requestId, CarbonMultiBlockSplit split,
+      TableInfo tableInfo, String[] projectColumns, Expression filterExpression, long limit) {
+    this.requestId = requestId;
+    this.split = split;
+    this.tableInfo = tableInfo;
+    this.projectColumns = projectColumns;
+    this.filterExpression = filterExpression;
+    this.limit = limit;
+  }
+
+  public int getRequestId() {
+    return requestId;
+  }
+
+  public CarbonMultiBlockSplit getSplit() {
+    return split;
+  }
+
+  public TableInfo getTableInfo() {
+    return tableInfo;
+  }
+
+  public String[] getProjectColumns() {
+    return projectColumns;
+  }
+
+  public Expression getFilterExpression() {
+    return filterExpression;
+  }
+
+  public long getLimit() {
+    return limit;
+  }
+
+  @Override
+  public void write(DataOutput out) throws IOException {
+    out.writeInt(requestId);
+    split.write(out);
+    tableInfo.write(out);
+    out.writeInt(projectColumns.length);
+    for (String projectColumn : projectColumns) {
+      out.writeUTF(projectColumn);
+    }
+    String filter = ObjectSerializationUtil.convertObjectToString(filterExpression);
+    out.writeUTF(filter);
+    out.writeLong(limit);
+  }
+
+  @Override
+  public void readFields(DataInput in) throws IOException {
+    requestId = in.readInt();
+    split = new CarbonMultiBlockSplit();
+    split.readFields(in);
+    tableInfo = new TableInfo();
+    tableInfo.readFields(in);
+    projectColumns = new String[in.readInt()];
+    for (int i = 0; i < projectColumns.length; i++) {
+      projectColumns[i] = in.readUTF();
+    }
+    String filter = in.readUTF();
+    filterExpression = (Expression) ObjectSerializationUtil.convertStringToObject(filter);
+    limit = in.readLong();
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/ScanResponse.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/ScanResponse.java b/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/ScanResponse.java
new file mode 100644
index 0000000..c5a14c2
--- /dev/null
+++ b/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/ScanResponse.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.carbondata.store.impl.service.model;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.io.Serializable;
+
+import org.apache.carbondata.common.annotations.InterfaceAudience;
+import org.apache.carbondata.core.util.ObjectSerializationUtil;
+
+import org.apache.hadoop.io.Writable;
+import org.apache.hadoop.io.WritableUtils;
+
+@InterfaceAudience.Internal
+public class ScanResponse extends BaseResponse implements Serializable, Writable {
+  private int queryId;
+  private Object[][] rows;
+
+  public ScanResponse() {
+    super();
+  }
+
+  public ScanResponse(int queryId, int status, String message, Object[][] rows) {
+    super(status, message);
+    this.queryId = queryId;
+    this.rows = rows;
+  }
+
+  public int getQueryId() {
+    return queryId;
+  }
+
+
+  public Object[][] getRows() {
+    return rows;
+  }
+
+  @Override
+  public void write(DataOutput out) throws IOException {
+    super.write(out);
+    out.writeInt(queryId);
+    WritableUtils.writeCompressedByteArray(out, ObjectSerializationUtil.serialize(rows));
+  }
+
+  @Override
+  public void readFields(DataInput in) throws IOException {
+    super.readFields(in);
+    queryId = in.readInt();
+    try {
+      rows = (Object[][])ObjectSerializationUtil.deserialize(
+          WritableUtils.readCompressedByteArray(in));
+    } catch (ClassNotFoundException e) {
+      throw new IOException(e);
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/carbondata/blob/9f10122a/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/ShutdownRequest.java
----------------------------------------------------------------------
diff --git a/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/ShutdownRequest.java b/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/ShutdownRequest.java
new file mode 100644
index 0000000..d029d0a
--- /dev/null
+++ b/store/core/src/main/java/org/apache/carbondata/store/impl/service/model/ShutdownRequest.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.carbondata.store.impl.service.model;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.io.Serializable;
+
+import org.apache.carbondata.common.annotations.InterfaceAudience;
+
+import org.apache.hadoop.io.Writable;
+
+@InterfaceAudience.Internal
+public class ShutdownRequest implements Serializable, Writable {
+  private String reason;
+
+  public ShutdownRequest() {
+  }
+
+  public ShutdownRequest(String reason) {
+    this.reason = reason;
+  }
+
+  public String getReason() {
+    return reason;
+  }
+
+  @Override
+  public void write(DataOutput out) throws IOException {
+    out.writeUTF(reason);
+  }
+
+  @Override
+  public void readFields(DataInput in) throws IOException {
+    reason = in.readUTF();
+  }
+}