Exemple #1
0
 /// <summary>Add an InputSplit to this collection.</summary>
 /// <exception cref="System.IO.IOException">
 /// If capacity was not specified during construction
 /// or if capacity has been reached.
 /// </exception>
 public virtual void Add(InputSplit s)
 {
     if (null == splits)
     {
         throw new IOException("Uninitialized InputSplit");
     }
     if (fill == splits.Length)
     {
         throw new IOException("Too many splits");
     }
     splits[fill++] = s;
     totsize       += s.GetLength();
 }
Exemple #2
0
 /// <exception cref="System.IO.IOException"/>
 public SplitMetaInfo(InputSplit split, long startOffset)
 {
     try
     {
         this.locations       = split.GetLocations();
         this.inputDataLength = split.GetLength();
         this.startOffset     = startOffset;
     }
     catch (Exception ie)
     {
         throw new IOException(ie);
     }
 }
Exemple #3
0
            /// <exception cref="System.IO.IOException"/>
            /// <exception cref="System.Exception"/>
            public override void Initialize(InputSplit split, TaskAttemptContext context)
            {
                Path          path = ((FileSplit)split).GetPath();
                Configuration conf = context.GetConfiguration();
                FileSystem    fs   = path.GetFileSystem(conf);

                this.@in = new SequenceFile.Reader(fs, path, conf);
                this.end = ((FileSplit)split).GetStart() + split.GetLength();
                if (((FileSplit)split).GetStart() > @in.GetPosition())
                {
                    @in.Sync(((FileSplit)split).GetStart());
                }
                // sync to start
                this.start = @in.GetPosition();
                vbytes     = @in.CreateValueBytes();
                done       = start >= end;
            }
 /// <exception cref="System.IO.IOException"/>
 public virtual long GetLength()
 {
     return(inputSplit.GetLength());
 }
 /// <exception cref="System.IO.IOException"/>
 /// <exception cref="System.Exception"/>
 public override long GetLength()
 {
     return(inputSplit.GetLength());
 }
Exemple #6
0
 /// <exception cref="System.Exception"/>
 /// <exception cref="System.IO.IOException"/>
 public TaskSplitMetaInfo(InputSplit split, long startOffset)
     : this(new JobSplit.TaskSplitIndex(string.Empty, startOffset), split.GetLocations
                (), split.GetLength())
 {
 }