gjacoby126 commented on a change in pull request #935:
URL: https://github.com/apache/phoenix/pull/935#discussion_r522550707



##########
File path: phoenix-core/src/main/java/org/apache/phoenix/util/MetaDataUtil.java
##########
@@ -107,6 +107,29 @@
             HColumnDescriptor.KEEP_DELETED_CELLS,
             HColumnDescriptor.REPLICATION_SCOPE);
 
+    public static Put getLastDDLTimestampUpdate(byte[] tableHeaderRowKey,
+                                                     long clientTimestamp,
+                                                     long lastDDLTimestamp) {
+        //use client timestamp as the timestamp of the Cell, to match the 
other Cells that might
+        // be created by this DDL. But the actual value will be a _server_ 
timestamp
+        Put p = new Put(tableHeaderRowKey, clientTimestamp);
+        byte[] lastDDLTimestampBytes = 
PLong.INSTANCE.toBytes(lastDDLTimestamp);
+        p.addColumn(PhoenixDatabaseMetaData.TABLE_FAMILY_BYTES,
+            PhoenixDatabaseMetaData.LAST_DDL_TIMESTAMP_BYTES, 
lastDDLTimestampBytes);
+        return p;
+    }
+
+    /**
+     * Checks if a table is meant to be queried directly (and hence is 
relevant to external
+     * systems tracking Phoenix schema)
+     * @param tableType
+     * @return True if a table or view, false otherwise (such as for an index, 
system table, or
+     * subquery)
+     */
+    public static boolean isTableQueryable(PTableType tableType) {

Review comment:
       I struggled to find a good name here. "Queryable" was the best I could 
think of, by which I meant that tables and views are meant to be queried, but 
while you _can_ directly query an index and a system table, end users aren't 
really _supposed_ to. The internal schema of an index or a system table 
shouldn't be relevant to an external schema registry trying to track the schema 
of Phoenix tables. 
   
   Happy to hear other naming suggestions. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to