示例#1
0
        /// <exception cref="System.IO.IOException"/>
        private DeletionService.DeletionTaskRecoveryInfo ParseTaskProto(YarnServerNodemanagerRecoveryProtos.DeletionServiceDeleteTaskProto
                                                                        proto)
        {
            int          taskId    = proto.GetId();
            string       user      = proto.HasUser() ? proto.GetUser() : null;
            Path         subdir    = null;
            IList <Path> basePaths = null;

            if (proto.HasSubdir())
            {
                subdir = new Path(proto.GetSubdir());
            }
            IList <string> basedirs = proto.GetBasedirsList();

            if (basedirs != null && basedirs.Count > 0)
            {
                basePaths = new AList <Path>(basedirs.Count);
                foreach (string basedir in basedirs)
                {
                    basePaths.AddItem(new Path(basedir));
                }
            }
            DeletionService.FileDeletionTask task = new DeletionService.FileDeletionTask(taskId
                                                                                         , this, user, subdir, basePaths);
            return(new DeletionService.DeletionTaskRecoveryInfo(task, proto.GetSuccessorIdsList
                                                                    (), proto.GetDeletionTime()));
        }
示例#2
0
 /// <exception cref="System.IO.IOException"/>
 public override void StoreDeletionTask(int taskId, YarnServerNodemanagerRecoveryProtos.DeletionServiceDeleteTaskProto
                                        taskProto)
 {
     lock (this)
     {
         deleteTasks[taskId] = taskProto;
     }
 }
示例#3
0
        /// <exception cref="System.IO.IOException"/>
        public override void StoreDeletionTask(int taskId, YarnServerNodemanagerRecoveryProtos.DeletionServiceDeleteTaskProto
                                               taskProto)
        {
            string key = DeletionTaskKeyPrefix + taskId;

            try
            {
                db.Put(JniDBFactory.Bytes(key), taskProto.ToByteArray());
            }
            catch (DBException e)
            {
                throw new IOException(e);
            }
        }
 /// <exception cref="System.IO.IOException"/>
 public override void StoreDeletionTask(int taskId, YarnServerNodemanagerRecoveryProtos.DeletionServiceDeleteTaskProto
                                        taskProto)
 {
 }