Search in sources :

Example 1 with CatalogTable

use of org.apache.falcon.entity.v0.feed.CatalogTable in project incubator-atlas by apache.

the class FalconBridge method getInputEntities.

private static List<Referenceable> getInputEntities(org.apache.falcon.entity.v0.cluster.Cluster cluster, Feed feed) throws Exception {
    org.apache.falcon.entity.v0.feed.Cluster feedCluster = FeedHelper.getCluster(feed, cluster.getName());
    if (feedCluster != null) {
        final CatalogTable table = getTable(feedCluster, feed);
        if (table != null) {
            CatalogStorage storage = new CatalogStorage(cluster, table);
            return createHiveTableInstance(cluster.getName(), storage.getDatabase().toLowerCase(), storage.getTable().toLowerCase());
        } else {
            List<Location> locations = FeedHelper.getLocations(feedCluster, feed);
            if (CollectionUtils.isNotEmpty(locations)) {
                Location dataLocation = FileSystemStorage.getLocation(locations, LocationType.DATA);
                if (dataLocation != null) {
                    final String pathUri = normalize(dataLocation.getPath());
                    LOG.info("Registering DFS Path {} ", pathUri);
                    return fillHDFSDataSet(pathUri, cluster.getName());
                }
            }
        }
    }
    return null;
}
Also used : CatalogStorage(org.apache.falcon.entity.CatalogStorage) CatalogTable(org.apache.falcon.entity.v0.feed.CatalogTable) Location(org.apache.falcon.entity.v0.feed.Location)

Aggregations

CatalogStorage (org.apache.falcon.entity.CatalogStorage)1 CatalogTable (org.apache.falcon.entity.v0.feed.CatalogTable)1 Location (org.apache.falcon.entity.v0.feed.Location)1