incubator-hcatalog-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tof...@apache.org
Subject svn commit: r1232648 - in /incubator/hcatalog/trunk: CHANGES.txt storage-drivers/hbase/src/java/org/apache/hcatalog/hbase/HCatTableSnapshot.java
Date Tue, 17 Jan 2012 23:28:08 GMT
Author: toffer
Date: Tue Jan 17 23:28:08 2012
New Revision: 1232648

URL: http://svn.apache.org/viewvc?rev=1232648&view=rev
Log:
HCATALOG-193 Snapshot class for HCatalog tables. (avandana via toffer)

Added:
    incubator/hcatalog/trunk/storage-drivers/hbase/src/java/org/apache/hcatalog/hbase/HCatTableSnapshot.java
Modified:
    incubator/hcatalog/trunk/CHANGES.txt

Modified: incubator/hcatalog/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/CHANGES.txt?rev=1232648&r1=1232647&r2=1232648&view=diff
==============================================================================
--- incubator/hcatalog/trunk/CHANGES.txt (original)
+++ incubator/hcatalog/trunk/CHANGES.txt Tue Jan 17 23:28:08 2012
@@ -23,6 +23,8 @@ Trunk (unreleased changes)
   INCOMPATIBLE CHANGES
 
   NEW FEATURES
+  HCAT-193. Snapshot class for HCatalog tables. (avandana via toffer)
+
   HCAT-87. Newly added partition should inherit table properties. (hashutosh at HIVE-2589
via khorgath)
 
   HCAT-189. Zookpeeper based revision manager for HBase Storage Driver (avandana via toffer)

Added: incubator/hcatalog/trunk/storage-drivers/hbase/src/java/org/apache/hcatalog/hbase/HCatTableSnapshot.java
URL: http://svn.apache.org/viewvc/incubator/hcatalog/trunk/storage-drivers/hbase/src/java/org/apache/hcatalog/hbase/HCatTableSnapshot.java?rev=1232648&view=auto
==============================================================================
--- incubator/hcatalog/trunk/storage-drivers/hbase/src/java/org/apache/hcatalog/hbase/HCatTableSnapshot.java
(added)
+++ incubator/hcatalog/trunk/storage-drivers/hbase/src/java/org/apache/hcatalog/hbase/HCatTableSnapshot.java
Tue Jan 17 23:28:08 2012
@@ -0,0 +1,80 @@
+/*
+ * 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.hcatalog.hbase;
+
+import java.io.Serializable;
+import java.util.Map;
+
+
+/**
+ * The class HCatTableSnapshot represents a snapshot of a hcatalog table.
+ * This class is intended to be opaque. This class would used only by the
+ * record readers to obtain knowledge about the revisions of a
+ * column to be filtered.
+ */
+public class HCatTableSnapshot implements Serializable{
+
+    private static final long serialVersionUID = 1L;
+    private String tableName;
+    private String databaseName;
+    private Map<String, Long> columnMap;
+
+    HCatTableSnapshot(String databaseName, String tableName, Map<String, Long> columnMap)
{
+        this.tableName = tableName;
+        this.databaseName = databaseName;
+        this.columnMap = columnMap;
+    }
+
+    /**
+     * @return The name of the table in the snapshot.
+     */
+    public String getTableName() {
+        return this.tableName;
+    }
+
+    /**
+     * @return The name of the database to which the table snapshot belongs.
+     */
+    public String getDatabaseName(){
+        return this.databaseName;
+    }
+
+    /**
+     * @return The revision number of a column in a snapshot.
+     */
+    long getRevision(String column){
+        return this.columnMap.get(column);
+    }
+
+    /**
+     * The method checks if the snapshot contains information about a data column.
+     *
+     * @param column The data column of the table
+     * @return true, if successful
+     */
+    boolean containsColumn(String column){
+        return this.columnMap.containsKey(column);
+    }
+
+    @Override
+    public String toString() {
+        String snapshot = " Database Name: " + this.databaseName +" Table Name : " + tableName
+
+                 " Column revision : " + columnMap.toString();
+        return snapshot;
+    }
+}



Mime
View raw message