Search in sources :

Example 11 with MiniMRYarnCluster

use of org.apache.hadoop.mapreduce.v2.MiniMRYarnCluster in project hadoop by apache.

the class TestBinaryTokenFile method setUp.

@BeforeClass
public static void setUp() throws Exception {
    final Configuration conf = new Configuration();
    conf.set(MRConfig.FRAMEWORK_NAME, MRConfig.YARN_FRAMEWORK_NAME);
    conf.set(YarnConfiguration.RM_PRINCIPAL, "jt_id/" + SecurityUtil.HOSTNAME_PATTERN + "@APACHE.ORG");
    final MiniDFSCluster.Builder builder = new MiniDFSCluster.Builder(conf);
    builder.checkExitOnShutdown(true);
    builder.numDataNodes(NUMWORKERS);
    builder.format(true);
    builder.racks(null);
    dfsCluster = builder.build();
    mrCluster = new MiniMRYarnCluster(TestBinaryTokenFile.class.getName(), noOfNMs);
    mrCluster.init(conf);
    mrCluster.start();
    NameNodeAdapter.getDtSecretManager(dfsCluster.getNamesystem()).startThreads();
    FileSystem fs = dfsCluster.getFileSystem();
    p1 = new Path("file1");
    p1 = fs.makeQualified(p1);
}
Also used : Path(org.apache.hadoop.fs.Path) MiniDFSCluster(org.apache.hadoop.hdfs.MiniDFSCluster) YarnConfiguration(org.apache.hadoop.yarn.conf.YarnConfiguration) Configuration(org.apache.hadoop.conf.Configuration) MiniMRYarnCluster(org.apache.hadoop.mapreduce.v2.MiniMRYarnCluster) FileSystem(org.apache.hadoop.fs.FileSystem) BeforeClass(org.junit.BeforeClass)

Aggregations

MiniMRYarnCluster (org.apache.hadoop.mapreduce.v2.MiniMRYarnCluster)11 Configuration (org.apache.hadoop.conf.Configuration)10 Path (org.apache.hadoop.fs.Path)8 YarnConfiguration (org.apache.hadoop.yarn.conf.YarnConfiguration)7 Test (org.junit.Test)5 FileSystem (org.apache.hadoop.fs.FileSystem)4 File (java.io.File)3 FsPermission (org.apache.hadoop.fs.permission.FsPermission)3 MiniDFSCluster (org.apache.hadoop.hdfs.MiniDFSCluster)2 TimelineEntities (org.apache.hadoop.yarn.api.records.timeline.TimelineEntities)2 TimelineEntity (org.apache.hadoop.yarn.api.records.timeline.TimelineEntity)2 TimelineStore (org.apache.hadoop.yarn.server.timeline.TimelineStore)2 BeforeClass (org.junit.BeforeClass)2 DistributedFileSystem (org.apache.hadoop.hdfs.DistributedFileSystem)1 JobClient (org.apache.hadoop.mapred.JobClient)1 JobConf (org.apache.hadoop.mapred.JobConf)1 JobStatus (org.apache.hadoop.mapred.JobStatus)1 Job (org.apache.hadoop.mapreduce.Job)1 ApplicationId (org.apache.hadoop.yarn.api.records.ApplicationId)1 ApplicationReport (org.apache.hadoop.yarn.api.records.ApplicationReport)1