本文整理汇总了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);
}
}
示例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);
}
}
示例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());
}
}
}