tajo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jihoon...@apache.org
Subject [35/43] git commit: TAJO-1021: Remove the member variable Builder from all classes inherited from ProtoObject.
Date Fri, 10 Oct 2014 04:33:41 GMT
TAJO-1021: Remove the member variable Builder from all classes inherited from ProtoObject.

Closes #188


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

Branch: refs/heads/index_support
Commit: d94727f893bcac2866da4232ee71fe1b435d4759
Parents: 8967d11
Author: Hyunsik Choi <hyunsik@apache.org>
Authored: Wed Oct 8 09:26:28 2014 -0700
Committer: Hyunsik Choi <hyunsik@apache.org>
Committed: Wed Oct 8 09:26:28 2014 -0700

----------------------------------------------------------------------
 CHANGES                                               |  3 +++
 .../java/org/apache/tajo/catalog/AlterTableDesc.java  | 14 +++++---------
 .../main/java/org/apache/tajo/catalog/IndexDesc.java  |  7 +------
 .../main/java/org/apache/tajo/catalog/TableDesc.java  |  7 +------
 .../tajo/catalog/partition/PartitionMethodDesc.java   |  8 --------
 .../apache/tajo/catalog/statistics/ColumnStats.java   |  8 ++------
 6 files changed, 12 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tajo/blob/d94727f8/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index cc2b8b8..5075602 100644
--- a/CHANGES
+++ b/CHANGES
@@ -163,6 +163,9 @@ Release 0.9.0 - unreleased
 
   BUG FIXES
 
+    TAJO-1021: Remove the member variable Builder from all classes inherited 
+    from ProtoObject. (hyunsik)
+
     TAJO-1104: Using asterisk with GROUP BY causes NPE. (hyunsik)
 
     TAJO-1099: LogicalPlanner::convertDataType causes NPE in some cases.

http://git-wip-us.apache.org/repos/asf/tajo/blob/d94727f8/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/AlterTableDesc.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/AlterTableDesc.java
b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/AlterTableDesc.java
index fcaa4c3..69d5be4 100644
--- a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/AlterTableDesc.java
+++ b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/AlterTableDesc.java
@@ -25,11 +25,10 @@ import org.apache.tajo.catalog.proto.CatalogProtos;
 import org.apache.tajo.common.ProtoObject;
 import org.apache.tajo.json.GsonObject;
 
+import static org.apache.tajo.catalog.proto.CatalogProtos.AlterTableDescProto;
 
-public class AlterTableDesc implements ProtoObject<CatalogProtos.AlterTableDescProto>,
GsonObject, Cloneable {
-
-  protected CatalogProtos.AlterTableDescProto.Builder builder = null;
 
+public class AlterTableDesc implements ProtoObject<AlterTableDescProto>, GsonObject,
Cloneable {
   @Expose
   protected AlterTableType alterTableType; //required
   @Expose
@@ -44,7 +43,6 @@ public class AlterTableDesc implements ProtoObject<CatalogProtos.AlterTableDescP
   protected Column addColumn = null; //optiona
 
   public AlterTableDesc() {
-    builder = CatalogProtos.AlterTableDescProto.newBuilder();
   }
 
 
@@ -106,7 +104,6 @@ public class AlterTableDesc implements ProtoObject<CatalogProtos.AlterTableDescP
   @Override
   public AlterTableDesc clone() throws CloneNotSupportedException {
     AlterTableDesc newAlter = (AlterTableDesc) super.clone();
-    newAlter.builder = CatalogProtos.AlterTableDescProto.newBuilder();
     newAlter.alterTableType = alterTableType;
     newAlter.tableName = tableName;
     newAlter.newTableName = newTableName;
@@ -121,10 +118,9 @@ public class AlterTableDesc implements ProtoObject<CatalogProtos.AlterTableDescP
   }
 
   @Override
-  public CatalogProtos.AlterTableDescProto getProto() {
-    if (null == builder) {
-      builder = CatalogProtos.AlterTableDescProto.newBuilder();
-    }
+  public AlterTableDescProto getProto() {
+    AlterTableDescProto.Builder builder = AlterTableDescProto.newBuilder();
+
     if (null != this.tableName) {
       builder.setTableName(this.tableName);
     }

http://git-wip-us.apache.org/repos/asf/tajo/blob/d94727f8/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/IndexDesc.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/IndexDesc.java
b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/IndexDesc.java
index cff2059..151b919 100644
--- a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/IndexDesc.java
+++ b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/IndexDesc.java
@@ -27,8 +27,6 @@ import org.apache.tajo.catalog.proto.CatalogProtos.IndexMethod;
 import org.apache.tajo.common.ProtoObject;
 
 public class IndexDesc implements ProtoObject<IndexDescProto>, Cloneable {
-  private IndexDescProto.Builder builder;
-  
   private String indexName;            // required
   private String databaseName;         // required
   private String tableName;            // required
@@ -39,7 +37,6 @@ public class IndexDesc implements ProtoObject<IndexDescProto>, Cloneable
{
   private boolean isAscending = false; // optional [default = false]
   
   public IndexDesc() {
-    this.builder = IndexDescProto.newBuilder();
   }
   
   public IndexDesc(String idxName, String databaseName, String tableName, Column column,
@@ -93,9 +90,7 @@ public class IndexDesc implements ProtoObject<IndexDescProto>, Cloneable
{
 
   @Override
   public IndexDescProto getProto() {
-    if (builder == null) {
-      builder = IndexDescProto.newBuilder();
-    }
+    IndexDescProto.Builder builder = IndexDescProto.newBuilder();
 
     CatalogProtos.TableIdentifierProto.Builder tableIdentifierBuilder = CatalogProtos.TableIdentifierProto.newBuilder();
     if (databaseName != null) {

http://git-wip-us.apache.org/repos/asf/tajo/blob/d94727f8/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 c148049..64255d5 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
@@ -38,7 +38,6 @@ import org.apache.tajo.util.TUtil;
 public class TableDesc implements ProtoObject<TableDescProto>, GsonObject, Cloneable
{
   private final Log LOG = LogFactory.getLog(TableDesc.class);
 
-  protected TableDescProto.Builder builder = null;
 	@Expose protected String tableName;                        // required
   @Expose protected Schema schema;
   @Expose protected TableMeta meta;                          // required
@@ -51,7 +50,6 @@ public class TableDesc implements ProtoObject<TableDescProto>, GsonObject,
Clone
   @Expose protected Boolean external;                        // optional
 
 	public TableDesc() {
-		builder = TableDescProto.newBuilder();
 	}
 
   public TableDesc(String tableName, Schema schema, TableMeta meta,
@@ -180,7 +178,6 @@ public class TableDesc implements ProtoObject<TableDescProto>, GsonObject,
Clone
 	
 	public Object clone() throws CloneNotSupportedException {
 	  TableDesc desc = (TableDesc) super.clone();
-	  desc.builder = TableDescProto.newBuilder();
 	  desc.tableName = tableName;
     desc.schema = (Schema) schema.clone();
     desc.meta = (TableMeta) meta.clone();
@@ -202,9 +199,7 @@ public class TableDesc implements ProtoObject<TableDescProto>, GsonObject,
Clone
 	}
 
   public TableDescProto getProto() {
-    if (builder == null) {
-      builder = TableDescProto.newBuilder();
-    }
+    TableDescProto.Builder builder = TableDescProto.newBuilder();
 
     if (this.tableName != null) {
       builder.setTableName(this.tableName);

http://git-wip-us.apache.org/repos/asf/tajo/blob/d94727f8/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/partition/PartitionMethodDesc.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/partition/PartitionMethodDesc.java
b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/partition/PartitionMethodDesc.java
index 48a105c..721a7a0 100644
--- a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/partition/PartitionMethodDesc.java
+++ b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/partition/PartitionMethodDesc.java
@@ -36,8 +36,6 @@ import static org.apache.tajo.catalog.proto.CatalogProtos.TableIdentifierProto;
  * <code>PartitionMethodDesc</code> presents a table description, including partition
type, and partition keys.
  */
 public class PartitionMethodDesc implements ProtoObject<CatalogProtos.PartitionMethodProto>,
Cloneable, GsonObject {
-  private CatalogProtos.PartitionMethodProto.Builder builder;
-
   @Expose private String databaseName;                         // required
   @Expose private String tableName;                            // required
   @Expose private PartitionType partitionType;                 // required
@@ -45,7 +43,6 @@ public class PartitionMethodDesc implements ProtoObject<CatalogProtos.PartitionM
   @Expose private Schema expressionSchema;                     // required
 
   public PartitionMethodDesc() {
-    builder = CatalogProtos.PartitionMethodProto.newBuilder();
   }
 
   public PartitionMethodDesc(String databaseName, String tableName,
@@ -118,10 +115,6 @@ public class PartitionMethodDesc implements ProtoObject<CatalogProtos.PartitionM
 
   @Override
   public CatalogProtos.PartitionMethodProto getProto() {
-    if(builder == null) {
-      builder = CatalogProtos.PartitionMethodProto.newBuilder();
-    }
-
     TableIdentifierProto.Builder tableIdentifierBuilder = TableIdentifierProto.newBuilder();
     if (databaseName != null) {
       tableIdentifierBuilder.setDatabaseName(databaseName);
@@ -141,7 +134,6 @@ public class PartitionMethodDesc implements ProtoObject<CatalogProtos.PartitionM
 
   public Object clone() throws CloneNotSupportedException {
     PartitionMethodDesc desc = (PartitionMethodDesc) super.clone();
-    desc.builder = builder;
     desc.tableName = tableName;
     desc.partitionType = partitionType;
     desc.expression = expression;

http://git-wip-us.apache.org/repos/asf/tajo/blob/d94727f8/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/statistics/ColumnStats.java
----------------------------------------------------------------------
diff --git a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/statistics/ColumnStats.java
b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/statistics/ColumnStats.java
index 1f3bca3..1bd0276 100644
--- a/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/statistics/ColumnStats.java
+++ b/tajo-catalog/tajo-catalog-common/src/main/java/org/apache/tajo/catalog/statistics/ColumnStats.java
@@ -34,8 +34,6 @@ import org.apache.tajo.json.GsonObject;
 import org.apache.tajo.util.TUtil;
 
 public class ColumnStats implements ProtoObject<CatalogProtos.ColumnStatsProto>, Cloneable,
GsonObject {
-  private CatalogProtos.ColumnStatsProto.Builder builder = CatalogProtos.ColumnStatsProto.newBuilder();
-
   @Expose private Column column = null; // required
   @Expose private Long numDistVals = null; // optional
   @Expose private Long numNulls = null; // optional
@@ -132,7 +130,6 @@ public class ColumnStats implements ProtoObject<CatalogProtos.ColumnStatsProto>,
 
   public Object clone() throws CloneNotSupportedException {
     ColumnStats stat = (ColumnStats) super.clone();
-    stat.builder = CatalogProtos.ColumnStatsProto.newBuilder();
     stat.column = this.column;
     stat.numDistVals = numDistVals;
     stat.numNulls = numNulls;
@@ -154,9 +151,8 @@ public class ColumnStats implements ProtoObject<CatalogProtos.ColumnStatsProto>,
 
   @Override
   public CatalogProtos.ColumnStatsProto getProto() {
-    if (builder == null) {
-      builder = CatalogProtos.ColumnStatsProto.newBuilder();
-    }
+    CatalogProtos.ColumnStatsProto.Builder builder = CatalogProtos.ColumnStatsProto.newBuilder();
+
     if (this.column != null) {
       builder.setColumn(this.column.getProto());
     }


Mime
View raw message