You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by GitBox <gi...@apache.org> on 2022/12/13 19:46:59 UTC
[GitHub] [phoenix] virajjasani commented on a diff in pull request #1534: PHOENIX-6655 - SYSTEM.SEQUENCE should have CACHE_DATA_ON_WRITE set to…
virajjasani commented on code in PR #1534:
URL: https://github.com/apache/phoenix/pull/1534#discussion_r1047659070
##########
phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java:
##########
@@ -4373,10 +4380,39 @@ private PhoenixConnection upgradeSystemSequence(
} else {
nSequenceSaltBuckets = getSaltBuckets(e);
}
+
+ updateSystemSequenceWithCacheOnWriteProps(metaConnection);
}
return metaConnection;
}
+ private void updateSystemSequenceWithCacheOnWriteProps(PhoenixConnection metaConnection) throws
+ IOException, SQLException {
+
+ try (Admin admin = getAdmin()) {
+ PTable pTable = PhoenixRuntime.getTable(metaConnection,
+ PhoenixDatabaseMetaData.SYSTEM_SEQUENCE_NAME);
+ TableDescriptor oldTD = admin.getDescriptor(
+ SchemaUtil.getPhysicalTableName(PhoenixDatabaseMetaData.SYSTEM_SEQUENCE_NAME,
+ metaConnection.getQueryServices().getProps()));
+ ColumnFamilyDescriptor oldCf = oldTD.getColumnFamily(
+ SchemaUtil.getEmptyColumnFamily(pTable));
Review Comment:
Since this table is one of the System tables, we can directly use `DEFAULT_COLUMN_FAMILY_BYTES` instead of calling `SchemaUtil#getEmptyColumnFamily`. Moreover, this would also help getting rid of calling `PhoenixRuntime#getTable`.
```
TableDescriptor oldTD = admin.getDescriptor(
SchemaUtil.getPhysicalTableName(PhoenixDatabaseMetaData.SYSTEM_SEQUENCE_NAME,
metaConnection.getQueryServices().getProps()));
ColumnFamilyDescriptor oldCf = oldTD.getColumnFamily(QueryConstants.DEFAULT_COLUMN_FAMILY_BYTES);
```
--
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.
To unsubscribe, e-mail: issues-unsubscribe@phoenix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org