sanjeet006py commented on code in PR #1751:
URL: https://github.com/apache/phoenix/pull/1751#discussion_r1510359112
##########
phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/MetaDataEndpointImpl.java:
##########
@@ -1587,6 +1623,56 @@ private PTable getTableFromCells(List<Cell>
tableCellList, List<List<Cell>> allC
return builder.build();
}
+ private Long scanMaxLookbackAgeFromParent(byte[] key, long
clientTimeStamp) throws IOException {
+ Scan scan = MetaDataUtil.newTableRowsScan(key, MIN_TABLE_TIMESTAMP,
clientTimeStamp);
+ Table sysCat = ServerUtil.getHTableForCoprocessorScan(this.env,
+ SchemaUtil.getPhysicalTableName(SYSTEM_CATALOG_NAME_BYTES,
env.getConfiguration()));
+ ResultScanner scanner = sysCat.getScanner(scan);
+ Result result = scanner.next();
+ boolean startCheckingForLink = false;
+ byte[] parentTableKey = null;
+ do {
+ if (result == null) {
+ return null;
+ }
+ else if (startCheckingForLink) {
+ byte[] linkTypeBytes = result.getValue(TABLE_FAMILY_BYTES,
LINK_TYPE_BYTES);
+ if (linkTypeBytes != null) {
+ LinkType linkType =
LinkType.fromSerializedValue(linkTypeBytes[0]);
+ int rowKeyColMetadataLength = 5;
+ byte[][] rowKeyMetaData = new
byte[rowKeyColMetadataLength][];
+ getVarChars(result.getRow(), rowKeyColMetadataLength,
rowKeyMetaData);
+ if (linkType == VIEW_INDEX_PARENT_TABLE) {
+ parentTableKey =
getParentTableKeyFromChildRowKeyMetaData(rowKeyMetaData);
+ return scanMaxLookbackAgeFromParent(parentTableKey,
clientTimeStamp);
+ }
+ else if (linkType == PHYSICAL_TABLE) {
Review Comment:
Yes, because we need to use `DATA_TABLE_NAME` filed in syscat so needs to
handled special.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]