Skip to content

Commit

Permalink
Some comments and test refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanuj Khurana committed Jan 29, 2025
1 parent 62e0893 commit bcd8d2a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ private static void initializeScan(QueryPlan plan, Integer perScanLimit, Integer
DEFAULT_WILDCARD_QUERY_DYNAMIC_COLS_ATTRIB);
PTable table = tableRef.getTable();

// If the table has Condition TTL set, then we need to add all the non PK columns
// referenced in the condition TTL expression to the scan. This can influence the
// filters that are applied to the scan so do this before the filter analysis.
if (table.hasConditionTTL()) {
ScanUtil.addConditionTTLColumnsToScan(scan, context.getConnection(), table);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,8 @@ IndexMaintainer getIndexMaintainer(PTable dataTable, PTable cdcTable,
Map<String, String> getDefaultPropertyValues();

/**
* @return The TTL duration associated with the entity when Phoenix level TTL is enabled.
* @return The TTL expression associated with the entity when Phoenix level TTL is enabled.
* The expression can be a Literal value or a boolean Condition.
*/
TTLExpression getTTL();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,6 @@ private void truncateIndexToolTables() throws IOException {
getUtility().getAdmin().truncateTable(TableName.valueOf(RESULT_TABLE_NAME), true);
}

private void dumpIndexToolMRJobCounters(IndexTool indexTool) throws IOException {
CounterGroup mrJobCounters = IndexToolIT.getMRJobCounters(indexTool);
for (Counter counter : mrJobCounters) {
LOGGER.info(String.format("%s=%d", counter.getName(), counter.getValue()));
}
}

private void assertExtraCounters(IndexTool indexTool, long extraVerified, long extraUnverified,
boolean isBefore) throws IOException {
CounterGroup mrJobCounters = IndexToolIT.getMRJobCounters(indexTool);
Expand Down Expand Up @@ -260,7 +253,7 @@ private void assertDisableLogging(Connection conn, int expectedExtraRows, int ex
try {
assertExtraCounters(tool, expectedExtraRows, 0, true);
} catch (AssertionError e) {
dumpIndexToolMRJobCounters(tool);
IndexToolIT.dumpMRJobCounters(tool);
throw e;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -839,9 +839,14 @@ public static CounterGroup getMRJobCounters(IndexTool indexTool) throws IOExcept
return indexTool.getJob().getCounters().getGroup(PhoenixIndexToolJobCounters.class.getName());
}

public static void dumpMRJobCounters(IndexTool indexTool) throws IOException {
CounterGroup mrJobCounters = IndexToolIT.getMRJobCounters(indexTool);
dumpMRJobCounters(mrJobCounters);
}

public static void dumpMRJobCounters(CounterGroup mrJobCounters) {
for (Counter cntr : mrJobCounters) {
System.out.println(String.format("%s=%d", cntr.getName(), cntr.getValue()));
LOGGER.info(String.format("%s=%d", cntr.getName(), cntr.getValue()));
}
}

Expand Down

0 comments on commit bcd8d2a

Please sign in to comment.