Example usage for org.apache.hadoop.fs.permission FsPermission getUMask

List of usage examples for org.apache.hadoop.fs.permission FsPermission getUMask

Introduction

In this page you can find the example usage for org.apache.hadoop.fs.permission FsPermission getUMask.

Prototype

public static FsPermission getUMask(Configuration conf) 

Source Link

Document

Get the user file creation mask (umask) UMASK_LABEL config param has umask value that is either symbolic or octal.

Usage

From source file:com.quantcast.qfs.hadoop.QFSEmulationImpl.java

License:Apache License

public QFSEmulationImpl(Configuration conf) throws IOException {
    localFS = FileSystem.getLocal(conf);
    umask = FsPermission.getUMask(conf).toShort();
}

From source file:com.quantcast.qfs.hadoop.QuantcastFileSystem.java

License:Apache License

public void initialize(URI uri, Configuration conf) throws IOException {
    super.initialize(uri, conf);
    setConf(conf);// w w w  .  j a  v a  2 s. co  m

    try {
        if (qfsImpl == null) {
            if (uri.getHost() == null) {
                qfsImpl = createIFSImpl(conf.get("fs.qfs.metaServerHost", ""),
                        conf.getInt("fs.qfs.metaServerPort", -1), statistics, conf);
            } else {
                qfsImpl = createIFSImpl(uri.getHost(), uri.getPort(), statistics, conf);
            }
        }

        this.localFs = FileSystem.getLocal(conf);
        this.uri = URI
                .create(uri.getScheme() + "://" + (uri.getAuthority() == null ? "/" : uri.getAuthority()));
        this.workingDir = new Path("/user", System.getProperty("user.name")).makeQualified(uri, null);
        this.qfsImpl.setUMask(FsPermission.getUMask(conf).toShort());
    } catch (Exception e) {
        throw new IOException("Unable to initialize QFS using uri " + uri);
    }
}

From source file:org.apache.falcon.hadoop.HadoopClientFactory.java

License:Apache License

public static FsPermission getDirDefaultPermission(Configuration conf) {
    return getDirDefault().applyUMask(FsPermission.getUMask(conf));
}

From source file:org.apache.falcon.hadoop.HadoopClientFactory.java

License:Apache License

public static FsPermission getFileDefaultPermission(Configuration conf) {
    return getFileDefault().applyUMask(FsPermission.getUMask(conf));
}

From source file:org.apache.solr.store.hdfs.HdfsFileWriter.java

License:Apache License

public HdfsFileWriter(FileSystem fileSystem, Path path) throws IOException {
    LOG.debug("Creating writer on {}", path);
    this.path = path;

    Configuration conf = fileSystem.getConf();
    FsServerDefaults fsDefaults = fileSystem.getServerDefaults(path);
    EnumSet<CreateFlag> flags = EnumSet.of(CreateFlag.CREATE, CreateFlag.OVERWRITE);
    if (Boolean.getBoolean(HDFS_SYNC_BLOCK)) {
        flags.add(CreateFlag.SYNC_BLOCK);
    }//from  ww w  . jav  a2 s .c  o m
    outputStream = fileSystem.create(path, FsPermission.getDefault().applyUMask(FsPermission.getUMask(conf)),
            flags, fsDefaults.getFileBufferSize(), fsDefaults.getReplication(), fsDefaults.getBlockSize(),
            null);
}