public static JobId NewJobId(ApplicationId appId, int id)
        {
            JobId jobId = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <JobId>();

            jobId.SetAppId(appId);
            jobId.SetId(id);
            return(jobId);
        }
Exemple #2
0
        public static JobId NewJobID(ApplicationId appID, int i)
        {
            JobId id = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <JobId>();

            id.SetAppId(appID);
            id.SetId(i);
            return(id);
        }
Exemple #3
0
        public static JobId ToYarn(JobID id)
        {
            JobId jobId = recordFactory.NewRecordInstance <JobId>();

            jobId.SetId(id.GetId());
            //currently there is 1-1 mapping between appid and jobid
            ApplicationId appId = ApplicationId.NewInstance(ToClusterTimeStamp(id.GetJtIdentifier
                                                                                   ()), id.GetId());

            jobId.SetAppId(appId);
            return(jobId);
        }
Exemple #4
0
        public virtual void TestFromYarnJobReport()
        {
            int           jobStartTime  = 612354;
            int           jobFinishTime = 612355;
            JobState      state         = JobState.Running;
            JobId         jobId         = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <JobId>();
            JobReport     jobReport     = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <JobReport>();
            ApplicationId applicationId = ApplicationId.NewInstance(0, 0);

            jobId.SetAppId(applicationId);
            jobId.SetId(0);
            jobReport.SetJobId(jobId);
            jobReport.SetJobState(state);
            jobReport.SetStartTime(jobStartTime);
            jobReport.SetFinishTime(jobFinishTime);
            jobReport.SetUser("TestTypeConverter-user");
            JobStatus jobStatus = TypeConverter.FromYarn(jobReport, "dummy-jobfile");

            NUnit.Framework.Assert.AreEqual(jobStartTime, jobStatus.GetStartTime());
            NUnit.Framework.Assert.AreEqual(jobFinishTime, jobStatus.GetFinishTime());
            NUnit.Framework.Assert.AreEqual(state.ToString(), jobStatus.GetState().ToString()
                                            );
        }
Exemple #5
0
 public virtual void Setup()
 {
     dispatcher = new InlineDispatcher();
     ++startCount;
     conf = new JobConf();
     taskAttemptListener = Org.Mockito.Mockito.Mock <TaskAttemptListener>();
     jobToken            = (Org.Apache.Hadoop.Security.Token.Token <JobTokenIdentifier>)Org.Mockito.Mockito.Mock
                           <Org.Apache.Hadoop.Security.Token.Token>();
     remoteJobConfFile = Org.Mockito.Mockito.Mock <Path>();
     credentials       = null;
     clock             = new SystemClock();
     metrics           = Org.Mockito.Mockito.Mock <MRAppMetrics>();
     dataLocations     = new string[1];
     appId             = ApplicationId.NewInstance(Runtime.CurrentTimeMillis(), 1);
     jobId             = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <JobId>();
     jobId.SetId(1);
     jobId.SetAppId(appId);
     appContext        = Org.Mockito.Mockito.Mock <AppContext>();
     taskSplitMetaInfo = Org.Mockito.Mockito.Mock <JobSplit.TaskSplitMetaInfo>();
     Org.Mockito.Mockito.When(taskSplitMetaInfo.GetLocations()).ThenReturn(dataLocations
                                                                           );
     taskAttempts = new AList <TestTaskImpl.MockTaskAttemptImpl>();
 }