use of org.apache.helix.rest.common.HelixRestNamespace in project helix by apache.
the class HelixRestMain method constructNamespaceFromConfigFile.
private static void constructNamespaceFromConfigFile(String filePath, List<HelixRestNamespace> namespaces) throws IOException {
Yaml yaml = new Yaml();
@SuppressWarnings("unchecked") ArrayList<Map<String, String>> configs = (ArrayList<Map<String, String>>) yaml.load(new FileInputStream(new File(filePath)));
for (Map<String, String> config : configs) {
// Currently we don't support adding default namespace through yaml manifest so all
// namespaces created here will not be default
// TODO: support specifying default namespace from config file
namespaces.add(new HelixRestNamespace(config.get(HelixRestNamespace.HelixRestNamespaceProperty.NAME.name()), HelixRestNamespace.HelixMetadataStoreType.valueOf(config.get(HelixRestNamespace.HelixRestNamespaceProperty.METADATA_STORE_TYPE.name())), config.get(HelixRestNamespace.HelixRestNamespaceProperty.METADATA_STORE_ADDRESS.name()), false));
}
}
Aggregations