tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hyun...@apache.org
Subject [28/48] git commit: TAJO-605: Rename Options to KeyValueList. (jinho)
Date Tue, 20 May 2014 18:46:26 GMT
TAJO-605: Rename Options to KeyValueList. (jinho)


Project: http://git-wip-us.apache.org/repos/asf/tajo/repo
Commit: http://git-wip-us.apache.org/repos/asf/tajo/commit/5db47466
Tree: http://git-wip-us.apache.org/repos/asf/tajo/tree/5db47466
Diff: http://git-wip-us.apache.org/repos/asf/tajo/diff/5db47466

Branch: refs/heads/window_function
Commit: 5db47466b00b7405a7decf1fbe036f4ebfb960ec
Parents: 08bcc2d
Author: jinossy <jinossy@gmail.com>
Authored: Wed May 7 11:07:06 2014 +0900
Committer: jinossy <jinossy@gmail.com>
Committed: Wed May 7 11:07:06 2014 +0900

----------------------------------------------------------------------
 CHANGES                                         |   8 +-
 .../org/apache/tajo/catalog/CatalogUtil.java    |   5 +-
 .../org/apache/tajo/catalog/DDLBuilder.java     |   3 +-
 .../java/org/apache/tajo/catalog/Options.java   | 155 -------------------
 .../java/org/apache/tajo/catalog/TableDesc.java |   3 +-
 .../java/org/apache/tajo/catalog/TableMeta.java |  19 +--
 .../tajo/catalog/json/TableMetaAdapter.java     |  10 +-
 .../src/main/proto/CatalogProtos.proto          |  10 +-
 .../apache/tajo/catalog/TestKeyValueSet.java    |  64 ++++++++
 .../org/apache/tajo/catalog/TestOptions.java    |  63 --------
 .../tajo/catalog/store/HCatalogStore.java       |   5 +-
 .../tajo/catalog/store/TestHCatalogStore.java   |  24 +--
 .../tajo/catalog/store/AbstractDBStore.java     |  11 +-
 .../org/apache/tajo/catalog/TestCatalog.java    |  16 +-
 .../java/org/apache/tajo/client/TajoClient.java |  11 +-
 .../java/org/apache/tajo/util/KeyValueSet.java  | 155 +++++++++++++++++++
 .../src/main/proto/PrimitiveProtos.proto        |   9 ++
 .../tajo/engine/planner/LogicalPlanner.java     |   9 +-
 .../engine/planner/global/GlobalPlanner.java    |   3 +-
 .../engine/planner/logical/CreateTableNode.java |   4 +-
 .../planner/logical/PersistentStoreNode.java    |  10 +-
 .../apache/tajo/engine/query/QueryContext.java  |   6 +-
 .../tajo/master/TajoMasterClientService.java    |  13 +-
 .../tajo/master/querymaster/SubQuery.java       |   3 +-
 .../org/apache/tajo/master/session/Session.java |   8 +-
 .../apache/tajo/LocalTajoTestingUtility.java    |   3 +-
 .../org/apache/tajo/TajoTestingCluster.java     |   4 +-
 .../test/java/org/apache/tajo/TpchTestBase.java |   4 +-
 .../apache/tajo/engine/eval/ExprTestBase.java   |   3 +-
 .../engine/planner/TestLogicalOptimizer.java    |   5 +-
 .../tajo/engine/planner/TestLogicalPlanner.java |   5 +-
 .../tajo/engine/planner/TestPlannerUtil.java    |   5 +-
 .../planner/physical/TestPhysicalPlanner.java   |   5 +-
 .../apache/tajo/engine/query/TestCTASQuery.java |   4 +-
 .../tajo/engine/query/TestNullValues.java       |  10 +-
 .../tajo/worker/TestRangeRetrieverHandler.java  |   5 +-
 .../org/apache/tajo/storage/StorageUtil.java    |   5 +-
 .../apache/tajo/storage/TestMergeScanner.java   |   4 +-
 .../org/apache/tajo/storage/TestStorages.java   |  15 +-
 .../apache/tajo/storage/v2/TestStorages.java    |   4 +-
 40 files changed, 371 insertions(+), 337 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index f1bacf4..ce98a7a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -48,11 +48,15 @@ Release 0.9.0 - unreleased
 
     TAJO-766: Test failures in TestExecExternalShellCommand. (jihoon)
 
+  TASKS
+
+    TAJO-605: Rename Options to KeyValueList. (jinho)
+
   SUB TASKS
 
     TAJO-783: Remove yarn-related code from tajo-core. (hyunsik)
 
-Release 0.8.0 - unreleased
+Release 0.8.0
 
   NEW FEATURES
 
@@ -801,7 +805,7 @@ Release 0.8.0 - unreleased
 
     TAJO-686: Integration test aborted. (jinho)
 
-Release 0.2.0 - released
+Release 0.2.0
 
   NEW FEATURES
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogUtil.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogUtil.java b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogUtil.java
index c363eb0..85ea516 100644
--- a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogUtil.java
+++ b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/CatalogUtil.java
@@ -28,6 +28,7 @@ import org.apache.tajo.catalog.proto.CatalogProtos.TableDescProto;
 import org.apache.tajo.common.TajoDataTypes;
 import org.apache.tajo.common.TajoDataTypes.DataType;
 import org.apache.tajo.exception.InvalidOperationException;
+import org.apache.tajo.util.KeyValueSet;
 import org.apache.tajo.util.StringUtils;
 
 import java.sql.Connection;
@@ -298,10 +299,10 @@ public class CatalogUtil {
   }
 
   public static TableMeta newTableMeta(StoreType type) {
-    return new TableMeta(type, new Options());
+    return new TableMeta(type, new KeyValueSet());
   }
 
-  public static TableMeta newTableMeta(StoreType type, Options options) {
+  public static TableMeta newTableMeta(StoreType type, KeyValueSet options) {
     return new TableMeta(type, options);
   }
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/DDLBuilder.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/DDLBuilder.java b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/DDLBuilder.java
index 77dccd2..bd7364a 100644
--- a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/DDLBuilder.java
+++ b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/DDLBuilder.java
@@ -20,6 +20,7 @@ package org.apache.tajo.catalog;
 
 import org.apache.tajo.catalog.partition.PartitionMethodDesc;
 import org.apache.tajo.common.TajoDataTypes;
+import org.apache.tajo.util.KeyValueSet;
 
 import java.util.Map;
 
@@ -94,7 +95,7 @@ public class DDLBuilder {
   }
 
   private static void buildWithClause(StringBuilder sb, TableMeta meta) {
-    Options options = meta.getOptions();
+    KeyValueSet options = meta.getOptions();
     if (options != null && options.size() > 0) {
       boolean first = true;
       sb.append(" WITH (");

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/Options.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/Options.java b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/Options.java
deleted file mode 100644
index c6f9a77..0000000
--- a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/Options.java
+++ /dev/null
@@ -1,155 +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.tajo.catalog;
-
-import com.google.common.base.Objects;
-import com.google.gson.annotations.Expose;
-import org.apache.tajo.catalog.json.CatalogGsonHelper;
-import org.apache.tajo.catalog.proto.CatalogProtos.KeyValueProto;
-import org.apache.tajo.catalog.proto.CatalogProtos.KeyValueSetProto;
-import org.apache.tajo.common.ProtoObject;
-import org.apache.tajo.json.GsonObject;
-import org.apache.tajo.util.TUtil;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-public class Options implements ProtoObject<KeyValueSetProto>, Cloneable, GsonObject {
-	private KeyValueSetProto.Builder builder = KeyValueSetProto.newBuilder();
-	
-	@Expose private Map<String,String> keyVals;
-	
-	public Options() {
-    keyVals = TUtil.newHashMap();
-	}
-	
-	public Options(KeyValueSetProto proto) {
-    this.keyVals = TUtil.newHashMap();
-    for(KeyValueProto keyval : proto.getKeyvalList()) {
-      this.keyVals.put(keyval.getKey(), keyval.getValue());
-    }
-	}
-	
-	public Options(Options options) {
-	  this();
-	  this.keyVals.putAll(options.keyVals);
-	}
-	
-	public static Options create() {
-	  return new Options();
-	}
-	
-	public static Options create(Options options) {
-    return new Options(options);
-  }
-
-  public int size() {
-    return keyVals.size();
-  }
-	
-	public void put(String key, String val) {
-		this.keyVals.put(key, val);
-	}
-
-  public void putAll(Map<String, String> keyValues) {
-    if (keyValues != null) {
-      this.keyVals.putAll(keyValues);
-    }
-  }
-	
-	public void putAll(Options options) {
-    if (options != null) {
-	    this.keyVals.putAll(options.keyVals);
-    }
-	}
-	
-	public String get(String key) {
-		return this.keyVals.get(key);
-	}
-	
-	public String get(String key, String defaultVal) {
-	  if(keyVals.containsKey(key))
-	    return keyVals.get(key);
-	  else {
-	    return defaultVal;
-	  }
-	}
-	
-	public Map<String,String> getAllKeyValus() {
-	  return keyVals;
-	}
-	
-	public String delete(String key) {
-		return keyVals.remove(key);
-	}
-
-  @Override
-  public int hashCode() {
-    return Objects.hashCode(keyVals);
-
-  }
-
-    @Override
-	public boolean equals(Object object) {
-		if(object instanceof Options) {
-			Options other = (Options)object;
-			for(Entry<String, String> entry : other.keyVals.entrySet()) {
-				if(!keyVals.get(entry.getKey()).equals(entry.getValue()))
-					return false;
-			}
-			return true;
-		}
-		
-		return false;
-	}
-	
-	@Override
-  public Object clone() throws CloneNotSupportedException {    
-    Options options = (Options) super.clone();
-    options.builder = KeyValueSetProto.newBuilder();
-    options.keyVals = keyVals != null ? new HashMap<String, String>(keyVals) : null;
-    return options;
-	}
-	
-	@Override
-	public KeyValueSetProto getProto() {
-    if (builder == null) {
-      builder = KeyValueSetProto.newBuilder();
-    } else {
-      builder.clear();
-    }
-
-    KeyValueProto.Builder kvBuilder;
-    if(this.keyVals != null) {
-      for(Entry<String,String> kv : keyVals.entrySet()) {
-        kvBuilder = KeyValueProto.newBuilder();
-        kvBuilder.setKey(kv.getKey());
-
-        kvBuilder.setValue(kv.getValue());
-        builder.addKeyval(kvBuilder.build());
-      }
-    }
-    return builder.build();
-	}
-  
-  public String toJson() {
-    return CatalogGsonHelper.toJson(this, Options.class);
-  }
-}

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/TableDesc.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/TableDesc.java b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/TableDesc.java
index 5aa035e..c148049 100644
--- a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/TableDesc.java
+++ b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/TableDesc.java
@@ -32,6 +32,7 @@ import org.apache.tajo.catalog.proto.CatalogProtos.TableDescProto;
 import org.apache.tajo.catalog.statistics.TableStats;
 import org.apache.tajo.common.ProtoObject;
 import org.apache.tajo.json.GsonObject;
+import org.apache.tajo.util.KeyValueSet;
 import org.apache.tajo.util.TUtil;
 
 public class TableDesc implements ProtoObject<TableDescProto>, GsonObject, Cloneable {
@@ -67,7 +68,7 @@ public class TableDesc implements ProtoObject<TableDescProto>, GsonObject, Clone
 		this(tableName, schema, meta, path, true);
 	}
 	
-	public TableDesc(String tableName, Schema schema, StoreType type, Options options, Path path) {
+	public TableDesc(String tableName, Schema schema, StoreType type, KeyValueSet options, Path path) {
 	  this(tableName, schema, new TableMeta(type, options), path);
 	}
 	

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/TableMeta.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/TableMeta.java b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/TableMeta.java
index 6c72f58..6015fc9 100644
--- a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/TableMeta.java
+++ b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/TableMeta.java
@@ -29,6 +29,7 @@ import org.apache.tajo.catalog.proto.CatalogProtos.TableProto;
 import org.apache.tajo.catalog.proto.CatalogProtos.TableProtoOrBuilder;
 import org.apache.tajo.common.ProtoObject;
 import org.apache.tajo.json.GsonObject;
+import org.apache.tajo.util.KeyValueSet;
 
 import java.util.Map;
 
@@ -41,16 +42,16 @@ public class TableMeta implements ProtoObject<CatalogProtos.TableProto>, GsonObj
   private boolean viaProto = false;
 
 	@Expose protected StoreType storeType;
-	@Expose protected Options options;
+	@Expose protected KeyValueSet options;
 	
 	private TableMeta() {
 	  builder = TableProto.newBuilder();
 	}
 	
-	public TableMeta(StoreType type, Options options) {
+	public TableMeta(StoreType type, KeyValueSet options) {
 	  this();
     this.storeType = type;
-    this.options = new Options(options);
+    this.options = new KeyValueSet(options);
   }
 	
 	public TableMeta(TableProto proto) {
@@ -70,7 +71,7 @@ public class TableMeta implements ProtoObject<CatalogProtos.TableProto>, GsonObj
 		return this.storeType;		
 	}
 	
-  public void setOptions(Options options) {
+  public void setOptions(KeyValueSet options) {
     maybeInitBuilder();
     this.options = options;
   }
@@ -88,7 +89,7 @@ public class TableMeta implements ProtoObject<CatalogProtos.TableProto>, GsonObj
     if (!p.hasParams()) {
       return null;
     }
-    this.options = new Options(p.getParams());
+    this.options = new KeyValueSet(p.getParams());
     return options.get(key);
   }
 
@@ -100,11 +101,11 @@ public class TableMeta implements ProtoObject<CatalogProtos.TableProto>, GsonObj
     if (!p.hasParams()) {
       return null;
     }
-    this.options = new Options(p.getParams());
+    this.options = new KeyValueSet(p.getParams());
     return options.get(key, defaultValue);
   }
 
-  public Options getOptions() {
+  public KeyValueSet getOptions() {
     TableProtoOrBuilder p = viaProto ? proto : builder;
     if (options != null) {
       return this.options;
@@ -112,7 +113,7 @@ public class TableMeta implements ProtoObject<CatalogProtos.TableProto>, GsonObj
     if (!p.hasParams()) {
       return null;
     }
-    this.options = new Options(p.getParams());
+    this.options = new KeyValueSet(p.getParams());
     return options;
   }
 
@@ -139,7 +140,7 @@ public class TableMeta implements ProtoObject<CatalogProtos.TableProto>, GsonObj
 	  TableMeta meta = (TableMeta) super.clone();
     meta.builder = TableProto.newBuilder();
     meta.storeType = getStoreType();
-    meta.options = (Options) (toMap() != null ? options.clone() : null);
+    meta.options = (KeyValueSet) (toMap() != null ? options.clone() : null);
     
     return meta;
 	}

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/json/TableMetaAdapter.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/json/TableMetaAdapter.java b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/json/TableMetaAdapter.java
index b3f788e..adad473 100644
--- a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/json/TableMetaAdapter.java
+++ b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/json/TableMetaAdapter.java
@@ -20,7 +20,7 @@ package org.apache.tajo.catalog.json;
 
 import com.google.common.base.Preconditions;
 import com.google.gson.*;
-import org.apache.tajo.catalog.Options;
+import org.apache.tajo.util.KeyValueSet;
 import org.apache.tajo.catalog.TableMeta;
 import org.apache.tajo.catalog.proto.CatalogProtos;
 import org.apache.tajo.json.GsonSerDerAdapter;
@@ -37,14 +37,14 @@ public class TableMetaAdapter implements GsonSerDerAdapter<TableMeta> {
 
     CatalogProtos.StoreType type = CatalogProtos.StoreType.valueOf(jsonObject.get("store").getAsString());
 
-    Options options = null;
+    KeyValueSet keyValueSet = null;
     if (jsonObject.get("options") != null) {
-      options = context.deserialize(jsonObject.get("options"), Options.class);
+      keyValueSet = context.deserialize(jsonObject.get("options"), KeyValueSet.class);
     } else {
       throw new JsonParseException("Options not found in json");
 
     }
-		return new TableMeta(type, options);
+		return new TableMeta(type, keyValueSet);
 	}
 
 	@Override
@@ -52,7 +52,7 @@ public class TableMetaAdapter implements GsonSerDerAdapter<TableMeta> {
 			JsonSerializationContext context) {
 		JsonObject jsonObj = new JsonObject();
     jsonObj.addProperty("store", src.getStoreType().name());
-    jsonObj.add("options", context.serialize(src.getOptions(), Options.class));
+    jsonObj.add("options", context.serialize(src.getOptions(), KeyValueSet.class));
 		return jsonObj;
 	}
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-catalog/tajo-catalog-common/src/main/proto/CatalogProtos.proto
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-common/src/main/proto/CatalogProtos.proto b/tajo-catalog/tajo-catalog-common/src/main/proto/CatalogProtos.proto
index 7f41596..e70ed2b 100644
--- a/tajo-catalog/tajo-catalog-common/src/main/proto/CatalogProtos.proto
+++ b/tajo-catalog/tajo-catalog-common/src/main/proto/CatalogProtos.proto
@@ -23,6 +23,7 @@ option java_generic_services = false;
 option java_generate_equals_and_hash = true;
 
 import "DataTypes.proto";
+import "PrimitiveProtos.proto";
 
 enum StoreType {
   MEM = 0;
@@ -65,15 +66,6 @@ message SchemaProto {
   repeated ColumnProto fields = 1;
 }
 
-message KeyValueProto {
-  required string key = 1;
-  required string value = 2;
-}
-
-message KeyValueSetProto {
-  repeated KeyValueProto keyval = 1;
-}
-
 message FragmentProto {
   required string id = 1;
   required bytes contents = 2;

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-catalog/tajo-catalog-common/src/test/java/org/apache/tajo/catalog/TestKeyValueSet.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-common/src/test/java/org/apache/tajo/catalog/TestKeyValueSet.java b/tajo-catalog/tajo-catalog-common/src/test/java/org/apache/tajo/catalog/TestKeyValueSet.java
new file mode 100644
index 0000000..39d5fbe
--- /dev/null
+++ b/tajo-catalog/tajo-catalog-common/src/test/java/org/apache/tajo/catalog/TestKeyValueSet.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.tajo.catalog;
+
+import org.apache.tajo.rpc.protocolrecords.PrimitiveProtos;
+import org.apache.tajo.util.KeyValueSet;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+public class TestKeyValueSet {
+	@Test
+	public final void testPutAndGet() {
+		KeyValueSet opts = new KeyValueSet();
+		opts.put("name", "abc");
+		opts.put("delimiter", ",");
+		
+		assertEquals(",", opts.get("delimiter"));
+		assertEquals("abc", opts.get("name"));
+	}
+
+	@Test
+	public final void testGetProto() {		
+		KeyValueSet opts = new KeyValueSet();
+		opts.put("name", "abc");
+		opts.put("delimiter", ",");
+		
+		PrimitiveProtos.KeyValueSetProto proto = opts.getProto();
+		KeyValueSet opts2 = new KeyValueSet(proto);
+		
+		assertEquals(opts, opts2);
+	}
+	
+	@Test
+	public final void testDelete() {
+		KeyValueSet opts = new KeyValueSet();
+		opts.put("name", "abc");
+		opts.put("delimiter", ",");
+		
+		assertEquals("abc", opts.get("name"));
+		assertEquals("abc", opts.delete("name"));
+		assertNull(opts.get("name"));
+		
+		KeyValueSet opts2 = new KeyValueSet(opts.getProto());
+		assertNull(opts2.get("name"));
+	}
+}

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-catalog/tajo-catalog-common/src/test/java/org/apache/tajo/catalog/TestOptions.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-common/src/test/java/org/apache/tajo/catalog/TestOptions.java b/tajo-catalog/tajo-catalog-common/src/test/java/org/apache/tajo/catalog/TestOptions.java
deleted file mode 100644
index bcccfd3..0000000
--- a/tajo-catalog/tajo-catalog-common/src/test/java/org/apache/tajo/catalog/TestOptions.java
+++ /dev/null
@@ -1,63 +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.tajo.catalog;
-
-import org.junit.Test;
-import org.apache.tajo.catalog.proto.CatalogProtos.KeyValueSetProto;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
-public class TestOptions {
-	@Test
-	public final void testPutAndGet() {
-		Options opts = new Options();
-		opts.put("name", "abc");
-		opts.put("delimiter", ",");
-		
-		assertEquals(",", opts.get("delimiter"));
-		assertEquals("abc", opts.get("name"));
-	}
-
-	@Test
-	public final void testGetProto() {		
-		Options opts = new Options();
-		opts.put("name", "abc");
-		opts.put("delimiter", ",");
-		
-		KeyValueSetProto proto = opts.getProto();
-		Options opts2 = new Options(proto);
-		
-		assertEquals(opts, opts2);
-	}
-	
-	@Test
-	public final void testDelete() {
-		Options opts = new Options();
-		opts.put("name", "abc");
-		opts.put("delimiter", ",");
-		
-		assertEquals("abc", opts.get("name"));
-		assertEquals("abc", opts.delete("name"));
-		assertNull(opts.get("name"));
-		
-		Options opts2 = new Options(opts.getProto());
-		assertNull(opts2.get("name"));
-	}
-}

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/main/java/org/apache/tajo/catalog/store/HCatalogStore.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/main/java/org/apache/tajo/catalog/store/HCatalogStore.java b/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/main/java/org/apache/tajo/catalog/store/HCatalogStore.java
index e6f6acc..7a694fa 100644
--- a/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/main/java/org/apache/tajo/catalog/store/HCatalogStore.java
+++ b/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/main/java/org/apache/tajo/catalog/store/HCatalogStore.java
@@ -47,6 +47,7 @@ import org.apache.tajo.common.exception.NotImplementedException;
 import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.exception.InternalException;
 import org.apache.tajo.storage.StorageConstants;
+import org.apache.tajo.util.KeyValueSet;
 
 import java.io.IOException;
 import java.util.*;
@@ -108,7 +109,7 @@ public class HCatalogStore extends CatalogConstants implements CatalogStore {
     Path path = null;
     CatalogProtos.StoreType storeType = null;
     org.apache.tajo.catalog.Schema schema = null;
-    Options options = null;
+    KeyValueSet options = null;
     TableStats stats = null;
     PartitionMethodDesc partitions = null;
 
@@ -165,7 +166,7 @@ public class HCatalogStore extends CatalogConstants implements CatalogStore {
       }
 
       stats = new TableStats();
-      options = new Options();
+      options = new KeyValueSet();
       options.putAll(table.getParameters());
       Properties properties = table.getMetadata();
       if (properties != null) {

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/test/java/org/apache/tajo/catalog/store/TestHCatalogStore.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/test/java/org/apache/tajo/catalog/store/TestHCatalogStore.java b/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/test/java/org/apache/tajo/catalog/store/TestHCatalogStore.java
index 0cb4520..a862baf 100644
--- a/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/test/java/org/apache/tajo/catalog/store/TestHCatalogStore.java
+++ b/tajo-catalog/tajo-catalog-drivers/tajo-hcatalog/src/test/java/org/apache/tajo/catalog/store/TestHCatalogStore.java
@@ -24,13 +24,17 @@ import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hive.conf.HiveConf;
-import org.apache.tajo.catalog.*;
+import org.apache.tajo.catalog.CatalogUtil;
+import org.apache.tajo.catalog.Schema;
+import org.apache.tajo.catalog.TableDesc;
+import org.apache.tajo.catalog.TableMeta;
 import org.apache.tajo.catalog.partition.PartitionMethodDesc;
 import org.apache.tajo.catalog.proto.CatalogProtos;
 import org.apache.tajo.common.TajoDataTypes;
 import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.storage.StorageConstants;
 import org.apache.tajo.util.CommonTestingUtil;
+import org.apache.tajo.util.KeyValueSet;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -80,7 +84,7 @@ public class TestHCatalogStore {
 
   @Test
   public void testTableUsingTextFile() throws Exception {
-    TableMeta meta = new TableMeta(CatalogProtos.StoreType.CSV, new Options());
+    TableMeta meta = new TableMeta(CatalogProtos.StoreType.CSV, new KeyValueSet());
 
     org.apache.tajo.catalog.Schema schema = new org.apache.tajo.catalog.Schema();
     schema.addColumn("c_custkey", TajoDataTypes.Type.INT4);
@@ -112,7 +116,7 @@ public class TestHCatalogStore {
 
   @Test
   public void testTableUsingRCFileWithBinarySerde() throws Exception {
-    Options options = new Options();
+    KeyValueSet options = new KeyValueSet();
     options.put(StorageConstants.RCFILE_SERDE, StorageConstants.DEFAULT_BINARY_SERDE);
     TableMeta meta = new TableMeta(CatalogProtos.StoreType.RCFILE, options);
 
@@ -141,7 +145,7 @@ public class TestHCatalogStore {
 
   @Test
   public void testTableUsingRCFileWithTextSerde() throws Exception {
-    Options options = new Options();
+    KeyValueSet options = new KeyValueSet();
     options.put(StorageConstants.RCFILE_SERDE, StorageConstants.DEFAULT_TEXT_SERDE);
     TableMeta meta = new TableMeta(CatalogProtos.StoreType.RCFILE, options);
 
@@ -169,7 +173,7 @@ public class TestHCatalogStore {
 
   @Test
   public void testTableWithNullValue() throws Exception {
-    Options options = new Options();
+    KeyValueSet options = new KeyValueSet();
     options.put(StorageConstants.CSVFILE_DELIMITER, StringEscapeUtils.escapeJava("\u0001"));
     options.put(StorageConstants.CSVFILE_NULL, StringEscapeUtils.escapeJava("\\N"));
     TableMeta meta = new TableMeta(CatalogProtos.StoreType.CSV, options);
@@ -209,7 +213,7 @@ public class TestHCatalogStore {
 
   @Test
   public void testAddTableByPartition() throws Exception {
-    TableMeta meta = new TableMeta(CatalogProtos.StoreType.CSV, new Options());
+    TableMeta meta = new TableMeta(CatalogProtos.StoreType.CSV, new KeyValueSet());
 
     org.apache.tajo.catalog.Schema schema = new org.apache.tajo.catalog.Schema();
     schema.addColumn("n_name", TajoDataTypes.Type.TEXT);
@@ -254,7 +258,7 @@ public class TestHCatalogStore {
 
   @Test
   public void testGetAllTableNames() throws Exception{
-    TableMeta meta = new TableMeta(CatalogProtos.StoreType.CSV, new Options());
+    TableMeta meta = new TableMeta(CatalogProtos.StoreType.CSV, new KeyValueSet());
     org.apache.tajo.catalog.Schema schema = new org.apache.tajo.catalog.Schema();
     schema.addColumn("n_name", TajoDataTypes.Type.TEXT);
     schema.addColumn("n_regionkey", TajoDataTypes.Type.INT4);
@@ -282,7 +286,7 @@ public class TestHCatalogStore {
 
   @Test
   public void testDeleteTable() throws Exception {
-    TableMeta meta = new TableMeta(CatalogProtos.StoreType.CSV, new Options());
+    TableMeta meta = new TableMeta(CatalogProtos.StoreType.CSV, new KeyValueSet());
     org.apache.tajo.catalog.Schema schema = new org.apache.tajo.catalog.Schema();
     schema.addColumn("n_name", TajoDataTypes.Type.TEXT);
     schema.addColumn("n_regionkey", TajoDataTypes.Type.INT4);
@@ -304,7 +308,7 @@ public class TestHCatalogStore {
 
   @Test
   public void testTableUsingSequenceFileWithBinarySerde() throws Exception {
-    Options options = new Options();
+    KeyValueSet options = new KeyValueSet();
     options.put(StorageConstants.SEQUENCEFILE_SERDE, StorageConstants.DEFAULT_BINARY_SERDE);
     TableMeta meta = new TableMeta(CatalogProtos.StoreType.SEQUENCEFILE, options);
 
@@ -333,7 +337,7 @@ public class TestHCatalogStore {
 
   @Test
   public void testTableUsingSequenceFileWithTextSerde() throws Exception {
-    Options options = new Options();
+    KeyValueSet options = new KeyValueSet();
     options.put(StorageConstants.SEQUENCEFILE_SERDE, StorageConstants.DEFAULT_TEXT_SERDE);
     TableMeta meta = new TableMeta(CatalogProtos.StoreType.SEQUENCEFILE, options);
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/AbstractDBStore.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/AbstractDBStore.java b/tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/AbstractDBStore.java
index 234af19..0d22486 100644
--- a/tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/AbstractDBStore.java
+++ b/tajo-catalog/tajo-catalog-server/src/main/java/org/apache/tajo/catalog/store/AbstractDBStore.java
@@ -35,6 +35,7 @@ import org.apache.tajo.catalog.proto.CatalogProtos.*;
 import org.apache.tajo.common.TajoDataTypes.Type;
 import org.apache.tajo.exception.InternalException;
 import org.apache.tajo.exception.UnimplementedException;
+import org.apache.tajo.rpc.protocolrecords.PrimitiveProtos;
 import org.apache.tajo.util.FileUtil;
 import org.apache.tajo.util.Pair;
 
@@ -46,6 +47,8 @@ import java.sql.SQLException;
 import java.util.*;
 
 import static org.apache.tajo.catalog.proto.CatalogProtos.AlterTablespaceProto.AlterTablespaceCommand;
+import static org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.KeyValueProto;
+import static org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.KeyValueSetProto;
 
 public abstract class AbstractDBStore extends CatalogConstants implements CatalogStore {
   protected final Log LOG = LogFactory.getLog(getClass());
@@ -713,7 +716,7 @@ public abstract class AbstractDBStore extends CatalogConstants implements Catalo
         }
 
         pstmt = conn.prepareStatement(propSQL);
-        for (CatalogProtos.KeyValueProto entry : table.getMeta().getParams().getKeyvalList()) {
+        for (KeyValueProto entry : table.getMeta().getParams().getKeyvalList()) {
           pstmt.setInt(1, tableId);
           pstmt.setString(2, entry.getKey());
           pstmt.setString(3, entry.getValue());
@@ -1905,9 +1908,9 @@ public abstract class AbstractDBStore extends CatalogConstants implements Catalo
     return builder.build();
   }
 
-  private CatalogProtos.KeyValueSetProto resultToKeyValueSetProto(final ResultSet res) throws SQLException {
-    CatalogProtos.KeyValueSetProto.Builder setBuilder = CatalogProtos.KeyValueSetProto.newBuilder();
-    CatalogProtos.KeyValueProto.Builder builder = CatalogProtos.KeyValueProto.newBuilder();
+  private KeyValueSetProto resultToKeyValueSetProto(final ResultSet res) throws SQLException {
+    KeyValueSetProto.Builder setBuilder = KeyValueSetProto.newBuilder();
+    KeyValueProto.Builder builder = KeyValueProto.newBuilder();
     while (res.next()) {
       builder.setKey(res.getString("key_"));
       builder.setValue(res.getString("value_"));

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-catalog/tajo-catalog-server/src/test/java/org/apache/tajo/catalog/TestCatalog.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-server/src/test/java/org/apache/tajo/catalog/TestCatalog.java b/tajo-catalog/tajo-catalog-server/src/test/java/org/apache/tajo/catalog/TestCatalog.java
index 32ea83b..453a54d 100644
--- a/tajo-catalog/tajo-catalog-server/src/test/java/org/apache/tajo/catalog/TestCatalog.java
+++ b/tajo-catalog/tajo-catalog-server/src/test/java/org/apache/tajo/catalog/TestCatalog.java
@@ -35,6 +35,7 @@ import org.apache.tajo.common.TajoDataTypes;
 import org.apache.tajo.common.TajoDataTypes.Type;
 import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.util.CommonTestingUtil;
+import org.apache.tajo.util.KeyValueSet;
 import org.apache.tajo.util.TUtil;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
@@ -46,7 +47,6 @@ import java.util.*;
 import static org.apache.tajo.TajoConstants.DEFAULT_DATABASE_NAME;
 import static org.apache.tajo.catalog.CatalogConstants.CATALOG_URI;
 import static org.apache.tajo.catalog.proto.CatalogProtos.AlterTablespaceProto;
-import static org.apache.tajo.catalog.proto.CatalogProtos.AlterTablespaceProto.AlterTablespaceCommand;
 import static org.apache.tajo.catalog.proto.CatalogProtos.AlterTablespaceProto.AlterTablespaceType;
 import static org.apache.tajo.catalog.proto.CatalogProtos.AlterTablespaceProto.SetLocation;
 import static org.junit.Assert.*;
@@ -235,7 +235,7 @@ public class TestCatalog {
     TableDesc table = new TableDesc(
         CatalogUtil.buildFQName(databaseName, tableName),
         schema1,
-        new TableMeta(StoreType.CSV, new Options()),
+        new TableMeta(StoreType.CSV, new KeyValueSet()),
         path, true);
     return table;
   }
@@ -356,7 +356,7 @@ public class TestCatalog {
         CatalogUtil.buildFQName(DEFAULT_DATABASE_NAME, "getTable"),
         schema1,
         StoreType.CSV,
-        new Options(),
+        new KeyValueSet(),
         path);
 
 		assertFalse(catalog.existsTable(DEFAULT_DATABASE_NAME, "getTable"));
@@ -563,7 +563,7 @@ public class TestCatalog {
         .addColumn("score", Type.FLOAT8);
 
     String tableName = CatalogUtil.buildFQName(DEFAULT_DATABASE_NAME, "addedtable");
-    Options opts = new Options();
+    KeyValueSet opts = new KeyValueSet();
     opts.put("file.delimiter", ",");
     TableMeta meta = CatalogUtil.newTableMeta(StoreType.CSV, opts);
 
@@ -603,7 +603,7 @@ public class TestCatalog {
         .addColumn("score", Type.FLOAT8);
 
     String tableName = CatalogUtil.buildFQName(DEFAULT_DATABASE_NAME, "addedtable");
-    Options opts = new Options();
+    KeyValueSet opts = new KeyValueSet();
     opts.put("file.delimiter", ",");
     TableMeta meta = CatalogUtil.newTableMeta(StoreType.CSV, opts);
 
@@ -641,7 +641,7 @@ public class TestCatalog {
         .addColumn("score", Type.FLOAT8);
 
     String tableName = CatalogUtil.buildFQName(TajoConstants.DEFAULT_DATABASE_NAME, "addedtable");
-    Options opts = new Options();
+    KeyValueSet opts = new KeyValueSet();
     opts.put("file.delimiter", ",");
     TableMeta meta = CatalogUtil.newTableMeta(StoreType.CSV, opts);
 
@@ -678,7 +678,7 @@ public class TestCatalog {
         .addColumn("score", Type.FLOAT8);
 
     String tableName = CatalogUtil.buildFQName(TajoConstants.DEFAULT_DATABASE_NAME, "addedtable");
-    Options opts = new Options();
+    KeyValueSet opts = new KeyValueSet();
     opts.put("file.delimiter", ",");
     TableMeta meta = CatalogUtil.newTableMeta(StoreType.CSV, opts);
 
@@ -715,7 +715,7 @@ public class TestCatalog {
         .addColumn("score", Type.FLOAT8);
 
     String tableName = CatalogUtil.buildFQName(DEFAULT_DATABASE_NAME, "addedtable");
-    Options opts = new Options();
+    KeyValueSet opts = new KeyValueSet();
     opts.put("file.delimiter", ",");
     TableMeta meta = CatalogUtil.newTableMeta(StoreType.CSV, opts);
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-client/src/main/java/org/apache/tajo/client/TajoClient.java
----------------------------------------------------------------------
diff --git a/tajo-client/src/main/java/org/apache/tajo/client/TajoClient.java b/tajo-client/src/main/java/org/apache/tajo/client/TajoClient.java
index 3c85662..9662424 100644
--- a/tajo-client/src/main/java/org/apache/tajo/client/TajoClient.java
+++ b/tajo-client/src/main/java/org/apache/tajo/client/TajoClient.java
@@ -45,6 +45,7 @@ import org.apache.tajo.jdbc.TajoResultSet;
 import org.apache.tajo.rpc.NettyClientBase;
 import org.apache.tajo.rpc.RpcConnectionPool;
 import org.apache.tajo.rpc.ServerCallable;
+import org.apache.tajo.util.KeyValueSet;
 import org.apache.tajo.util.NetUtils;
 
 import java.io.Closeable;
@@ -227,11 +228,11 @@ public class TajoClient implements Closeable {
         checkSessionAndGet(client);
 
         TajoMasterClientProtocolService.BlockingInterface tajoMasterService = client.getStub();
-        Options options = new Options();
-        options.putAll(variables);
+        KeyValueSet keyValueSet = new KeyValueSet();
+        keyValueSet.putAll(variables);
         UpdateSessionVariableRequest request = UpdateSessionVariableRequest.newBuilder()
             .setSessionId(sessionId)
-            .setSetVariables(options.getProto()).build();
+            .setSetVariables(keyValueSet.getProto()).build();
 
         return tajoMasterService.updateSessionVariables(null, request).getValue();
       }
@@ -285,8 +286,8 @@ public class TajoClient implements Closeable {
         checkSessionAndGet(client);
 
         TajoMasterClientProtocolService.BlockingInterface tajoMasterService = client.getStub();
-        Options options = new Options(tajoMasterService.getAllSessionVariables(null, sessionId));
-        return options.getAllKeyValus();
+        KeyValueSet keyValueSet = new KeyValueSet(tajoMasterService.getAllSessionVariables(null, sessionId));
+        return keyValueSet.getAllKeyValus();
       }
     }.withRetries();
   }

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-common/src/main/java/org/apache/tajo/util/KeyValueSet.java
----------------------------------------------------------------------
diff --git a/tajo-common/src/main/java/org/apache/tajo/util/KeyValueSet.java b/tajo-common/src/main/java/org/apache/tajo/util/KeyValueSet.java
new file mode 100644
index 0000000..396c41e
--- /dev/null
+++ b/tajo-common/src/main/java/org/apache/tajo/util/KeyValueSet.java
@@ -0,0 +1,155 @@
+/**
+ * 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.tajo.util;
+
+import com.google.common.base.Objects;
+import com.google.gson.annotations.Expose;
+import org.apache.tajo.common.ProtoObject;
+import org.apache.tajo.json.CommonGsonHelper;
+import org.apache.tajo.json.GsonObject;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import static org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.KeyValueProto;
+import static org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.KeyValueSetProto;
+
+public class KeyValueSet implements ProtoObject<KeyValueSetProto>, Cloneable, GsonObject {
+	private KeyValueSetProto.Builder builder = KeyValueSetProto.newBuilder();
+	
+	@Expose private Map<String,String> keyVals;
+	
+	public KeyValueSet() {
+    keyVals = TUtil.newHashMap();
+	}
+	
+	public KeyValueSet(KeyValueSetProto proto) {
+    this.keyVals = TUtil.newHashMap();
+    for(KeyValueProto keyval : proto.getKeyvalList()) {
+      this.keyVals.put(keyval.getKey(), keyval.getValue());
+    }
+	}
+	
+	public KeyValueSet(KeyValueSet keyValueSet) {
+	  this();
+	  this.keyVals.putAll(keyValueSet.keyVals);
+	}
+	
+	public static KeyValueSet create() {
+	  return new KeyValueSet();
+	}
+	
+	public static KeyValueSet create(KeyValueSet keyValueSet) {
+    return new KeyValueSet(keyValueSet);
+  }
+
+  public int size() {
+    return keyVals.size();
+  }
+	
+	public void put(String key, String val) {
+		this.keyVals.put(key, val);
+	}
+
+  public void putAll(Map<String, String> keyValues) {
+    if (keyValues != null) {
+      this.keyVals.putAll(keyValues);
+    }
+  }
+	
+	public void putAll(KeyValueSet keyValueSet) {
+    if (keyValueSet != null) {
+	    this.keyVals.putAll(keyValueSet.keyVals);
+    }
+	}
+	
+	public String get(String key) {
+		return this.keyVals.get(key);
+	}
+	
+	public String get(String key, String defaultVal) {
+	  if(keyVals.containsKey(key))
+	    return keyVals.get(key);
+	  else {
+	    return defaultVal;
+	  }
+	}
+	
+	public Map<String,String> getAllKeyValus() {
+	  return keyVals;
+	}
+	
+	public String delete(String key) {
+		return keyVals.remove(key);
+	}
+
+  @Override
+  public int hashCode() {
+    return Objects.hashCode(keyVals);
+
+  }
+
+    @Override
+	public boolean equals(Object object) {
+		if(object instanceof KeyValueSet) {
+			KeyValueSet other = (KeyValueSet)object;
+			for(Entry<String, String> entry : other.keyVals.entrySet()) {
+				if(!keyVals.get(entry.getKey()).equals(entry.getValue()))
+					return false;
+			}
+			return true;
+		}
+		
+		return false;
+	}
+	
+	@Override
+  public Object clone() throws CloneNotSupportedException {    
+    KeyValueSet keyValueSet = (KeyValueSet) super.clone();
+    keyValueSet.builder = KeyValueSetProto.newBuilder();
+    keyValueSet.keyVals = keyVals != null ? new HashMap<String, String>(keyVals) : null;
+    return keyValueSet;
+	}
+	
+	@Override
+	public KeyValueSetProto getProto() {
+    if (builder == null) {
+      builder = KeyValueSetProto.newBuilder();
+    } else {
+      builder.clear();
+    }
+
+    KeyValueProto.Builder kvBuilder;
+    if(this.keyVals != null) {
+      for(Entry<String,String> kv : keyVals.entrySet()) {
+        kvBuilder = KeyValueProto.newBuilder();
+        kvBuilder.setKey(kv.getKey());
+
+        kvBuilder.setValue(kv.getValue());
+        builder.addKeyval(kvBuilder.build());
+      }
+    }
+    return builder.build();
+	}
+  
+  public String toJson() {
+    return CommonGsonHelper.toJson(this, KeyValueSet.class);
+  }
+}

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-common/src/main/proto/PrimitiveProtos.proto
----------------------------------------------------------------------
diff --git a/tajo-common/src/main/proto/PrimitiveProtos.proto b/tajo-common/src/main/proto/PrimitiveProtos.proto
index 820f96c..631916a 100644
--- a/tajo-common/src/main/proto/PrimitiveProtos.proto
+++ b/tajo-common/src/main/proto/PrimitiveProtos.proto
@@ -43,3 +43,12 @@ message NullProto {
 message StringListProto {
   repeated string values = 1;
 }
+
+message KeyValueProto {
+  required string key = 1;
+  required string value = 2;
+}
+
+message KeyValueSetProto {
+  repeated KeyValueProto keyval = 1;
+}

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanner.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanner.java b/tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanner.java
index 63ac515..52c9782 100644
--- a/tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanner.java
+++ b/tajo-core/src/main/java/org/apache/tajo/engine/planner/LogicalPlanner.java
@@ -43,6 +43,7 @@ import org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule;
 import org.apache.tajo.engine.utils.SchemaUtil;
 import org.apache.tajo.master.session.Session;
 import org.apache.tajo.storage.StorageUtil;
+import org.apache.tajo.util.KeyValueSet;
 import org.apache.tajo.util.TUtil;
 
 import java.util.*;
@@ -1282,7 +1283,7 @@ public class LogicalPlanner extends BaseAlgebraVisitor<LogicalPlanner.PlanContex
       insertNode.setStorageType(CatalogUtil.getStoreType(expr.getStorageType()));
     }
     if (expr.hasParams()) {
-      Options options = new Options();
+      KeyValueSet options = new KeyValueSet();
       options.putAll(expr.getParams());
       insertNode.setOptions(options);
     }
@@ -1332,12 +1333,12 @@ public class LogicalPlanner extends BaseAlgebraVisitor<LogicalPlanner.PlanContex
     }
 
     // Set default storage properties to be created.
-    Options options = StorageUtil.newPhysicalProperties(createTableNode.getStorageType());
+    KeyValueSet keyValueSet = StorageUtil.newPhysicalProperties(createTableNode.getStorageType());
     if (expr.hasParams()) {
-      options.putAll(expr.getParams());
+      keyValueSet.putAll(expr.getParams());
     }
 
-    createTableNode.setOptions(options);
+    createTableNode.setOptions(keyValueSet);
 
     if (expr.hasPartition()) {
       if (expr.getPartitionMethod().getPartitionType().equals(PartitionType.COLUMN)) {

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/GlobalPlanner.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/GlobalPlanner.java b/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/GlobalPlanner.java
index edc08fc..b411c6d 100644
--- a/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/GlobalPlanner.java
+++ b/tajo-core/src/main/java/org/apache/tajo/engine/planner/global/GlobalPlanner.java
@@ -40,6 +40,7 @@ import org.apache.tajo.engine.planner.*;
 import org.apache.tajo.engine.planner.logical.*;
 import org.apache.tajo.engine.planner.rewrite.ProjectionPushDownRule;
 import org.apache.tajo.exception.InternalException;
+import org.apache.tajo.util.KeyValueSet;
 import org.apache.tajo.util.TUtil;
 import org.apache.tajo.worker.TajoWorker;
 
@@ -153,7 +154,7 @@ public class GlobalPlanner {
     Preconditions.checkArgument(channel.getSchema() != null,
         "Channel schema (" + channel.getSrcId().getId() + " -> " + channel.getTargetId().getId() +
             ") is not initialized");
-    TableMeta meta = new TableMeta(channel.getStoreType(), new Options());
+    TableMeta meta = new TableMeta(channel.getStoreType(), new KeyValueSet());
     TableDesc desc = new TableDesc(channel.getSrcId().toString(), channel.getSchema(), meta, new Path("/"));
     ScanNode scanNode = plan.createNode(ScanNode.class);
     scanNode.init(desc);

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/CreateTableNode.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/CreateTableNode.java b/tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/CreateTableNode.java
index c70fb10..a39b391 100644
--- a/tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/CreateTableNode.java
+++ b/tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/CreateTableNode.java
@@ -21,7 +21,7 @@ package org.apache.tajo.engine.planner.logical;
 import com.google.common.base.Objects;
 import com.google.gson.annotations.Expose;
 import org.apache.hadoop.fs.Path;
-import org.apache.tajo.catalog.Options;
+import org.apache.tajo.util.KeyValueSet;
 import org.apache.tajo.catalog.Schema;
 import org.apache.tajo.engine.planner.PlanString;
 import org.apache.tajo.util.TUtil;
@@ -117,7 +117,7 @@ public class CreateTableNode extends StoreTableNode implements Cloneable {
     createTableNode.storageType = storageType;
     createTableNode.external = external;
     createTableNode.path = path != null ? new Path(path.toString()) : null;
-    createTableNode.options = (Options) (options != null ? options.clone() : null);
+    createTableNode.options = (KeyValueSet) (options != null ? options.clone() : null);
     createTableNode.ifNotExists = ifNotExists;
     return createTableNode;
   }

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/PersistentStoreNode.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/PersistentStoreNode.java b/tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/PersistentStoreNode.java
index 9d2acf6..8d1d90f 100644
--- a/tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/PersistentStoreNode.java
+++ b/tajo-core/src/main/java/org/apache/tajo/engine/planner/logical/PersistentStoreNode.java
@@ -20,7 +20,7 @@ package org.apache.tajo.engine.planner.logical;
 
 
 import com.google.gson.annotations.Expose;
-import org.apache.tajo.catalog.Options;
+import org.apache.tajo.util.KeyValueSet;
 import org.apache.tajo.engine.planner.PlanString;
 import org.apache.tajo.util.TUtil;
 
@@ -33,7 +33,7 @@ import static org.apache.tajo.catalog.proto.CatalogProtos.StoreType;
  */
 public abstract class PersistentStoreNode extends UnaryNode implements Cloneable {
   @Expose protected StoreType storageType = StoreType.CSV;
-  @Expose protected Options options;
+  @Expose protected KeyValueSet options;
 
   protected PersistentStoreNode(int pid, NodeType nodeType) {
     super(pid, nodeType);
@@ -51,11 +51,11 @@ public abstract class PersistentStoreNode extends UnaryNode implements Cloneable
     return this.options != null;
   }
 
-  public Options getOptions() {
+  public KeyValueSet getOptions() {
     return this.options;
   }
 
-  public void setOptions(Options options) {
+  public void setOptions(KeyValueSet options) {
     this.options = options;
   }
 
@@ -84,7 +84,7 @@ public abstract class PersistentStoreNode extends UnaryNode implements Cloneable
   public Object clone() throws CloneNotSupportedException {
     PersistentStoreNode store = (PersistentStoreNode) super.clone();
     store.storageType = storageType != null ? storageType : null;
-    store.options = options != null ? (Options) options.clone() : null;
+    store.options = options != null ? (KeyValueSet) options.clone() : null;
     return store;
   }
 }

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-core/src/main/java/org/apache/tajo/engine/query/QueryContext.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/engine/query/QueryContext.java b/tajo-core/src/main/java/org/apache/tajo/engine/query/QueryContext.java
index 44c4ddc..79d6cb3 100644
--- a/tajo-core/src/main/java/org/apache/tajo/engine/query/QueryContext.java
+++ b/tajo-core/src/main/java/org/apache/tajo/engine/query/QueryContext.java
@@ -19,14 +19,14 @@
 package org.apache.tajo.engine.query;
 
 import org.apache.hadoop.fs.Path;
-import org.apache.tajo.catalog.Options;
+import org.apache.tajo.util.KeyValueSet;
 import org.apache.tajo.catalog.partition.PartitionMethodDesc;
 import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.engine.planner.logical.NodeType;
 
-import static org.apache.tajo.catalog.proto.CatalogProtos.KeyValueSetProto;
+import static org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.KeyValueSetProto;
 
-public class QueryContext extends Options {
+public class QueryContext extends KeyValueSet {
   public static final String COMMAND_TYPE = "tajo.query.command";
 
   public static final String STAGING_DIR = "tajo.query.staging_dir";

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-core/src/main/java/org/apache/tajo/master/TajoMasterClientService.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/master/TajoMasterClientService.java b/tajo-core/src/main/java/org/apache/tajo/master/TajoMasterClientService.java
index c6facb1..8c16879 100644
--- a/tajo-core/src/main/java/org/apache/tajo/master/TajoMasterClientService.java
+++ b/tajo-core/src/main/java/org/apache/tajo/master/TajoMasterClientService.java
@@ -52,6 +52,7 @@ import org.apache.tajo.rpc.BlockingRpcServer;
 import org.apache.tajo.rpc.protocolrecords.PrimitiveProtos;
 import org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.BoolProto;
 import org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.StringProto;
+import org.apache.tajo.util.KeyValueSet;
 import org.apache.tajo.util.NetUtils;
 import org.apache.tajo.util.ProtoUtil;
 
@@ -60,6 +61,8 @@ import java.net.InetSocketAddress;
 import java.util.*;
 
 import static org.apache.tajo.TajoConstants.DEFAULT_DATABASE_NAME;
+import static org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.KeyValueProto;
+import static org.apache.tajo.rpc.protocolrecords.PrimitiveProtos.KeyValueSetProto;
 
 public class TajoMasterClientService extends AbstractService {
   private final static Log LOG = LogFactory.getLog(TajoMasterClientService.class);
@@ -165,7 +168,7 @@ public class TajoMasterClientService extends AbstractService {
         throws ServiceException {
       try {
         String sessionId = request.getSessionId().getId();
-        for (CatalogProtos.KeyValueProto kv : request.getSetVariables().getKeyvalList()) {
+        for (KeyValueProto kv : request.getSetVariables().getKeyvalList()) {
           context.getSessionManager().setVariable(sessionId, kv.getKey(), kv.getValue());
         }
         for (String unsetVariable : request.getUnsetVariablesList()) {
@@ -206,14 +209,14 @@ public class TajoMasterClientService extends AbstractService {
     }
 
     @Override
-    public CatalogProtos.KeyValueSetProto getAllSessionVariables(RpcController controller,
+    public KeyValueSetProto getAllSessionVariables(RpcController controller,
                                                                  TajoIdProtos.SessionIdProto request)
         throws ServiceException {
       try {
         String sessionId = request.getId();
-        Options options = new Options();
-        options.putAll(context.getSessionManager().getAllVariables(sessionId));
-        return options.getProto();
+        KeyValueSet keyValueSet = new KeyValueSet();
+        keyValueSet.putAll(context.getSessionManager().getAllVariables(sessionId));
+        return keyValueSet.getProto();
       } catch (Throwable t) {
         throw new ServiceException(t);
       }

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-core/src/main/java/org/apache/tajo/master/querymaster/SubQuery.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/master/querymaster/SubQuery.java b/tajo-core/src/main/java/org/apache/tajo/master/querymaster/SubQuery.java
index 921bb3a..08517ef 100644
--- a/tajo-core/src/main/java/org/apache/tajo/master/querymaster/SubQuery.java
+++ b/tajo-core/src/main/java/org/apache/tajo/master/querymaster/SubQuery.java
@@ -56,6 +56,7 @@ import org.apache.tajo.master.event.*;
 import org.apache.tajo.master.event.QueryUnitAttemptScheduleEvent.QueryUnitAttemptScheduleContext;
 import org.apache.tajo.storage.AbstractStorageManager;
 import org.apache.tajo.storage.fragment.FileFragment;
+import org.apache.tajo.util.KeyValueSet;
 import org.apache.tajo.worker.FetchImpl;
 
 import java.io.IOException;
@@ -576,7 +577,7 @@ public class SubQuery implements EventHandler<SubQueryEvent> {
       storeType = storeTableNode.getStorageType();
     }
     schema = channel.getSchema();
-    meta = CatalogUtil.newTableMeta(storeType, new Options());
+    meta = CatalogUtil.newTableMeta(storeType, new KeyValueSet());
     inputStatistics = statsArray[0];
     resultStatistics = statsArray[1];
   }

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-core/src/main/java/org/apache/tajo/master/session/Session.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/main/java/org/apache/tajo/master/session/Session.java b/tajo-core/src/main/java/org/apache/tajo/master/session/Session.java
index 4d244bf..c60f50f 100644
--- a/tajo-core/src/main/java/org/apache/tajo/master/session/Session.java
+++ b/tajo-core/src/main/java/org/apache/tajo/master/session/Session.java
@@ -19,7 +19,7 @@
 package org.apache.tajo.master.session;
 
 import com.google.common.collect.ImmutableMap;
-import org.apache.tajo.catalog.Options;
+import org.apache.tajo.util.KeyValueSet;
 import org.apache.tajo.common.ProtoObject;
 
 import java.util.HashMap;
@@ -49,8 +49,8 @@ public class Session implements SessionConstants, ProtoObject<SessionProto> {
     userName = proto.getUsername();
     currentDatabase = proto.getCurrentDatabase();
     lastAccessTime = proto.getLastAccessTime();
-    Options options = new Options(proto.getVariables());
-    sessionVariables = options.getAllKeyValus();
+    KeyValueSet keyValueSet = new KeyValueSet(proto.getVariables());
+    sessionVariables = keyValueSet.getAllKeyValus();
   }
 
   public String getSessionId() {
@@ -112,7 +112,7 @@ public class Session implements SessionConstants, ProtoObject<SessionProto> {
     builder.setUsername(userName);
     builder.setCurrentDatabase(currentDatabase);
     builder.setLastAccessTime(lastAccessTime);
-    Options variables = new Options();
+    KeyValueSet variables = new KeyValueSet();
     variables.putAll(this.sessionVariables);
     builder.setVariables(variables.getProto());
     return builder.build();

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-core/src/test/java/org/apache/tajo/LocalTajoTestingUtility.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/LocalTajoTestingUtility.java b/tajo-core/src/test/java/org/apache/tajo/LocalTajoTestingUtility.java
index e651313..84522e1 100644
--- a/tajo-core/src/test/java/org/apache/tajo/LocalTajoTestingUtility.java
+++ b/tajo-core/src/test/java/org/apache/tajo/LocalTajoTestingUtility.java
@@ -32,6 +32,7 @@ import org.apache.tajo.client.TajoClient;
 import org.apache.tajo.conf.TajoConf;
 import org.apache.tajo.engine.planner.global.MasterPlan;
 import org.apache.tajo.master.session.Session;
+import org.apache.tajo.util.KeyValueSet;
 import org.apache.tajo.util.TajoIdUtils;
 
 import java.io.IOException;
@@ -79,7 +80,7 @@ public class LocalTajoTestingUtility {
   public void setup(String[] names,
                     String[] tablepaths,
                     Schema[] schemas,
-                    Options option) throws Exception {
+                    KeyValueSet option) throws Exception {
     LOG.info("===================================================");
     LOG.info("Starting Test Cluster.");
     LOG.info("===================================================");

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-core/src/test/java/org/apache/tajo/TajoTestingCluster.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/TajoTestingCluster.java b/tajo-core/src/test/java/org/apache/tajo/TajoTestingCluster.java
index 010faa8..011ed07 100644
--- a/tajo-core/src/test/java/org/apache/tajo/TajoTestingCluster.java
+++ b/tajo-core/src/test/java/org/apache/tajo/TajoTestingCluster.java
@@ -33,7 +33,7 @@ import org.apache.hadoop.util.ShutdownHookManager;
 import org.apache.hadoop.yarn.conf.YarnConfiguration;
 import org.apache.hadoop.yarn.server.resourcemanager.ResourceManager;
 import org.apache.tajo.catalog.*;
-import org.apache.tajo.catalog.Options;
+import org.apache.tajo.util.KeyValueSet;
 import org.apache.tajo.catalog.proto.CatalogProtos;
 import org.apache.tajo.client.TajoClient;
 import org.apache.tajo.conf.TajoConf;
@@ -560,7 +560,7 @@ public class TajoTestingCluster {
 
   public static ResultSet run(String[] names,
                               Schema[] schemas,
-                              Options option,
+                              KeyValueSet option,
                               String[][] tables,
                               String query) throws Exception {
     TpchTestBase instance = TpchTestBase.getInstance();

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-core/src/test/java/org/apache/tajo/TpchTestBase.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/TpchTestBase.java b/tajo-core/src/test/java/org/apache/tajo/TpchTestBase.java
index 8995d81..5ed8821 100644
--- a/tajo-core/src/test/java/org/apache/tajo/TpchTestBase.java
+++ b/tajo-core/src/test/java/org/apache/tajo/TpchTestBase.java
@@ -22,7 +22,7 @@ import com.google.common.collect.Maps;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.tajo.benchmark.TPCH;
-import org.apache.tajo.catalog.Options;
+import org.apache.tajo.util.KeyValueSet;
 import org.apache.tajo.catalog.Schema;
 import org.apache.tajo.storage.StorageConstants;
 import org.apache.tajo.util.FileUtil;
@@ -90,7 +90,7 @@ public class TpchTestBase {
 
   private void setUp() throws Exception {
     util = new LocalTajoTestingUtility();
-    Options opt = new Options();
+    KeyValueSet opt = new KeyValueSet();
     opt.put(StorageConstants.CSVFILE_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
     util.setup(names, paths, schemas, opt);
   }

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-core/src/test/java/org/apache/tajo/engine/eval/ExprTestBase.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/eval/ExprTestBase.java b/tajo-core/src/test/java/org/apache/tajo/engine/eval/ExprTestBase.java
index d19b4d6..979bee2 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/eval/ExprTestBase.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/eval/ExprTestBase.java
@@ -39,6 +39,7 @@ import org.apache.tajo.storage.Tuple;
 import org.apache.tajo.storage.VTuple;
 import org.apache.tajo.util.Bytes;
 import org.apache.tajo.util.CommonTestingUtil;
+import org.apache.tajo.util.KeyValueSet;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 
@@ -174,7 +175,7 @@ public class ExprTestBase {
         }
       }
       cat.createTable(new TableDesc(qualifiedTableName, inputSchema,
-          CatalogProtos.StoreType.CSV, new Options(), CommonTestingUtil.getTestDir()));
+          CatalogProtos.StoreType.CSV, new KeyValueSet(), CommonTestingUtil.getTestDir()));
     }
 
     Target [] targets;

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestLogicalOptimizer.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestLogicalOptimizer.java b/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestLogicalOptimizer.java
index 5acd512..773382d 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestLogicalOptimizer.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestLogicalOptimizer.java
@@ -32,6 +32,7 @@ import org.apache.tajo.engine.planner.logical.*;
 import org.apache.tajo.master.TajoMaster;
 import org.apache.tajo.master.session.Session;
 import org.apache.tajo.util.CommonTestingUtil;
+import org.apache.tajo.util.KeyValueSet;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -82,13 +83,13 @@ public class TestLogicalOptimizer {
 
     TableDesc student =
         new TableDesc(
-            CatalogUtil.buildFQName(DEFAULT_DATABASE_NAME, "dept"), schema2, StoreType.CSV, new Options(),
+            CatalogUtil.buildFQName(DEFAULT_DATABASE_NAME, "dept"), schema2, StoreType.CSV, new KeyValueSet(),
             CommonTestingUtil.getTestDir());
     catalog.createTable(student);
 
     TableDesc score =
         new TableDesc(
-            CatalogUtil.buildFQName(DEFAULT_DATABASE_NAME, "score"), schema3, StoreType.CSV, new Options(),
+            CatalogUtil.buildFQName(DEFAULT_DATABASE_NAME, "score"), schema3, StoreType.CSV, new KeyValueSet(),
             CommonTestingUtil.getTestDir());
     catalog.createTable(score);
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestLogicalPlanner.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestLogicalPlanner.java b/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestLogicalPlanner.java
index b586f56..6d0f7e0 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestLogicalPlanner.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestLogicalPlanner.java
@@ -41,6 +41,7 @@ import org.apache.tajo.master.TajoMaster;
 import org.apache.tajo.master.session.Session;
 import org.apache.tajo.util.CommonTestingUtil;
 import org.apache.tajo.util.FileUtil;
+import org.apache.tajo.util.KeyValueSet;
 import org.apache.tajo.util.TUtil;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
@@ -95,12 +96,12 @@ public class TestLogicalPlanner {
     catalog.createTable(people);
 
     TableDesc student = new TableDesc(
-        CatalogUtil.buildFQName(DEFAULT_DATABASE_NAME, "dept"), schema2, StoreType.CSV, new Options(),
+        CatalogUtil.buildFQName(DEFAULT_DATABASE_NAME, "dept"), schema2, StoreType.CSV, new KeyValueSet(),
         CommonTestingUtil.getTestDir());
     catalog.createTable(student);
 
     TableDesc score = new TableDesc(
-        CatalogUtil.buildFQName(DEFAULT_DATABASE_NAME, "score"), schema3, StoreType.CSV, new Options(),
+        CatalogUtil.buildFQName(DEFAULT_DATABASE_NAME, "score"), schema3, StoreType.CSV, new KeyValueSet(),
         CommonTestingUtil.getTestDir());
     catalog.createTable(score);
 

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestPlannerUtil.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestPlannerUtil.java b/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestPlannerUtil.java
index be4c133..82e7818 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestPlannerUtil.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/planner/TestPlannerUtil.java
@@ -36,6 +36,7 @@ import org.apache.tajo.storage.Tuple;
 import org.apache.tajo.storage.TupleComparator;
 import org.apache.tajo.storage.VTuple;
 import org.apache.tajo.util.CommonTestingUtil;
+import org.apache.tajo.util.KeyValueSet;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -83,13 +84,13 @@ public class TestPlannerUtil {
     TableDesc student =
         new TableDesc(
             CatalogUtil.buildFQName(DEFAULT_DATABASE_NAME, "dept"), schema2, StoreType.CSV,
-            new Options(), CommonTestingUtil.getTestDir());
+            new KeyValueSet(), CommonTestingUtil.getTestDir());
     catalog.createTable(student);
 
     TableDesc score =
         new TableDesc(
             CatalogUtil.buildFQName(DEFAULT_DATABASE_NAME, "score"), schema3, StoreType.CSV,
-            new Options(), CommonTestingUtil.getTestDir());
+            new KeyValueSet(), CommonTestingUtil.getTestDir());
     catalog.createTable(score);
 
     FunctionDesc funcDesc = new FunctionDesc("sumtest", SumInt.class, FunctionType.AGGREGATION,

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestPhysicalPlanner.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestPhysicalPlanner.java b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestPhysicalPlanner.java
index cee0cb0..50a0f44 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestPhysicalPlanner.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/planner/physical/TestPhysicalPlanner.java
@@ -52,6 +52,7 @@ import org.apache.tajo.storage.RowStoreUtil.RowStoreEncoder;
 import org.apache.tajo.storage.fragment.FileFragment;
 import org.apache.tajo.storage.index.bst.BSTIndex;
 import org.apache.tajo.util.CommonTestingUtil;
+import org.apache.tajo.util.KeyValueSet;
 import org.apache.tajo.util.TUtil;
 import org.apache.tajo.worker.RangeRetrieverHandler;
 import org.apache.tajo.worker.TaskAttemptContext;
@@ -137,7 +138,7 @@ public class TestPhysicalPlanner {
     catalog.createTable(employee);
 
     Path scorePath = new Path(testDir, "score");
-    TableMeta scoreMeta = CatalogUtil.newTableMeta(StoreType.CSV, new Options());
+    TableMeta scoreMeta = CatalogUtil.newTableMeta(StoreType.CSV, new KeyValueSet());
     appender = StorageManagerFactory.getStorageManager(conf).getAppender(scoreMeta, scoreSchema, scorePath);
     appender.init();
     score = new TableDesc(
@@ -869,7 +870,7 @@ public class TestPhysicalPlanner {
         keySchema, comp);
     reader.open();
     Path outputPath = StorageUtil.concatPath(workDir, "output", "output");
-    TableMeta meta = CatalogUtil.newTableMeta(channel.getStoreType(), new Options());
+    TableMeta meta = CatalogUtil.newTableMeta(channel.getStoreType(), new KeyValueSet());
     SeekableScanner scanner =
         StorageManagerFactory.getSeekableScanner(conf, meta, exec.getSchema(), outputPath);
     scanner.init();

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-core/src/test/java/org/apache/tajo/engine/query/TestCTASQuery.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/query/TestCTASQuery.java b/tajo-core/src/test/java/org/apache/tajo/engine/query/TestCTASQuery.java
index a4e31e0..c2db595 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/query/TestCTASQuery.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/query/TestCTASQuery.java
@@ -28,7 +28,7 @@ import org.apache.tajo.TajoConstants;
 import org.apache.tajo.TajoTestingCluster;
 import org.apache.tajo.catalog.CatalogService;
 import org.apache.tajo.catalog.CatalogUtil;
-import org.apache.tajo.catalog.Options;
+import org.apache.tajo.util.KeyValueSet;
 import org.apache.tajo.catalog.TableDesc;
 import org.apache.tajo.catalog.partition.PartitionMethodDesc;
 import org.apache.tajo.catalog.proto.CatalogProtos;
@@ -209,7 +209,7 @@ public class TestCTASQuery extends QueryTestCaseBase {
     assertEquals(CatalogProtos.StoreType.CSV, desc.getMeta().getStoreType());
 
 
-    Options options = desc.getMeta().getOptions();
+    KeyValueSet options = desc.getMeta().getOptions();
     assertNotNull(options);
     assertEquals(StringEscapeUtils.escapeJava("\u0001"), options.get(StorageConstants.CSVFILE_DELIMITER));
   }

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-core/src/test/java/org/apache/tajo/engine/query/TestNullValues.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/engine/query/TestNullValues.java b/tajo-core/src/test/java/org/apache/tajo/engine/query/TestNullValues.java
index c5afc3d..e288066 100644
--- a/tajo-core/src/test/java/org/apache/tajo/engine/query/TestNullValues.java
+++ b/tajo-core/src/test/java/org/apache/tajo/engine/query/TestNullValues.java
@@ -20,7 +20,7 @@ package org.apache.tajo.engine.query;
 
 import org.apache.tajo.IntegrationTest;
 import org.apache.tajo.TajoTestingCluster;
-import org.apache.tajo.catalog.Options;
+import org.apache.tajo.util.KeyValueSet;
 import org.apache.tajo.catalog.Schema;
 import org.apache.tajo.common.TajoDataTypes.Type;
 import org.apache.tajo.storage.StorageConstants;
@@ -51,7 +51,7 @@ public class TestNullValues {
         "2||",
         "3|filled|0.2"
     };
-    Options opts = new Options();
+    KeyValueSet opts = new KeyValueSet();
     opts.put(StorageConstants.CSVFILE_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
     ResultSet res = TajoTestingCluster
         .run(table, schemas, opts, new String[][]{data},
@@ -77,7 +77,7 @@ public class TestNullValues {
         "||",
         "3|filled|"
     };
-    Options opts = new Options();
+    KeyValueSet opts = new KeyValueSet();
     opts.put(StorageConstants.CSVFILE_DELIMITER, StorageConstants.DEFAULT_FIELD_DELIMITER);
     ResultSet res = TajoTestingCluster
         .run(table, schemas, opts, new String[][]{data},
@@ -112,7 +112,7 @@ public class TestNullValues {
         ",,,,672287821,1301460,1,313895860387,126288907,1024",
         ",,,43578,19,13,6,3581,2557,1024"
     };
-    Options opts = new Options();
+    KeyValueSet opts = new KeyValueSet();
     opts.put(StorageConstants.CSVFILE_DELIMITER, ",");
     ResultSet res = TajoTestingCluster
         .run(table, schemas, opts, new String[][]{data},
@@ -145,7 +145,7 @@ public class TestNullValues {
         "\\N,,,,672287821,",
         ",\\N,,43578"
     };
-    Options opts = new Options();
+    KeyValueSet opts = new KeyValueSet();
     opts.put(StorageConstants.CSVFILE_DELIMITER, ",");
     opts.put(StorageConstants.CSVFILE_NULL, "\\\\N");
     ResultSet res = TajoTestingCluster

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-core/src/test/java/org/apache/tajo/worker/TestRangeRetrieverHandler.java
----------------------------------------------------------------------
diff --git a/tajo-core/src/test/java/org/apache/tajo/worker/TestRangeRetrieverHandler.java b/tajo-core/src/test/java/org/apache/tajo/worker/TestRangeRetrieverHandler.java
index 686aa9c..b904bb1 100644
--- a/tajo-core/src/test/java/org/apache/tajo/worker/TestRangeRetrieverHandler.java
+++ b/tajo-core/src/test/java/org/apache/tajo/worker/TestRangeRetrieverHandler.java
@@ -46,6 +46,7 @@ import org.apache.tajo.storage.RowStoreUtil.RowStoreEncoder;
 import org.apache.tajo.storage.fragment.FileFragment;
 import org.apache.tajo.storage.index.bst.BSTIndex;
 import org.apache.tajo.util.CommonTestingUtil;
+import org.apache.tajo.util.KeyValueSet;
 import org.apache.tajo.worker.dataserver.retriever.FileChunk;
 import org.junit.After;
 import org.junit.Before;
@@ -177,7 +178,7 @@ public class TestRangeRetrieverHandler {
         new Path(testDir, "output/index"), keySchema, comp);
     reader.open();
 
-    TableMeta meta = CatalogUtil.newTableMeta(StoreType.RAW, new Options());
+    TableMeta meta = CatalogUtil.newTableMeta(StoreType.RAW, new KeyValueSet());
     SeekableScanner scanner = StorageManagerFactory.getSeekableScanner(conf, meta, schema,
         StorageUtil.concatPath(testDir, "output", "output"));
 
@@ -299,7 +300,7 @@ public class TestRangeRetrieverHandler {
     BSTIndex.BSTIndexReader reader = bst.getIndexReader(
         new Path(testDir, "output/index"), keySchema, comp);
     reader.open();
-    TableMeta outputMeta = CatalogUtil.newTableMeta(StoreType.RAW, new Options());
+    TableMeta outputMeta = CatalogUtil.newTableMeta(StoreType.RAW, new KeyValueSet());
     SeekableScanner scanner = StorageManagerFactory.getSeekableScanner(conf, outputMeta, schema,
         StorageUtil.concatPath(testDir, "output", "output"));
     scanner.init();

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-storage/src/main/java/org/apache/tajo/storage/StorageUtil.java
----------------------------------------------------------------------
diff --git a/tajo-storage/src/main/java/org/apache/tajo/storage/StorageUtil.java b/tajo-storage/src/main/java/org/apache/tajo/storage/StorageUtil.java
index 2acae5a..c4a9744 100644
--- a/tajo-storage/src/main/java/org/apache/tajo/storage/StorageUtil.java
+++ b/tajo-storage/src/main/java/org/apache/tajo/storage/StorageUtil.java
@@ -25,6 +25,7 @@ import org.apache.hadoop.fs.Path;
 import org.apache.tajo.catalog.*;
 import org.apache.tajo.catalog.proto.CatalogProtos;
 import org.apache.tajo.util.FileUtil;
+import org.apache.tajo.util.KeyValueSet;
 import parquet.hadoop.ParquetOutputFormat;
 
 import java.io.IOException;
@@ -100,8 +101,8 @@ public class StorageUtil extends StorageConstants{
     return new Path(parent, sb.toString());
   }
 
-  public static Options newPhysicalProperties(CatalogProtos.StoreType type) {
-    Options options = new Options();
+  public static KeyValueSet newPhysicalProperties(CatalogProtos.StoreType type) {
+    KeyValueSet options = new KeyValueSet();
     if (CatalogProtos.StoreType.CSV == type) {
       options.put(CSVFILE_DELIMITER, DEFAULT_FIELD_DELIMITER);
     } else if (CatalogProtos.StoreType.RCFILE == type) {

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-storage/src/test/java/org/apache/tajo/storage/TestMergeScanner.java
----------------------------------------------------------------------
diff --git a/tajo-storage/src/test/java/org/apache/tajo/storage/TestMergeScanner.java b/tajo-storage/src/test/java/org/apache/tajo/storage/TestMergeScanner.java
index 5a4b092..8c92eaf 100644
--- a/tajo-storage/src/test/java/org/apache/tajo/storage/TestMergeScanner.java
+++ b/tajo-storage/src/test/java/org/apache/tajo/storage/TestMergeScanner.java
@@ -22,7 +22,7 @@ import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.tajo.catalog.CatalogUtil;
-import org.apache.tajo.catalog.Options;
+import org.apache.tajo.util.KeyValueSet;
 import org.apache.tajo.catalog.Schema;
 import org.apache.tajo.catalog.TableMeta;
 import org.apache.tajo.catalog.proto.CatalogProtos.StoreType;
@@ -106,7 +106,7 @@ public class TestMergeScanner {
     schema.addColumn("name", Type.TEXT);
     schema.addColumn("age", Type.INT8);
 
-    Options options = new Options();
+    KeyValueSet options = new KeyValueSet();
     TableMeta meta = CatalogUtil.newTableMeta(storeType, options);
     meta.setOptions(StorageUtil.newPhysicalProperties(storeType));
     if (storeType == StoreType.AVRO) {

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-storage/src/test/java/org/apache/tajo/storage/TestStorages.java
----------------------------------------------------------------------
diff --git a/tajo-storage/src/test/java/org/apache/tajo/storage/TestStorages.java b/tajo-storage/src/test/java/org/apache/tajo/storage/TestStorages.java
index 58508dd..0b764cc 100644
--- a/tajo-storage/src/test/java/org/apache/tajo/storage/TestStorages.java
+++ b/tajo-storage/src/test/java/org/apache/tajo/storage/TestStorages.java
@@ -36,6 +36,7 @@ import org.apache.tajo.storage.fragment.FileFragment;
 import org.apache.tajo.storage.rcfile.RCFile;
 import org.apache.tajo.util.CommonTestingUtil;
 import org.apache.tajo.util.FileUtil;
+import org.apache.tajo.util.KeyValueSet;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
@@ -247,7 +248,7 @@ public class TestStorages {
     schema.addColumn("col12", Type.NULL_TYPE);
     schema.addColumn("col13", CatalogUtil.newDataType(Type.PROTOBUF, TajoIdProtos.QueryIdProto.class.getName()));
 
-    Options options = new Options();
+    KeyValueSet options = new KeyValueSet();
     TableMeta meta = CatalogUtil.newTableMeta(storeType, options);
     meta.setOptions(StorageUtil.newPhysicalProperties(storeType));
     if (storeType == StoreType.AVRO) {
@@ -313,7 +314,7 @@ public class TestStorages {
     schema.addColumn("col12", Type.NULL_TYPE);
     schema.addColumn("col13", CatalogUtil.newDataType(Type.PROTOBUF, TajoIdProtos.QueryIdProto.class.getName()));
 
-    Options options = new Options();
+    KeyValueSet options = new KeyValueSet();
     TableMeta meta = CatalogUtil.newTableMeta(storeType, options);
     meta.setOptions(StorageUtil.newPhysicalProperties(storeType));
     meta.putOption(StorageConstants.CSVFILE_NULL, "\\\\N");
@@ -406,7 +407,7 @@ public class TestStorages {
     schema.addColumn("col12", Type.NULL_TYPE);
     schema.addColumn("col13", CatalogUtil.newDataType(Type.PROTOBUF, TajoIdProtos.QueryIdProto.class.getName()));
 
-    Options options = new Options();
+    KeyValueSet options = new KeyValueSet();
     TableMeta meta = CatalogUtil.newTableMeta(storeType, options);
     meta.putOption(StorageConstants.CSVFILE_SERDE, TextSerializerDeserializer.class.getName());
 
@@ -475,7 +476,7 @@ public class TestStorages {
     schema.addColumn("col12", Type.NULL_TYPE);
     schema.addColumn("col13", CatalogUtil.newDataType(Type.PROTOBUF, TajoIdProtos.QueryIdProto.class.getName()));
 
-    Options options = new Options();
+    KeyValueSet options = new KeyValueSet();
     TableMeta meta = CatalogUtil.newTableMeta(storeType, options);
     meta.putOption(StorageConstants.RCFILE_SERDE, BinarySerializerDeserializer.class.getName());
 
@@ -544,7 +545,7 @@ public class TestStorages {
     schema.addColumn("col12", Type.NULL_TYPE);
     schema.addColumn("col13", CatalogUtil.newDataType(Type.PROTOBUF, TajoIdProtos.QueryIdProto.class.getName()));
 
-    Options options = new Options();
+    KeyValueSet options = new KeyValueSet();
     TableMeta meta = CatalogUtil.newTableMeta(storeType, options);
     meta.putOption(StorageConstants.SEQUENCEFILE_SERDE, TextSerializerDeserializer.class.getName());
 
@@ -613,7 +614,7 @@ public class TestStorages {
     schema.addColumn("col12", Type.NULL_TYPE);
     schema.addColumn("col13", CatalogUtil.newDataType(Type.PROTOBUF, TajoIdProtos.QueryIdProto.class.getName()));
 
-    Options options = new Options();
+    KeyValueSet options = new KeyValueSet();
     TableMeta meta = CatalogUtil.newTableMeta(storeType, options);
     meta.putOption(StorageConstants.SEQUENCEFILE_SERDE, BinarySerializerDeserializer.class.getName());
 
@@ -671,7 +672,7 @@ public class TestStorages {
       schema.addColumn("col2", Type.TIME);
       schema.addColumn("col3", Type.TIMESTAMP);
 
-      Options options = new Options();
+      KeyValueSet options = new KeyValueSet();
       TableMeta meta = CatalogUtil.newTableMeta(storeType, options);
 
       Path tablePath = new Path(testDir, "testTime.data");

http://git-wip-us.apache.org/repos/asf/tajo/blob/5db47466/tajo-storage/src/test/java/org/apache/tajo/storage/v2/TestStorages.java
----------------------------------------------------------------------
diff --git a/tajo-storage/src/test/java/org/apache/tajo/storage/v2/TestStorages.java b/tajo-storage/src/test/java/org/apache/tajo/storage/v2/TestStorages.java
index d6cfee3..357dadb 100644
--- a/tajo-storage/src/test/java/org/apache/tajo/storage/v2/TestStorages.java
+++ b/tajo-storage/src/test/java/org/apache/tajo/storage/v2/TestStorages.java
@@ -22,7 +22,7 @@ import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.tajo.catalog.CatalogUtil;
-import org.apache.tajo.catalog.Options;
+import org.apache.tajo.util.KeyValueSet;
 import org.apache.tajo.catalog.Schema;
 import org.apache.tajo.catalog.TableMeta;
 import org.apache.tajo.catalog.proto.CatalogProtos.StoreType;
@@ -246,7 +246,7 @@ public class TestStorages {
     schema.addColumn("col11", Type.INET4);
     schema.addColumn("col12", Type.NULL_TYPE);
 
-    Options options = new Options();
+    KeyValueSet options = new KeyValueSet();
     TableMeta meta = CatalogUtil.newTableMeta(storeType, options);
     meta.setOptions(StorageUtil.newPhysicalProperties(storeType));
     if (storeType == StoreType.AVRO) {


Mime
View raw message