Search in sources :

Example 46 with Configuration

use of org.apache.hadoop.conf.Configuration in project hadoop by apache.

the class SSLFactory method readSSLConfiguration.

public static Configuration readSSLConfiguration(Configuration conf, Mode mode) {
    Configuration sslConf = new Configuration(false);
    sslConf.setBoolean(SSL_REQUIRE_CLIENT_CERT_KEY, conf.getBoolean(SSL_REQUIRE_CLIENT_CERT_KEY, SSL_REQUIRE_CLIENT_CERT_DEFAULT));
    String sslConfResource;
    if (mode == Mode.CLIENT) {
        sslConfResource = conf.get(SSL_CLIENT_CONF_KEY, SSL_CLIENT_CONF_DEFAULT);
    } else {
        sslConfResource = conf.get(SSL_SERVER_CONF_KEY, SSL_SERVER_CONF_DEFAULT);
    }
    sslConf.addResource(sslConfResource);
    return sslConf;
}
Also used : Configuration(org.apache.hadoop.conf.Configuration)

Example 47 with Configuration

use of org.apache.hadoop.conf.Configuration in project hadoop by apache.

the class TraceAdmin method main.

public static void main(String[] argv) throws Exception {
    TraceAdmin admin = new TraceAdmin();
    admin.setConf(new Configuration());
    System.exit(admin.run(argv));
}
Also used : Configuration(org.apache.hadoop.conf.Configuration)

Example 48 with Configuration

use of org.apache.hadoop.conf.Configuration in project hadoop by apache.

the class CredentialShell method main.

/**
   * Main program.
   *
   * @param args
   *          Command line arguments
   * @throws Exception
   */
public static void main(String[] args) throws Exception {
    int res = ToolRunner.run(new Configuration(), new CredentialShell(), args);
    System.exit(res);
}
Also used : Configuration(org.apache.hadoop.conf.Configuration)

Example 49 with Configuration

use of org.apache.hadoop.conf.Configuration in project hadoop by apache.

the class DefaultImpersonationProvider method getTestProvider.

public static synchronized DefaultImpersonationProvider getTestProvider() {
    if (testProvider == null) {
        testProvider = new DefaultImpersonationProvider();
        testProvider.setConf(new Configuration());
        testProvider.init(ProxyUsers.CONF_HADOOP_PROXYUSER);
    }
    return testProvider;
}
Also used : Configuration(org.apache.hadoop.conf.Configuration)

Example 50 with Configuration

use of org.apache.hadoop.conf.Configuration in project flink by apache.

the class HadoopOutputFormatTest method testCloseWithNeedsTaskCommitFalse.

@Test
public void testCloseWithNeedsTaskCommitFalse() throws Exception {
    RecordWriter<String, Long> recordWriter = Mockito.mock(DummyRecordWriter.class);
    OutputCommitter outputCommitter = setupOutputCommitter(false);
    HadoopOutputFormat<String, Long> hadoopOutputFormat = setupHadoopOutputFormat(new DummyOutputFormat(), Job.getInstance(), recordWriter, outputCommitter, new Configuration());
    hadoopOutputFormat.close();
    verify(outputCommitter, times(0)).commitTask(any(TaskAttemptContext.class));
    verify(recordWriter, times(1)).close(any(TaskAttemptContext.class));
}
Also used : OutputCommitter(org.apache.hadoop.mapreduce.OutputCommitter) Configuration(org.apache.hadoop.conf.Configuration) Mockito.anyLong(org.mockito.Mockito.anyLong) TaskAttemptContext(org.apache.hadoop.mapreduce.TaskAttemptContext) Mockito.anyString(org.mockito.Mockito.anyString) Test(org.junit.Test)

Aggregations

Configuration (org.apache.hadoop.conf.Configuration)5973 Test (org.junit.Test)3243 Path (org.apache.hadoop.fs.Path)1602 FileSystem (org.apache.hadoop.fs.FileSystem)903 IOException (java.io.IOException)850 YarnConfiguration (org.apache.hadoop.yarn.conf.YarnConfiguration)727 HdfsConfiguration (org.apache.hadoop.hdfs.HdfsConfiguration)517 MiniDFSCluster (org.apache.hadoop.hdfs.MiniDFSCluster)502 File (java.io.File)499 HBaseConfiguration (org.apache.hadoop.hbase.HBaseConfiguration)388 ArrayList (java.util.ArrayList)360 URI (java.net.URI)319 BeforeClass (org.junit.BeforeClass)275 Job (org.apache.hadoop.mapreduce.Job)272 Before (org.junit.Before)264 DistributedFileSystem (org.apache.hadoop.hdfs.DistributedFileSystem)219 FSDataOutputStream (org.apache.hadoop.fs.FSDataOutputStream)203 HashMap (java.util.HashMap)192 FileStatus (org.apache.hadoop.fs.FileStatus)190 Properties (java.util.Properties)187