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


Java FsStatus类代码示例

本文整理汇总了Java中org.apache.hadoop.fs.FsStatus的典型用法代码示例。如果您正苦于以下问题:Java FsStatus类的具体用法?Java FsStatus怎么用?Java FsStatus使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: test

import org.apache.hadoop.fs.FsStatus; //导入依赖的package包/类
public void test() throws IOException {
	Configuration conf = new Configuration();
	conf.addResource("conf/hdfs/test-hdfs-client-conf.xml");

	System.setProperty("HADOOP_USER_NAME", "hdfs");
	DistributedFileSystem fs = (DistributedFileSystem) FileSystem.get(conf);

	DatanodeInfo[] dataNodeStatus = fs.getDataNodeStats();
	for (DatanodeInfo dninfo : dataNodeStatus) {
		System.out.println(dninfo.getHostName() + ", Is Decommission:"
				+ dninfo.isDecommissioned());
		System.out.println(dninfo.getHostName() + ", Dump Data node:"
				+ dninfo.dumpDatanode());
	}
	System.out.println("Default block size:" + fs.getDefaultBlockSize());
	ContentSummary contentSummary = fs.getContentSummary(new Path("/"));
	System.out.println("Content Summary:" + contentSummary);

	FsStatus fsstatus = fs.getStatus();

	System.out.println(fsstatus.getCapacity());
}
 
开发者ID:Ctrip-DI,项目名称:Hue-Ctrip-DI,代码行数:23,代码来源:TestMain.java

示例2: processPath

import org.apache.hadoop.fs.FsStatus; //导入依赖的package包/类
@Override
protected void processPath(PathData item) throws IOException {
  FsStatus fsStats = item.fs.getStatus(item.path);
  long size = fsStats.getCapacity();
  long used = fsStats.getUsed();
  long free = fsStats.getRemaining();

  usagesTable.addRow(
      item.fs.getUri(),
      formatSize(size),
      formatSize(used),
      formatSize(free),
      StringUtils.formatPercent((double)used/(double)size, 0)
  );
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:16,代码来源:FsUsage.java

示例3: getStatus

import org.apache.hadoop.fs.FsStatus; //导入依赖的package包/类
/**
 * 此方法用于获取文件的FsStatus
 *
 * @param fileSystemInfo
 *            文件系统信息
 * @param path
 *            文件路径
 * @return FsStatus
 */
public static FsStatus getStatus(FileSystemInfo fileSystemInfo, String path) {
	FileSystem fs = getFileSystem(fileSystemInfo);
	Path uri = new Path(path);
	try {
		pathNotExistCheck(path, fs, uri);
		return fs.getStatus(uri);
	} catch (IOException e) {
		e.printStackTrace();
	} finally {
		closeFileSystem(fs);
	}
	return null;
}
 
开发者ID:zhangjunfang,项目名称:alluxio,代码行数:23,代码来源:HdfsAndAlluxioUtils_update.java

示例4: getStatus

import org.apache.hadoop.fs.FsStatus; //导入依赖的package包/类
@Override
public FsStatus getStatus() throws IOException {
  try {
    return underlyingFs.getStatus();
  } catch(FSError e) {
    throw propagateFSError(e);
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:9,代码来源:FileSystemWrapper.java

示例5: testStatus

import org.apache.hadoop.fs.FsStatus; //导入依赖的package包/类
/** @throws Exception If failed. */
public void testStatus() throws Exception {
    Path file1 = new Path("/file1");

    try (FSDataOutputStream file = fs.create(file1, EnumSet.noneOf(CreateFlag.class),
        Options.CreateOpts.perms(FsPermission.getDefault()))) {
        file.write(new byte[1024 * 1024]);
    }

    FsStatus status = fs.getFsStatus();

    assertEquals(getClientFsUser(), fs.getFileStatus(file1).getOwner());

    assertEquals(4, grid(0).cluster().nodes().size());

    long used = 0, max = 0;

    for (int i = 0; i < 4; i++) {
        IgniteFileSystem igfs = grid(i).fileSystem("igfs");

        IgfsMetrics metrics = igfs.metrics();

        used += metrics.localSpaceSize();
        max += metrics.maxSpaceSize();
    }

    assertEquals(used, status.getUsed());
    assertEquals(max, status.getCapacity());
}
 
开发者ID:apache,项目名称:ignite,代码行数:30,代码来源:HadoopIgfs20FileSystemAbstractSelfTest.java

示例6: getDiskStatus

import org.apache.hadoop.fs.FsStatus; //导入依赖的package包/类
/**
 * @see ClientProtocol#getStats()
 */
public FsStatus getDiskStatus() throws IOException {
  ClientActionHandler handler = new ClientActionHandler() {
    @Override
    public Object doAction(ClientProtocol namenode)
        throws RemoteException, IOException {
      return namenode.getStats();
    }
  };
  long rawNums[] = (long[]) doClientActionWithRetry(handler, "getDiskStatus");
  return new FsStatus(rawNums[0], rawNums[1], rawNums[2]);
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:15,代码来源:DFSClient.java

示例7: getStatus

import org.apache.hadoop.fs.FsStatus; //导入依赖的package包/类
@Override
public FsStatus getStatus(Path p) throws IOException {
 CephStatVFS stat = new CephStatVFS();
 ceph.statfs(p, stat);

 FsStatus status = new FsStatus(stat.bsize * stat.blocks, 
	  	stat.bsize * (stat.blocks - stat.bavail),
	  	stat.bsize * stat.bavail);
 return status;
}
 
开发者ID:ceph,项目名称:cephfs-hadoop,代码行数:11,代码来源:CephFileSystem.java

示例8: getStatus

import org.apache.hadoop.fs.FsStatus; //导入依赖的package包/类
@Override
public FsStatus getStatus(Path p) throws IOException {
  return super.getStatus(fullPath(p));
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:5,代码来源:ChRootedFileSystem.java

示例9: getFsStatus

import org.apache.hadoop.fs.FsStatus; //导入依赖的package包/类
@Override
public FsStatus getFsStatus() throws IOException {
  return myFs.getFsStatus();
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:5,代码来源:ChRootedFs.java

示例10: getFsStatus

import org.apache.hadoop.fs.FsStatus; //导入依赖的package包/类
@Override
public FsStatus getFsStatus() throws AccessControlException,
    FileNotFoundException, IOException {
  return new FsStatus(0, 0, 0);
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:6,代码来源:ViewFs.java

示例11: getStatus

import org.apache.hadoop.fs.FsStatus; //导入依赖的package包/类
@Override
public FsStatus getStatus() throws IOException {
  return underlyingFs.getStatus();
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:5,代码来源:DrillFileSystem.java

示例12: getDiskStatus

import org.apache.hadoop.fs.FsStatus; //导入依赖的package包/类
/**
 * @see ClientProtocol#getStats()
 */
public FsStatus getDiskStatus() throws IOException {
  long rawNums[] = callGetStats();
  return new FsStatus(rawNums[0], rawNums[1], rawNums[2]);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:DFSClient.java

示例13: DiskStatus

import org.apache.hadoop.fs.FsStatus; //导入依赖的package包/类
public DiskStatus(FsStatus stats) {
  super(stats.getCapacity(), stats.getUsed(), stats.getRemaining());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:DistributedFileSystem.java

示例14: getStatus

import org.apache.hadoop.fs.FsStatus; //导入依赖的package包/类
@Override
public FsStatus getStatus(Path p) throws IOException {
  statistics.incrementReadOps(1);
  return dfs.getDiskStatus();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:6,代码来源:DistributedFileSystem.java


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