Search in sources :

Example 1 with HDFSMetadataService

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;
}
Also used : HashMap(java.util.HashMap) ServiceNotFoundException(com.hortonworks.streamline.streams.cluster.exception.ServiceNotFoundException) ServiceConfigurationNotFoundException(com.hortonworks.streamline.streams.cluster.exception.ServiceConfigurationNotFoundException) HDFSMetadataService(com.hortonworks.streamline.streams.cluster.service.metadata.HDFSMetadataService) ServiceConfigurationNotFoundException(com.hortonworks.streamline.streams.cluster.exception.ServiceConfigurationNotFoundException) ServiceNotFoundException(com.hortonworks.streamline.streams.cluster.exception.ServiceNotFoundException)

Aggregations

ServiceConfigurationNotFoundException (com.hortonworks.streamline.streams.cluster.exception.ServiceConfigurationNotFoundException)1 ServiceNotFoundException (com.hortonworks.streamline.streams.cluster.exception.ServiceNotFoundException)1 HDFSMetadataService (com.hortonworks.streamline.streams.cluster.service.metadata.HDFSMetadataService)1 HashMap (java.util.HashMap)1