本文整理汇总了Java中org.apache.hadoop.fs.Options.CreateOpts.BlockSize类的典型用法代码示例。如果您正苦于以下问题:Java BlockSize类的具体用法?Java BlockSize怎么用?Java BlockSize使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BlockSize类属于org.apache.hadoop.fs.Options.CreateOpts包,在下文中一共展示了BlockSize类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createFile
import org.apache.hadoop.fs.Options.CreateOpts.BlockSize; //导入依赖的package包/类
public long createFile(Path path, int numBlocks, CreateOpts... options)
throws IOException {
BlockSize blockSizeOpt = CreateOpts.getOpt(CreateOpts.BlockSize.class, options);
long blockSize = blockSizeOpt != null ? blockSizeOpt.getValue()
: DEFAULT_BLOCK_SIZE;
FSDataOutputStream out =
fc.create(path, EnumSet.of(CreateFlag.CREATE), options);
byte[] data = getFileData(numBlocks, blockSize);
out.write(data, 0, data.length);
out.close();
return data.length;
}
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:13,代码来源:FileContextTestWrapper.java
示例2: appendToFile
import org.apache.hadoop.fs.Options.CreateOpts.BlockSize; //导入依赖的package包/类
public void appendToFile(Path path, int numBlocks, CreateOpts... options)
throws IOException {
BlockSize blockSizeOpt = CreateOpts.getOpt(CreateOpts.BlockSize.class, options);
long blockSize = blockSizeOpt != null ? blockSizeOpt.getValue()
: DEFAULT_BLOCK_SIZE;
FSDataOutputStream out;
out = fc.create(path, EnumSet.of(CreateFlag.APPEND));
byte[] data = getFileData(numBlocks, blockSize);
out.write(data, 0, data.length);
out.close();
}
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:12,代码来源:FileContextTestWrapper.java
示例3: createFile
import org.apache.hadoop.fs.Options.CreateOpts.BlockSize; //导入依赖的package包/类
public static long createFile(FileContext fc, Path path, int numBlocks,
CreateOpts... options) throws IOException {
BlockSize blockSizeOpt = CreateOpts.getOpt(CreateOpts.BlockSize.class, options);
long blockSize = blockSizeOpt != null ? blockSizeOpt.getValue()
: DEFAULT_BLOCK_SIZE;
FSDataOutputStream out =
fc.create(path, EnumSet.of(CreateFlag.CREATE), options);
byte[] data = getFileData(numBlocks, blockSize);
out.write(data, 0, data.length);
out.close();
return data.length;
}
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:13,代码来源:FileContextTestHelper.java
示例4: appendToFile
import org.apache.hadoop.fs.Options.CreateOpts.BlockSize; //导入依赖的package包/类
public static void appendToFile(FileContext fc, Path path, int numBlocks,
CreateOpts... options) throws IOException {
BlockSize blockSizeOpt = CreateOpts.getOpt(CreateOpts.BlockSize.class, options);
long blockSize = blockSizeOpt != null ? blockSizeOpt.getValue()
: DEFAULT_BLOCK_SIZE;
FSDataOutputStream out;
out = fc.create(path, EnumSet.of(CreateFlag.APPEND));
byte[] data = getFileData(numBlocks, blockSize);
out.write(data, 0, data.length);
out.close();
}
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:12,代码来源:FileContextTestHelper.java
示例5: createFile
import org.apache.hadoop.fs.Options.CreateOpts.BlockSize; //导入依赖的package包/类
public long createFile(Path path, int numBlocks, CreateOpts... options)
throws IOException {
BlockSize blockSizeOpt = CreateOpts.getOpt(CreateOpts.BlockSize.class, options);
long blockSize = blockSizeOpt != null ? blockSizeOpt.getValue()
: DEFAULT_BLOCK_SIZE;
FSDataOutputStream out =
create(path, EnumSet.of(CreateFlag.CREATE), options);
byte[] data = getFileData(numBlocks, blockSize);
out.write(data, 0, data.length);
out.close();
return data.length;
}
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:13,代码来源:FileSystemTestWrapper.java
示例6: appendToFile
import org.apache.hadoop.fs.Options.CreateOpts.BlockSize; //导入依赖的package包/类
public void appendToFile(Path path, int numBlocks, CreateOpts... options)
throws IOException {
BlockSize blockSizeOpt = CreateOpts.getOpt(CreateOpts.BlockSize.class, options);
long blockSize = blockSizeOpt != null ? blockSizeOpt.getValue()
: DEFAULT_BLOCK_SIZE;
FSDataOutputStream out;
out = fs.append(path);
byte[] data = getFileData(numBlocks, blockSize);
out.write(data, 0, data.length);
out.close();
}
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:12,代码来源:FileSystemTestWrapper.java
示例7: createFile
import org.apache.hadoop.fs.Options.CreateOpts.BlockSize; //导入依赖的package包/类
public long createFile(Path path, int numBlocks, CreateOpts... options)
throws IOException {
BlockSize blockSizeOpt =
(BlockSize) CreateOpts.getOpt(CreateOpts.BlockSize.class, options);
long blockSize = blockSizeOpt != null ? blockSizeOpt.getValue()
: DEFAULT_BLOCK_SIZE;
FSDataOutputStream out =
fc.create(path, EnumSet.of(CreateFlag.CREATE), options);
byte[] data = getFileData(numBlocks, blockSize);
out.write(data, 0, data.length);
out.close();
return data.length;
}
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:14,代码来源:FileContextTestWrapper.java
示例8: appendToFile
import org.apache.hadoop.fs.Options.CreateOpts.BlockSize; //导入依赖的package包/类
public void appendToFile(Path path, int numBlocks, CreateOpts... options)
throws IOException {
BlockSize blockSizeOpt =
(BlockSize) CreateOpts.getOpt(CreateOpts.BlockSize.class, options);
long blockSize = blockSizeOpt != null ? blockSizeOpt.getValue()
: DEFAULT_BLOCK_SIZE;
FSDataOutputStream out;
out = fc.create(path, EnumSet.of(CreateFlag.APPEND));
byte[] data = getFileData(numBlocks, blockSize);
out.write(data, 0, data.length);
out.close();
}
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:13,代码来源:FileContextTestWrapper.java
示例9: createFile
import org.apache.hadoop.fs.Options.CreateOpts.BlockSize; //导入依赖的package包/类
public static long createFile(FileContext fc, Path path, int numBlocks,
CreateOpts... options) throws IOException {
BlockSize blockSizeOpt =
(BlockSize) CreateOpts.getOpt(CreateOpts.BlockSize.class, options);
long blockSize = blockSizeOpt != null ? blockSizeOpt.getValue()
: DEFAULT_BLOCK_SIZE;
FSDataOutputStream out =
fc.create(path, EnumSet.of(CreateFlag.CREATE), options);
byte[] data = getFileData(numBlocks, blockSize);
out.write(data, 0, data.length);
out.close();
return data.length;
}
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:14,代码来源:FileContextTestHelper.java
示例10: appendToFile
import org.apache.hadoop.fs.Options.CreateOpts.BlockSize; //导入依赖的package包/类
public static void appendToFile(FileContext fc, Path path, int numBlocks,
CreateOpts... options) throws IOException {
BlockSize blockSizeOpt =
(BlockSize) CreateOpts.getOpt(CreateOpts.BlockSize.class, options);
long blockSize = blockSizeOpt != null ? blockSizeOpt.getValue()
: DEFAULT_BLOCK_SIZE;
FSDataOutputStream out;
out = fc.create(path, EnumSet.of(CreateFlag.APPEND));
byte[] data = getFileData(numBlocks, blockSize);
out.write(data, 0, data.length);
out.close();
}
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:13,代码来源:FileContextTestHelper.java
示例11: createFile
import org.apache.hadoop.fs.Options.CreateOpts.BlockSize; //导入依赖的package包/类
public long createFile(Path path, int numBlocks, CreateOpts... options)
throws IOException {
BlockSize blockSizeOpt =
(BlockSize) CreateOpts.getOpt(CreateOpts.BlockSize.class, options);
long blockSize = blockSizeOpt != null ? blockSizeOpt.getValue()
: DEFAULT_BLOCK_SIZE;
FSDataOutputStream out =
create(path, EnumSet.of(CreateFlag.CREATE), options);
byte[] data = getFileData(numBlocks, blockSize);
out.write(data, 0, data.length);
out.close();
return data.length;
}
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:14,代码来源:FileSystemTestWrapper.java
示例12: appendToFile
import org.apache.hadoop.fs.Options.CreateOpts.BlockSize; //导入依赖的package包/类
public void appendToFile(Path path, int numBlocks, CreateOpts... options)
throws IOException {
BlockSize blockSizeOpt =
(BlockSize) CreateOpts.getOpt(CreateOpts.BlockSize.class, options);
long blockSize = blockSizeOpt != null ? blockSizeOpt.getValue()
: DEFAULT_BLOCK_SIZE;
FSDataOutputStream out;
out = fs.append(path);
byte[] data = getFileData(numBlocks, blockSize);
out.write(data, 0, data.length);
out.close();
}
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:13,代码来源:FileSystemTestWrapper.java
注:本文中的org.apache.hadoop.fs.Options.CreateOpts.BlockSize类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论