Example usage for org.apache.hadoop.fs LocalDirAllocator SIZE_UNKNOWN

List of usage examples for org.apache.hadoop.fs LocalDirAllocator SIZE_UNKNOWN

Introduction

In this page you can find the example usage for org.apache.hadoop.fs LocalDirAllocator SIZE_UNKNOWN.

Prototype

int SIZE_UNKNOWN

To view the source code for org.apache.hadoop.fs LocalDirAllocator SIZE_UNKNOWN.

Click Source Link

Document

Used when size of file to be allocated is unknown.

Usage

From source file:com.aliyun.fs.oss.utils.Utils.java

License:Apache License

public static synchronized File getTempBufferDir(Configuration conf) throws IOException {
    File tmpFile = dirAlloc.createTmpFileForWrite("output-", LocalDirAllocator.SIZE_UNKNOWN, conf);
    String dir = tmpFile.toPath().getParent().toUri().getPath();
    LOG.debug("choose oss buffer dir: " + dir);
    return new File(dir, "data/" + loginUser + "/oss");
}

From source file:com.ibm.stocator.fs.swift.SwiftNoStreamingOutputStream.java

License:Open Source License

/**
 * Default constructor//from   w w w  .  j ava 2s  . c  o  m
 *
 * @param account JOSS account object
 * @param url URL connection
 * @param contentTypeT content type
 * @param metadataT input metadata
 * @param connectionManager SwiftConnectionManager
 * @param fsT SwiftAPIClient
 * @throws IOException if error
 */
public SwiftNoStreamingOutputStream(JossAccount account, URL url, final String contentTypeT,
        Map<String, String> metadataT, SwiftConnectionManager connectionManager, SwiftAPIClient fsT)
        throws IOException {
    LOG.debug("SwiftNoStreamingOutputStream constructor entry for {}", url.toString());
    mUrl = url;
    contentType = contentTypeT;
    mAccount = account;
    scm = connectionManager;
    metadata = metadataT;
    fs = fsT;
    try {
        mBackupFile = fs.createTmpFileForWrite("output-", LocalDirAllocator.SIZE_UNKNOWN);

        LOG.debug("OutputStream for key '{}' writing to tempfile: {}", mUrl.toString(), mBackupFile);
        mBackupOutputStream = new BufferedOutputStream(new FileOutputStream(mBackupFile), 32768);
    } catch (IOException e) {
        LOG.error(e.getMessage());
        throw e;
    }

}