Package org.terrier.utility.io

Examples of org.terrier.utility.io.WrappedIOException


    final String outputPrefix = "-" + reduceId;
    try{
      Class<DirectInvertedOutputStream> c = (Class<DirectInvertedOutputStream>)jc.getClass("Inv2Direct.DirectInvertedOutputStream", DirectInvertedOutputStream.class);
      postingOutputStream = c.getConstructor(String.class).newInstance(currentIndex.getPath() + ApplicationSetup.FILE_SEPARATOR + currentIndex.getPrefix() + "." + jc.get("Inv2Direct.TargetStructure")+outputPrefix + BitIn.USUAL_EXTENSION);
    } catch (Exception e) {
      throw new WrappedIOException(e);
    }
   
    //logger.info("Writing pointers to" + currentIndex.getPath() + ApplicationSetup.FILE_SEPARATOR + currentIndex.getPrefix() + "." + jc.get("Inv2Direct.TargetStructure") +outputPrefix+ ".pointers");
    pointerOutputStream = new DataOutputStream(Files.writeFileStream(currentIndex.getPath() + ApplicationSetup.FILE_SEPARATOR + currentIndex.getPrefix() + "." + jc.get("Inv2Direct.TargetStructure") +outputPrefix+ ".pointers"));
    final int numberOfDocuments = jc.getInt("Inv2Direct.numDocuments", -1);
View Full Code Here


    this.collectionIndex = 0;
    this.currentDocument = 0;
    try{
      HadoopUtility.loadTerrierJob(_jobConf);
    } catch (Exception e) {
      throw new WrappedIOException("Cannot load ApplicationSetup", e);
    }
  }
View Full Code Here

      Class<?> c = Class.forName(className, false, this.getClass().getClassLoader());
      split = (T)c.newInstance();
      split.readFields(in);
      splitnum = in.readInt();
    } catch (Exception e) {
      throw new WrappedIOException("Error during the reading of fields of a new PositionAwareSplit", e);
    }
  }
View Full Code Here

      {
        Class<? extends InputStream> filterClass = inputStreamMap.get(regex);
        try{
          rtr = filterClass.getConstructor(InputStream.class).newInstance(rtr);
        } catch (Exception e) {
          throw new WrappedIOException(e);
        }
      }
    }
    return rtr;
  }
View Full Code Here

      {
        Class<? extends OutputStream> filterClass = outputStreamMap.get(regex);
        try{
          rtr = filterClass.getConstructor(OutputStream.class).newInstance(rtr);
        } catch (Exception e) {
          throw new WrappedIOException(e);
        }
      }
    }
    return rtr;
  }
View Full Code Here

    try{
      postingConstructor = fieldCount > 0
        ? postingIteratorClass.getConstructor(BitIn.class, Integer.TYPE, DocumentIndex.class, Integer.TYPE)
        : postingIteratorClass.getConstructor(BitIn.class, Integer.TYPE, DocumentIndex.class);
    }catch (Exception e) {
      throw new WrappedIOException(e);
    }
  }
View Full Code Here

    try{
      postingConstructor = fieldCount > 0
        ? postingIteratorClass.getConstructor(BitIn.class, Integer.TYPE, DocumentIndex.class, Integer.TYPE)
        : postingIteratorClass.getConstructor(BitIn.class, Integer.TYPE, DocumentIndex.class);
    }catch (Exception e) {
      throw new WrappedIOException(e);
    }
  }
View Full Code Here

    try{
      rtr = (fieldCount > 0)
        ? postingConstructor.newInstance(file, pointer.getNumberOfEntries(), getDocumentIndex(pointer), fieldCount)
        : postingConstructor.newInstance(file, pointer.getNumberOfEntries(), getDocumentIndex(pointer));
    } catch (Exception e) {
      throw new WrappedIOException("Problem creating IterablePosting", e);
    }
    return rtr;
  }
View Full Code Here

        reporter.incrCounter(Counters.INDEXED_TOKENS, numOfTokensInDocument);
        reporter.incrCounter(Counters.INDEXED_POINTERS, termsInDocument.getNumberOfPointers());
      } catch (IOException ioe) {
        throw ioe;       
      } catch (Exception e) {
        throw new WrappedIOException(e);
      }
    }
    termsInDocument.clear();
    reporter.incrCounter(Counters.INDEXED_DOCUMENTS, 1);
  }
View Full Code Here

    runIteratorF.setRunPostingIterator(postingIterator);
    runIteratorF.setTerm(term);
    try{
      merger.mergeOne(lexstream);
    } catch (Exception e) {
      throw new WrappedIOException(e);
    }
    reporter.progress();
    this.lastReporter = reporter;
  }
View Full Code Here

TOP

Related Classes of org.terrier.utility.io.WrappedIOException

Copyright © 2018 www.massapicom. 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.