[ 
https://issues.apache.org/jira/browse/PHOENIX-1674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15005042#comment-15005042
 ] 

ASF GitHub Bot commented on PHOENIX-1674:
-----------------------------------------

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

    https://github.com/apache/phoenix/pull/127#discussion_r44852247
  
    --- Diff: 
phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
 ---
    @@ -1936,29 +2278,32 @@ public Void call() throws Exception {
                                     long currentServerSideTableTimeStamp = 
e.getTable().getTimeStamp();
     
                                     String columnsToAdd = "";
    -                                if(currentServerSideTableTimeStamp < 
MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP_4_3_0) {
    -                                    // We know that we always need to add 
the STORE_NULLS column for 4.3 release
    -                                    columnsToAdd = ", " + 
PhoenixDatabaseMetaData.STORE_NULLS + " " + PBoolean.INSTANCE.getSqlTypeName();
    -                                    HBaseAdmin admin = null;
    -                                    try {
    -                                        admin = getAdmin();
    -                                        HTableDescriptor[] 
localIndexTables = admin.listTables(MetaDataUtil.LOCAL_INDEX_TABLE_PREFIX+".*");
    -                                        for (HTableDescriptor table : 
localIndexTables) {
    -                                            if 
(table.getValue(MetaDataUtil.PARENT_TABLE_KEY) == null
    -                                                    && 
table.getValue(MetaDataUtil.IS_LOCAL_INDEX_TABLE_PROP_NAME) != null) {
    -                                                
table.setValue(MetaDataUtil.PARENT_TABLE_KEY,
    -                                                    
MetaDataUtil.getUserTableName(table
    -                                                        
.getNameAsString()));
    -                                                // Explicitly disable, 
modify and enable the table to ensure co-location of data
    -                                                // and index regions. If 
we just modify the table descriptor when online schema
    -                                                // change enabled may 
reopen the region in same region server instead of following data region.
    -                                                
admin.disableTable(table.getTableName());
    -                                                
admin.modifyTable(table.getTableName(), table);
    -                                                
admin.enableTable(table.getTableName());
    +                                if(currentServerSideTableTimeStamp < 
MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP_4_6_0) {
    +                                    columnsToAdd = 
PhoenixDatabaseMetaData.TRANSACTIONAL + " " + 
PBoolean.INSTANCE.getSqlTypeName();
    +                                    if(currentServerSideTableTimeStamp < 
MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP_4_3_0) {
    +                                        // We know that we always need to 
add the STORE_NULLS column for 4.3 release
    +                                        columnsToAdd += "," + 
PhoenixDatabaseMetaData.STORE_NULLS + " " + PBoolean.INSTANCE.getSqlTypeName();
    +                                        HBaseAdmin admin = null;
    +                                        try {
    +                                            admin = getAdmin();
    +                                            HTableDescriptor[] 
localIndexTables = admin.listTables(MetaDataUtil.LOCAL_INDEX_TABLE_PREFIX+".*");
    +                                            for (HTableDescriptor table : 
localIndexTables) {
    +                                                if 
(table.getValue(MetaDataUtil.PARENT_TABLE_KEY) == null
    +                                                        && 
table.getValue(MetaDataUtil.IS_LOCAL_INDEX_TABLE_PROP_NAME) != null) {
    +                                                    
table.setValue(MetaDataUtil.PARENT_TABLE_KEY,
    +                                                        
MetaDataUtil.getUserTableName(table
    +                                                            
.getNameAsString()));
    +                                                    // Explicitly disable, 
modify and enable the table to ensure co-location of data
    +                                                    // and index regions. 
If we just modify the table descriptor when online schema
    +                                                    // change enabled may 
reopen the region in same region server instead of following data region.
    +                                                    
admin.disableTable(table.getTableName());
    +                                                    
admin.modifyTable(table.getTableName(), table);
    +                                                    
admin.enableTable(table.getTableName());
    +                                                }
                                                 }
    +                                        } finally {
    +                                            if (admin != null) 
admin.close();
                                             }
    -                                    } finally {
    -                                        if (admin != null) admin.close();
                                         }
                                     }
     
    --- End diff --
    
    You'll need to add an if statement in init() in the MetaDataClient.java and 
a MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP_4_7_0  for conditionally adding 
the new TRANSACTIONAL column to SYSTEM.CATALOG.


> Snapshot isolation transaction support through Tephra
> -----------------------------------------------------
>
>                 Key: PHOENIX-1674
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1674
>             Project: Phoenix
>          Issue Type: Improvement
>            Reporter: James Taylor
>              Labels: SFDC
>
> Tephra (http://tephra.io/ and https://github.com/caskdata/tephra) is one 
> option for getting transaction support in Phoenix. Let's use this JIRA to 
> discuss the way in which this could be integrated along with the pros and 
> cons.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to