当前位置: 首页>>代码示例>>Java>>正文


Java Cluster.getName方法代码示例

本文整理汇总了Java中org.apache.falcon.entity.v0.cluster.Cluster.getName方法的典型用法代码示例。如果您正苦于以下问题:Java Cluster.getName方法的具体用法?Java Cluster.getName怎么用?Java Cluster.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.falcon.entity.v0.cluster.Cluster的用法示例。


在下文中一共展示了Cluster.getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validate

import org.apache.falcon.entity.v0.cluster.Cluster; //导入方法依赖的package包/类
@Override
public void validate(Cluster cluster) throws StoreAccessException,
                                             ValidationException {
    if (new Path(ClusterHelper.getStorageUrl(cluster)).toUri().getScheme() == null) {
        throw new ValidationException(
                "Cannot get valid scheme for namenode from write interface of cluster: "
                        + cluster.getName());
    }
    try {
        Configuration conf = new Configuration();
        conf.set("fs.default.name", ClusterHelper.getStorageUrl(cluster));
        conf.setInt("ipc.client.connect.max.retries", 10);
        FileSystem.get(conf);
    } catch (Exception e) {
        throw new ValidationException("Invalid HDFS server or port:"
                + ClusterHelper.getStorageUrl(cluster), e);
    }
}
 
开发者ID:shaikidris,项目名称:incubator-falcon,代码行数:19,代码来源:ClusterEntityParser.java

示例2: copySharedLibs

import org.apache.falcon.entity.v0.cluster.Cluster; //导入方法依赖的package包/类
private void copySharedLibs(Cluster cluster, Path coordPath) throws FalconException {
    try {
        Path libPath = new Path(coordPath, "lib");
        FileSystem fs = FileSystem.get(ClusterHelper.getConfiguration(cluster));
        if (!fs.exists(libPath)) {
            fs.mkdirs(libPath);
        }

        SharedLibraryHostingService.pushLibsToHDFS(libPath.toString(), cluster, FALCON_JAR_FILTER);
    } catch (IOException e) {
        LOG.error("Failed to copy shared libs on cluster " + cluster.getName(), e);
        throw new FalconException("Failed to copy shared libs on cluster " + cluster.getName(), e);
    }
}
 
开发者ID:shaikidris,项目名称:incubator-falcon,代码行数:15,代码来源:AbstractOozieEntityMapper.java

示例3: delete

import org.apache.falcon.entity.v0.cluster.Cluster; //导入方法依赖的package包/类
protected void delete(Cluster cluster, Entity entity, long retention)
    throws FalconException {

    FileStatus[] logs = getAllLogs(cluster, entity);
    long now = System.currentTimeMillis();

    for (FileStatus log : logs) {
        if (now - log.getModificationTime() > retention) {
            try {
                boolean isDeleted = getFileSystem(cluster).delete(
                        log.getPath(), true);
                if (!isDeleted) {
                    LOG.error("Unable to delete path: " + log.getPath());
                } else {
                    LOG.info("Deleted path: " + log.getPath());
                }
                deleteParentIfEmpty(getFileSystem(cluster), log.getPath().getParent());
            } catch (IOException e) {
                throw new FalconException(" Unable to delete log file : "
                        + log.getPath() + " for entity " + entity.getName()
                        + " for cluster: " + cluster.getName(), e);
            }
        } else {
            LOG.info("Retention limit: " + retention
                    + " is less than modification"
                    + (now - log.getModificationTime()) + " for path: "
                    + log.getPath());
        }
    }

}
 
开发者ID:shaikidris,项目名称:incubator-falcon,代码行数:32,代码来源:AbstractCleanupHandler.java


注:本文中的org.apache.falcon.entity.v0.cluster.Cluster.getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。