You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2020/02/25 00:05:21 UTC
[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull
request #5092: Minor improvement for RoutingManager
Jackie-Jiang commented on a change in pull request #5092: Minor improvement for RoutingManager
URL: https://github.com/apache/incubator-pinot/pull/5092#discussion_r383587137
##########
File path: pinot-broker/src/main/java/org/apache/pinot/broker/routing/v2/RoutingManager.java
##########
@@ -131,44 +131,42 @@ private void processExternalViewChange() {
Stat[] stats = _zkDataAccessor.getStats(externalViewPaths, AccessOption.PERSISTENT);
long fetchStatsEndTimeMs = System.currentTimeMillis();
- int numRoutingEntriesToUpdate = 0;
+ List<String> tablesToUpdate = new ArrayList<>();
for (int i = 0; i < numTables; i++) {
Stat stat = stats[i];
if (stat != null) {
RoutingEntry routingEntry = routingEntries.get(i);
if (stat.getVersion() != routingEntry.getLastUpdateExternalViewVersion()) {
- numRoutingEntriesToUpdate++;
+ String tableNameWithType = routingEntry.getTableNameWithType();
+ tablesToUpdate.add(tableNameWithType);
try {
- updateRoutingEntryOnExternalViewChange(routingEntry);
+ ExternalView externalView = getExternalView(tableNameWithType);
+ if (externalView == null) {
+ LOGGER.warn("Failed to find external view for table: {}, skipping updating routing entry",
+ tableNameWithType);
+ continue;
+ }
+ Set<String> onlineSegments = getOnlineSegments(tableNameWithType);
+ if (onlineSegments == null) {
+ LOGGER
+ .warn("Failed to find ideal state for table: {}, skipping updating routing entry", tableNameWithType);
+ continue;
+ }
+ routingEntry.onExternalViewChange(externalView, onlineSegments);
} catch (Exception e) {
LOGGER
.error("Caught unexpected exception while updating routing entry on external view change for table: {}",
- routingEntry.getTableNameWithType(), e);
+ tableNameWithType, e);
}
}
}
}
long updateRoutingEntriesEndTimeMs = System.currentTimeMillis();
LOGGER.info(
- "Processed external view change in {}ms (fetch {} external view stats: {}ms, update {} routing entries: {}ms)",
+ "Processed external view change in {}ms (fetch {} external view stats: {}ms, update {} routing entries ({}): {}ms)",
Review comment:
Changed it to `..., update routing entry for 2 tables ([foo_OFFLINE, bar_REALTIME]): 5ms`
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org