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; }
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(); }
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; }
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(); }
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; }
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(); }
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; }
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(); }
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; }
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(); }
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; }
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(); }