use of com.linkedin.pinot.common.config.TableNameBuilder in project pinot by linkedin.
the class PinotHelixResourceManager method getServerInstancesForTable.
public List<String> getServerInstancesForTable(String tableName, TableType type) throws JsonParseException, JsonMappingException, JsonProcessingException, JSONException, IOException {
String actualTableName = new TableNameBuilder(type).forTable(tableName);
AbstractTableConfig config = null;
if (type == TableType.REALTIME) {
config = ZKMetadataProvider.getRealtimeTableConfig(getPropertyStore(), actualTableName);
} else {
config = ZKMetadataProvider.getOfflineTableConfig(getPropertyStore(), actualTableName);
}
String serverTenantName = ControllerTenantNameBuilder.getTenantName(config.getTenantConfig().getServer(), type.getServerType());
List<String> serverInstances = _helixAdmin.getInstancesInClusterWithTag(_helixClusterName, serverTenantName);
return serverInstances;
}
use of com.linkedin.pinot.common.config.TableNameBuilder in project pinot by linkedin.
the class PinotHelixResourceManager method updateIndexingConfigFor.
public void updateIndexingConfigFor(String tableName, TableType type, IndexingConfig newConfigs) throws Exception {
String actualTableName = new TableNameBuilder(type).forTable(tableName);
AbstractTableConfig config;
if (type == TableType.REALTIME) {
config = ZKMetadataProvider.getRealtimeTableConfig(getPropertyStore(), actualTableName);
if (config != null) {
((RealtimeTableConfig) config).setIndexConfig(newConfigs);
}
} else {
config = ZKMetadataProvider.getOfflineTableConfig(getPropertyStore(), actualTableName);
if (config != null) {
((OfflineTableConfig) config).setIndexConfig(newConfigs);
}
}
if (config == null) {
throw new RuntimeException("tableName : " + tableName + " of type : " + type + " not found");
}
setTableConfig(config, actualTableName, type);
if (type == TableType.REALTIME) {
ensureRealtimeClusterIsSetUp(config, tableName, newConfigs);
}
}
Aggregations