Example #1
0
            public override void InitializeApplication(ApplicationInitializationContext context
                                                       )
            {
                ByteBuffer data = context.GetApplicationDataForService();

                NUnit.Framework.Assert.AreEqual(idef, data.GetChar());
                NUnit.Framework.Assert.AreEqual(expected_appId, data.GetInt());
                NUnit.Framework.Assert.AreEqual(expected_appId, context.GetApplicationId().GetId(
                                                    ));
            }
Example #2
0
		public override void InitializeApplication(ApplicationInitializationContext context
			)
		{
			string user = context.GetUser();
			ApplicationId appId = context.GetApplicationId();
			ByteBuffer secret = context.GetApplicationDataForService();
			// TODO these bytes should be versioned
			try
			{
				Org.Apache.Hadoop.Security.Token.Token<JobTokenIdentifier> jt = DeserializeServiceData
					(secret);
				// TODO: Once SHuffle is out of NM, this can use MR APIs
				JobID jobId = new JobID(System.Convert.ToString(appId.GetClusterTimestamp()), appId
					.GetId());
				RecordJobShuffleInfo(jobId, user, jt);
			}
			catch (IOException e)
			{
				Log.Error("Error during initApp", e);
			}
		}