Ejemplo n.º 1
0
 public HistoryClientService(HistoryContext history, JHSDelegationTokenSecretManager
                             jhsDTSecretManager)
     : base("HistoryClientService")
 {
     this.history            = history;
     this.protocolHandler    = new HistoryClientService.HSClientProtocolHandler(this);
     this.jhsDTSecretManager = jhsDTSecretManager;
 }
Ejemplo n.º 2
0
        private HSClientProtocol InstantiateHistoryProxy()
        {
            string           serviceAddr   = mrCluster.GetConfig().Get(JHAdminConfig.MrHistoryAddress);
            YarnRPC          rpc           = YarnRPC.Create(conf);
            HSClientProtocol historyClient = (HSClientProtocol)rpc.GetProxy(typeof(HSClientProtocol
                                                                                   ), NetUtils.CreateSocketAddr(serviceAddr), mrCluster.GetConfig());

            return(historyClient);
        }
Ejemplo n.º 3
0
        /// <exception cref="System.IO.IOException"/>
        /// <exception cref="System.Exception"/>
        /// <exception cref="Org.Apache.Avro.AvroRemoteException"/>
        /// <exception cref="System.TypeLoadException"/>
        public virtual void TestJobHistoryData()
        {
            if (!(new FilePath(MiniMRYarnCluster.Appjar)).Exists())
            {
                Log.Info("MRAppJar " + MiniMRYarnCluster.Appjar + " not found. Not running test."
                         );
                return;
            }
            SleepJob sleepJob = new SleepJob();

            sleepJob.SetConf(mrCluster.GetConfig());
            // Job with 3 maps and 2 reduces
            Job job = sleepJob.CreateJob(3, 2, 1000, 1, 500, 1);

            job.SetJarByClass(typeof(SleepJob));
            job.AddFileToClassPath(AppJar);
            // The AppMaster jar itself.
            job.WaitForCompletion(true);
            Counters      counterMR   = job.GetCounters();
            JobId         jobId       = TypeConverter.ToYarn(job.GetJobID());
            ApplicationId appID       = jobId.GetAppId();
            int           pollElapsed = 0;

            while (true)
            {
                Sharpen.Thread.Sleep(1000);
                pollElapsed += 1000;
                if (TerminalRmAppStates.Contains(mrCluster.GetResourceManager().GetRMContext().GetRMApps
                                                     ()[appID].GetState()))
                {
                    break;
                }
                if (pollElapsed >= 60000)
                {
                    Log.Warn("application did not reach terminal state within 60 seconds");
                    break;
                }
            }
            NUnit.Framework.Assert.AreEqual(RMAppState.Finished, mrCluster.GetResourceManager
                                                ().GetRMContext().GetRMApps()[appID].GetState());
            Counters counterHS = job.GetCounters();

            //TODO the Assert below worked. need to check
            //Should we compare each field or convert to V2 counter and compare
            Log.Info("CounterHS " + counterHS);
            Log.Info("CounterMR " + counterMR);
            NUnit.Framework.Assert.AreEqual(counterHS, counterMR);
            HSClientProtocol    historyClient = InstantiateHistoryProxy();
            GetJobReportRequest gjReq         = Org.Apache.Hadoop.Yarn.Util.Records.NewRecord <GetJobReportRequest
                                                                                               >();

            gjReq.SetJobId(jobId);
            JobReport jobReport = historyClient.GetJobReport(gjReq).GetJobReport();

            VerifyJobReport(jobReport, jobId);
        }
Ejemplo n.º 4
0
 public HSClientProtocolPBServiceImpl(HSClientProtocol impl)
     : base(impl)
 {
 }