Example #1
0
        /// <exception cref="System.IO.IOException"/>
        internal static LocalResource CreateJar(FileContext files, Path p, LocalResourceVisibility
                                                vis)
        {
            Log.Info("Create jar file " + p);
            FilePath         jarFile = new FilePath((files.MakeQualified(p)).ToUri());
            FileOutputStream stream  = new FileOutputStream(jarFile);

            Log.Info("Create jar out stream ");
            JarOutputStream @out = new JarOutputStream(stream, new Manifest());

            Log.Info("Done writing jar stream ");
            @out.Close();
            LocalResource ret = recordFactory.NewRecordInstance <LocalResource>();

            ret.SetResource(ConverterUtils.GetYarnUrlFromPath(p));
            FileStatus status = files.GetFileStatus(p);

            ret.SetSize(status.GetLen());
            ret.SetTimestamp(status.GetModificationTime());
            ret.SetType(LocalResourceType.Pattern);
            ret.SetVisibility(vis);
            ret.SetPattern("classes/.*");
            return(ret);
        }
 public virtual void TestInvalidContainerId()
 {
     ConverterUtils.ToContainerId("container_e20_1423221031460_0003_01");
 }
 public virtual void TestApplicationId()
 {
     ConverterUtils.ToApplicationId("application_1423221031460");
 }
 public virtual void TestContainerIdNull()
 {
     NUnit.Framework.Assert.IsNull(ConverterUtils.ToString((ContainerId)null));
 }
 public virtual void TestInvalidAppattemptId()
 {
     ConverterUtils.ToApplicationAttemptId("appattempt_1423221031460");
 }