You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by ankitsinghal <gi...@git.apache.org> on 2018/08/01 02:13:59 UTC

[GitHub] phoenix pull request #313: PHOENIX-4799 Write cells using checkAndMutate to ...

Github user ankitsinghal commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/313#discussion_r206735726
  
    --- Diff: phoenix-core/src/main/java/org/apache/phoenix/query/QueryConstants.java ---
    @@ -355,5 +355,19 @@
     			+ "," + COLUMN_NAME + "," + COLUMN_FAMILY + "))\n" + HConstants.VERSIONS + "=%s,\n"
     			+ HColumnDescriptor.KEEP_DELETED_CELLS + "=%s,\n" + PhoenixDatabaseMetaData.TRANSACTIONAL + "="
     			+ Boolean.FALSE;
    +	
    +	 public static final String CREATE_MUTEX_METADTA =
    +	            "CREATE IMMUTABLE TABLE " + SYSTEM_CATALOG_SCHEMA + ".\"" + SYSTEM_MUTEX_TABLE_NAME + "\"(\n" +
    +	            // Pk columns
    +	            TENANT_ID + " VARCHAR NULL," +
    +	            TABLE_SCHEM + " VARCHAR NULL," +
    +	            TABLE_NAME + " VARCHAR NOT NULL," +
    +	            COLUMN_NAME + " VARCHAR NULL," + // null for table row
    +	            COLUMN_FAMILY + " VARCHAR NULL " + // using for CF to uniqueness for columns
    +	            "CONSTRAINT " + SYSTEM_TABLE_PK_NAME + " PRIMARY KEY (" + TENANT_ID + ","
    +	            + TABLE_SCHEM + "," + TABLE_NAME + "," + COLUMN_NAME + "," + COLUMN_FAMILY + "))\n" +
    +	            HConstants.VERSIONS + "=%s,\n" +
    +	            HColumnDescriptor.KEEP_DELETED_CELLS + "=%s,\n" +
    +	            PhoenixDatabaseMetaData.TRANSACTIONAL + "=" + Boolean.FALSE;
    --- End diff --
    
    Why there is a need of creating a Phoenix managed table for mutex? 
    And also API in QueryServices.writeMutexCell(byte[] rowKey) and deleteMutexCell(byte[] rowKey) don't enforce the schema of the table will be followed. 



---