當前位置: 首頁>>代碼示例>>Java>>正文


Java FeedHelper.getLocations方法代碼示例

本文整理匯總了Java中org.apache.falcon.entity.FeedHelper.getLocations方法的典型用法代碼示例。如果您正苦於以下問題:Java FeedHelper.getLocations方法的具體用法?Java FeedHelper.getLocations怎麽用?Java FeedHelper.getLocations使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.falcon.entity.FeedHelper的用法示例。


在下文中一共展示了FeedHelper.getLocations方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getInputEntities

import org.apache.falcon.entity.FeedHelper; //導入方法依賴的package包/類
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;
}
 
開發者ID:apache,項目名稱:incubator-atlas,代碼行數:26,代碼來源:FalconBridge.java

示例2: getHDFSFeed

import org.apache.falcon.entity.FeedHelper; //導入方法依賴的package包/類
private TypeUtils.Pair<String, Feed> getHDFSFeed(String feedResource, String clusterName) throws Exception {
    Feed feed = loadEntity(EntityType.FEED, feedResource, "feed" + random());
    org.apache.falcon.entity.v0.feed.Cluster feedCluster = feed.getClusters().getClusters().get(0);
    feedCluster.setName(clusterName);
    STORE.publish(EntityType.FEED, feed);
    String feedId = assertFeedIsRegistered(feed, clusterName);
    assertFeedAttributes(feedId);

    String processId = assertEntityIsRegistered(FalconDataTypes.FALCON_FEED_CREATION.getName(),
            AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME,
            FalconBridge.getFeedQualifiedName(feed.getName(), clusterName));
    Referenceable processEntity = atlasClient.getEntity(processId);
    assertEquals(((List<Id>)processEntity.get("outputs")).get(0).getId()._getId(), feedId);

    String inputId = ((List<Id>) processEntity.get("inputs")).get(0).getId()._getId();
    Referenceable pathEntity = atlasClient.getEntity(inputId);
    assertEquals(pathEntity.getTypeName(), HiveMetaStoreBridge.HDFS_PATH);

    List<Location> locations = FeedHelper.getLocations(feedCluster, feed);
    Location dataLocation = FileSystemStorage.getLocation(locations, LocationType.DATA);
    assertEquals(pathEntity.get(AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME),
            FalconBridge.normalize(dataLocation.getPath()));

    return TypeUtils.Pair.of(feedId, feed);
}
 
開發者ID:apache,項目名稱:incubator-atlas,代碼行數:26,代碼來源:FalconHookIT.java


注:本文中的org.apache.falcon.entity.FeedHelper.getLocations方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。