コード例 #1
0
ファイル: SetFile.cs プロジェクト: orf53975/hadoop.net
 /// <summary>Read the matching key from a set into <code>key</code>.</summary>
 /// <remarks>
 /// Read the matching key from a set into <code>key</code>.
 /// Returns <code>key</code>, or null if no match exists.
 /// </remarks>
 /// <exception cref="System.IO.IOException"/>
 public virtual IWritableComparable Get(IWritableComparable key)
 {
     if (Seek(key))
     {
         Next(key);
         return(key);
     }
     else
     {
         return(null);
     }
 }
コード例 #2
0
ファイル: Display.cs プロジェクト: orf53975/hadoop.net
            /// <exception cref="System.IO.IOException"/>
            public TextRecordInputStream(Display _enclosing, FileStatus f)
            {
                this._enclosing = _enclosing;
                Path          fpath = f.GetPath();
                Configuration lconf = this._enclosing.GetConf();

                this.r   = new SequenceFile.Reader(lconf, SequenceFile.Reader.File(fpath));
                this.key = ReflectionUtils.NewInstance(this.r.GetKeyClass().AsSubclass <IWritableComparable <> >(), lconf);
                this.val = ReflectionUtils.NewInstance(this.r.GetValueClass().AsSubclass <IWritable
                                                                                          >(), lconf);
                this.inbuf  = new DataInputBuffer();
                this.outbuf = new DataOutputBuffer();
            }