Search in sources :

Example 6 with TableNameBuilder

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;
}
Also used : AbstractTableConfig(com.linkedin.pinot.common.config.AbstractTableConfig) TableNameBuilder(com.linkedin.pinot.common.config.TableNameBuilder)

Example 7 with TableNameBuilder

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);
    }
}
Also used : RealtimeTableConfig(com.linkedin.pinot.common.config.RealtimeTableConfig) AbstractTableConfig(com.linkedin.pinot.common.config.AbstractTableConfig) OfflineTableConfig(com.linkedin.pinot.common.config.OfflineTableConfig) TableNameBuilder(com.linkedin.pinot.common.config.TableNameBuilder)

Aggregations

TableNameBuilder (com.linkedin.pinot.common.config.TableNameBuilder)7 AbstractTableConfig (com.linkedin.pinot.common.config.AbstractTableConfig)6 OfflineTableConfig (com.linkedin.pinot.common.config.OfflineTableConfig)1 RealtimeTableConfig (com.linkedin.pinot.common.config.RealtimeTableConfig)1 Nullable (javax.annotation.Nullable)1