use of com.hortonworks.streamline.streams.cluster.service.metadata.HDFSMetadataService in project streamline by hortonworks.
the class AbstractHDFSBundleHintProvider method getHintsOnCluster.
@Override
public Map<String, Object> getHintsOnCluster(Cluster cluster, SecurityContext securityContext, Subject subject) {
Map<String, Object> hintMap = new HashMap<>();
try {
HDFSMetadataService hdfsMetadataService = HDFSMetadataService.newInstance(environmentService, cluster.getId());
hintMap.put(getFieldNameForFSUrl(), hdfsMetadataService.getDefaultFsUrl());
} catch (ServiceNotFoundException e) {
// we access it from mapping information so shouldn't be here
throw new IllegalStateException("Service " + Constants.HDFS.SERVICE_NAME + " in cluster " + cluster.getName() + " not found but mapping information exists.");
} catch (ServiceConfigurationNotFoundException e) {
// there's HBASE service but not enough configuration info.
} catch (Exception e) {
throw new RuntimeException(e);
}
return hintMap;
}
Aggregations