Source:
void validateTableTenantConfig(TableConfig tableConfig) { TenantConfig tenantConfig = tableConfig.getTenantConfig(); String brokerTag = tenantConfig.getBroker(); String serverTag = tenantConfig.getServer(); if (brokerTag == null || serverTag == null) { if (!_isSingleTenantCluster) { throw new InvalidTableConfigException("server and broker tenants must be specified for multi-tenant cluster"); } String newBrokerTag = brokerTag == null ? TagNameUtils.DEFAULT_TENANT_NAME : brokerTag; String newServerTag = serverTag == null ? TagNameUtils.DEFAULT_TENANT_NAME : serverTag; tableConfig.setTenantConfig(new TenantConfig(newBrokerTag, newServerTag, tenantConfig.getTagOverrideConfig())); } String tableNameWithType = tableConfig.getTableName(); Set<String> tagsToCheck = new TreeSet<>(); tagsToCheck.add(TagNameUtils.extractBrokerTag(tenantConfig)); if (tableConfig.getTableType() == TableType.OFFLINE) { tagsToCheck.add(TagNameUtils.extractOfflineServerTag(tenantConfig)); } else { String consumingServerTag = TagNameUtils.extractConsumingServerTag(tenantConfig); if (!TagNameUtils.isServerTag(consumingServerTag)) { throw new InvalidTableConfigException( "Invalid CONSUMING server tag: " + consumingServerTag + " for table: " + tableNameWithType); } tagsToCheck.add(consumingServerTag); String completedServerTag = TagNameUtils.extractCompletedServerTag(tenantConfig); if (!TagNameUtils.isServerTag(completedServerTag)) { throw new InvalidTableConfigException( "Invalid COMPLETED server tag: " + completedServerTag + " for table: " + tableNameWithType); } tagsToCheck.add(completedServerTag); } for (String tag : tagsToCheck) { if (getInstancesWithTag(tag).isEmpty()) { throw new InvalidTableConfigException( "Failed to find instances with tag: " + tag + " for table: " + tableNameWithType); } } }

Target:
void validateTableTenantConfig(TableConfig tableConfig) { TenantConfig tenantConfig = tableConfig.getTenantConfig(); String tableNameWithType = tableConfig.getTableName(); String brokerTag = tenantConfig.getBroker(); String serverTag = tenantConfig.getServer(); if (brokerTag == null || serverTag == null) { if (!_isSingleTenantCluster) { throw new InvalidTableConfigException( "server and broker tenants must be specified for multi-tenant cluster for table: " + tableNameWithType); } String newBrokerTag = brokerTag == null ? TagNameUtils.DEFAULT_TENANT_NAME : brokerTag; String newServerTag = serverTag == null ? TagNameUtils.DEFAULT_TENANT_NAME : serverTag; tableConfig.setTenantConfig(new TenantConfig(newBrokerTag, newServerTag, tenantConfig.getTagOverrideConfig())); } Set<String> tagsToCheck = new TreeSet<>(); tagsToCheck.add(TagNameUtils.extractBrokerTag(tenantConfig)); if (tableConfig.getTableType() == TableType.OFFLINE) { tagsToCheck.add(TagNameUtils.extractOfflineServerTag(tenantConfig)); } else { String consumingServerTag = TagNameUtils.extractConsumingServerTag(tenantConfig); if (!TagNameUtils.isServerTag(consumingServerTag)) { throw new InvalidTableConfigException( "Invalid CONSUMING server tag: " + consumingServerTag + " for table: " + tableNameWithType); } tagsToCheck.add(consumingServerTag); String completedServerTag = TagNameUtils.extractCompletedServerTag(tenantConfig); if (!TagNameUtils.isServerTag(completedServerTag)) { throw new InvalidTableConfigException( "Invalid COMPLETED server tag: " + completedServerTag + " for table: " + tableNameWithType); } tagsToCheck.add(completedServerTag); } for (String tag : tagsToCheck) { if (getInstancesWithTag(tag).isEmpty()) { throw new InvalidTableConfigException( "Failed to find instances with tag: " + tag + " for table: " + tableNameWithType); } } }