Examples of JobContext


Examples of org.apache.hadoop.mapreduce.JobContext

   
    CommitterEventHandler handler = new CommitterEventHandler(mockContext,
        mockCommitter, new TestingRMHeartbeatHandler());
    YarnConfiguration conf = new YarnConfiguration();
    conf.set(MRJobConfig.MR_AM_STAGING_DIR, stagingDir);
    JobContext mockJobContext = mock(JobContext.class);
    ApplicationAttemptId attemptid =
      ConverterUtils.toApplicationAttemptId("appattempt_1234567890000_0001_0");
    JobId jobId =  TypeConverter.toYarn(
        TypeConverter.fromYarn(attemptid.getApplicationId()));
   
View Full Code Here

Examples of org.apache.hadoop.mapreduce.JobContext

   
    CommitterEventHandler handler = new CommitterEventHandler(mockContext,
        mockCommitter, new TestingRMHeartbeatHandler());
    YarnConfiguration conf = new YarnConfiguration();
    conf.set(MRJobConfig.MR_AM_STAGING_DIR, stagingDir);
    JobContext mockJobContext = mock(JobContext.class);
    ApplicationAttemptId attemptid =
      ConverterUtils.toApplicationAttemptId("appattempt_1234567890000_0001_0");
    JobId jobId =  TypeConverter.toYarn(
        TypeConverter.fromYarn(attemptid.getApplicationId()));
   
View Full Code Here

Examples of org.apache.hadoop.mapreduce.JobContext

  job.setInputFormatClass(FileInputFormat.class);

  Configuration conf = job.getConfiguration();
  FileInputFormat.setInputPaths(job, new Path(baseDir.getAbsolutePath()));

  JobContext jobContext = new JobContext(conf, job.getJobID());

  partitionHelper.setPartitionFilterExpression("year < '2010'",
    PigStorage.class, "1");
  partitionHelper.setPartitionKeys(baseDir.getAbsolutePath(), conf,
    PigStorage.class, "1");
View Full Code Here

Examples of org.apache.hadoop.mapreduce.JobContext

  job.setInputFormatClass(FileInputFormat.class);

  Configuration conf = job.getConfiguration();
  FileInputFormat.setInputPaths(job, new Path(baseDir.getAbsolutePath()));

  JobContext jobContext = new JobContext(conf, job.getJobID());

  partitionHelper.setPartitionFilterExpression(
    "year<='2010' and month=='01' and day>='01'", PigStorage.class, "2");
  partitionHelper.setPartitionKeys(baseDir.getAbsolutePath(), conf,
    PigStorage.class, "2");
View Full Code Here

Examples of org.apache.hadoop.mapreduce.JobContext

  job.setInputFormatClass(FileInputFormat.class);

  Configuration conf = job.getConfiguration();
  FileInputFormat.setInputPaths(job, new Path(baseDir.getAbsolutePath()));

  JobContext jobContext = new JobContext(conf, job.getJobID());

  partitionHelper.setPartitionKeys(baseDir.getAbsolutePath(), conf,
    PigStorage.class, "3");

  List<FileStatus> files = partitionHelper.listStatus(jobContext,
View Full Code Here

Examples of org.apache.hadoop.mapreduce.JobContext

   
    public void store(DataBag data, FuncSpec storeFuncSpec, PigContext pigContext) throws IOException {
        Configuration conf = ConfigurationUtil.toConfiguration(pigContext.getProperties());
        // create a simulated JobContext
        JobContext jc = new JobContext(conf, new JobID());
        StoreFuncInterface sfunc = (StoreFuncInterface)PigContext.instantiateFuncFromSpec(
                storeFuncSpec);
        OutputFormat<?,?> of = sfunc.getOutputFormat();
       
        POStore store = new POStore(new OperatorKey());
View Full Code Here

Examples of org.apache.hadoop.mapreduce.JobContext

        // The above setLocation call could write to the conf within
        // the job - get a hold of the modified conf
        conf = job.getConfiguration();
        inputFormat = wrappedLoadFunc.getInputFormat();
        try {
            inpSplits = inputFormat.getSplits(new JobContext(conf,
                    new JobID()));
        } catch (InterruptedException e) {
            throw new IOException(e);
        }       
    }
View Full Code Here

Examples of org.apache.hadoop.mapreduce.JobContext

                            .instantiateFuncFromSpec(ld.getLFile()
                                    .getFuncSpec());
                            Job job = new Job(conf);
                            loader.setLocation(location, job);
                            InputFormat inf = loader.getInputFormat();
                            List<InputSplit> splits = inf.getSplits(new JobContext(
                                    job.getConfiguration(), job.getJobID()));
                            List<List<InputSplit>> results = MapRedUtil
                            .getCombinePigSplits(splits, fs
                                    .getDefaultBlockSize(), conf);
                            numFiles += results.size();
View Full Code Here

Examples of org.apache.hadoop.mapreduce.JobContext

     * @param job
     * @param st
     * @throws IOException
     */
    private void storeSchema(Job job, POStore st) throws IOException {
        JobContext jc = new JobContext(job.getJobConf(),
                new org.apache.hadoop.mapreduce.JobID());
        JobContext updatedJc = PigOutputCommitter.setUpContext(jc, st);
        PigOutputCommitter.storeCleanup(st, updatedJc.getConfiguration());
    }
View Full Code Here

Examples of org.apache.hadoop.mapreduce.JobContext

    private void checkOutputSpecsHelper(List<POStore> stores, JobContext
            jobcontext) throws IOException, InterruptedException {
        for (POStore store : stores) {
            // make a copy of the original JobContext so that
            // each OutputFormat get a different copy
            JobContext jobContextCopy = new JobContext(
                    jobcontext.getConfiguration(), jobcontext.getJobID());
           
            // set output location
            PigOutputFormat.setLocation(jobContextCopy, store);
           
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.