Package org.apache.hadoop.fs

Examples of org.apache.hadoop.fs.FSDataInputStream.readInt()


    docCount = 0;

    FSDataInputStream in = fs.open(file);

    // The docno offset.
    docnoOffset = in.readInt();

    // The size of the document collection.
    int sz = in.readInt() + 1;

    LOG.info("Docno offset: " + docnoOffset);
View Full Code Here


    // The docno offset.
    docnoOffset = in.readInt();

    // The size of the document collection.
    int sz = in.readInt() + 1;

    LOG.info("Docno offset: " + docnoOffset);
    LOG.info("Number of docs: " + (sz - 1));

    // Initialize an array to hold all the doc lengths.
View Full Code Here

    // Initialize an array to hold all the doc lengths.
    lengths = new short[sz];

    // Read each doc length.
    for (int i = 1; i < sz; i++) {
      int l = in.readInt();
      docLengthSum += l;

      lengths[i] = l > (Short.MAX_VALUE - Short.MIN_VALUE) ? Short.MAX_VALUE
          : (short) (l + Short.MIN_VALUE);
      docCount++;
View Full Code Here

    Preconditions.checkNotNull(file);
    Preconditions.checkNotNull(fs);

    FSDataInputStream in = fs.open(file);

    this.numTerms = in.readInt();

    cfs = new long[numTerms];

    for (int i = 0; i < numTerms; i++) {
      long cf = WritableUtils.readVLong(in);
View Full Code Here

    Preconditions.checkNotNull(file);
    Preconditions.checkNotNull(fs);

    FSDataInputStream in = fs.open(file);

    this.numTerms = in.readInt();

    dfs = new int[numTerms];

    for (int i = 0; i < numTerms; i++) {
      int df = WritableUtils.readVInt(in);
View Full Code Here

   * @throws IOException
   */
  public DfTableArray(String file, FileSystem fs) throws IOException {
    FSDataInputStream in = fs.open(new Path(file));

    this.mNumDocs = in.readInt();
    this.mNumTerms = in.readInt();

    mTerms = new String[mNumTerms];
    mDfs = new int[mNumTerms];

View Full Code Here

   */
  public DfTableArray(String file, FileSystem fs) throws IOException {
    FSDataInputStream in = fs.open(new Path(file));

    this.mNumDocs = in.readInt();
    this.mNumTerms = in.readInt();

    mTerms = new String[mNumTerms];
    mDfs = new int[mNumTerms];

    for (int i = 0; i < mNumTerms; i++) {
View Full Code Here

    for (int i = 0; i < mNumTerms; i++) {
      String term = in.readUTF();
     
      //changed by Ferhan Ture : df table isn't read properly with commented line
      //int df = WritableUtils.readVInt(in);
      int df = in.readInt();
     
      mTerms[i] = term;
      mDfs[i] = df;

      if (df > mMaxDf) {
View Full Code Here

    RetrievalEnvironment env = new RetrievalEnvironment(indexPath, fs);
    path = env.getTermDocVectorsDirectory();

    FSDataInputStream posInput = fs.open(new Path(env.getTermDocVectorsForwardIndex()));

    docnoOffset = posInput.readInt();
    collectionDocumentCount = posInput.readInt();

    positions = new long[collectionDocumentCount];
    for (int i = 0; i < collectionDocumentCount; i++) {
      positions[i] = posInput.readLong();
View Full Code Here

    path = env.getTermDocVectorsDirectory();

    FSDataInputStream posInput = fs.open(new Path(env.getTermDocVectorsForwardIndex()));

    docnoOffset = posInput.readInt();
    collectionDocumentCount = posInput.readInt();

    positions = new long[collectionDocumentCount];
    for (int i = 0; i < collectionDocumentCount; i++) {
      positions[i] = posInput.readLong();
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.