siStream = new SegmentedInputStream( openFileStream( file[ currentFileIndex ] ) );
siStream = new SegmentedInputStream( openFileStream( file[ currentFileIndex ] ) );
siStream = new SegmentedInputStream( openFileStream( file[ currentFileIndex ] ) );
siStream = new SegmentedInputStream( openFileStream( file[ currentFileIndex ] ) );
public InputStream stream( final long n ) throws IOException { // Creates a Segmented Input Stream with only one segment in (the requested one). ensureDocumentIndex( n ); IOUtils.closeQuietly( lastStream ); final TRECDocumentDescriptor descr = descriptors.get( n ); return lastStream = new SegmentedInputStream( openFileStream( file[ descr.fileIndex ] ), descr.toSegments() ); }
public InputStream stream( final long n ) throws IOException { // Creates a Segmented Input Stream with only one segment in (the requested one). ensureDocumentIndex( n ); IOUtils.closeQuietly( lastStream ); final TRECDocumentDescriptor descr = descriptors.get( n ); return lastStream = new SegmentedInputStream( openFileStream( file[ descr.fileIndex ] ), descr.toSegments() ); }
public InputStream stream( final int n ) throws IOException { // Creates a Segmented Input Stream with only one segment in (the requested one). ensureDocumentIndex( n ); IOUtils.closeQuietly( lastStream ); final TRECDocumentDescriptor descr = descriptors.get( n ); return lastStream = new SegmentedInputStream( openFileStream( file[ descr.fileIndex ] ), descr.toSegments() ); }
public InputStream stream( final int n ) throws IOException { // Creates a Segmented Input Stream with only one segment in (the requested one). ensureDocumentIndex( n ); IOUtils.closeQuietly( lastStream ); final TRECDocumentDescriptor descr = descriptors.get( n ); return lastStream = new SegmentedInputStream( openFileStream( file[ descr.fileIndex ] ), descr.toSegments() ); }
private boolean nextFile() throws FileNotFoundException, IOException { if ( size() == 0 ) return false; IOUtils.closeQuietly( siStream ); if ( ! descriptorIterator.hasNext() ) return false; /* * We assume documents contained in the same gzip file are * contiguous so we collect all of them until we find a different * file index. */ TRECDocumentDescriptor currentDescriptor = firstNextDescriptor != null ? firstNextDescriptor : descriptorIterator.next(); int currentFileIndex = currentDescriptor.fileIndex; if ( DEBUG ) LOGGER.debug( "Skipping to contents file " + currentFileIndex + " (" + file[ currentFileIndex ] + ")" ); /* * We create the segmented input stream with all just collected * descriptors */ siStream = new SegmentedInputStream( openFileStream( file[ currentFileIndex ] ) ); do { siStream.addBlock( currentDescriptor.toSegments() ); if ( ! descriptorIterator.hasNext() ) break; currentDescriptor = descriptorIterator.next(); } while ( currentDescriptor.fileIndex == currentFileIndex ); firstNextDescriptor = currentDescriptor; // The last assignment will be meaningless, but it won't be used anyway return true; }
private boolean nextFile() throws FileNotFoundException, IOException { if ( size() == 0 ) return false; IOUtils.closeQuietly( siStream ); if ( ! descriptorIterator.hasNext() ) return false; /* * We assume documents contained in the same gzip file are * contiguous so we collect all of them until we find a different * file index. */ TRECDocumentDescriptor currentDescriptor = firstNextDescriptor != null ? firstNextDescriptor : descriptorIterator.next(); int currentFileIndex = currentDescriptor.fileIndex; if ( DEBUG ) LOGGER.debug( "Skipping to contents file " + currentFileIndex + " (" + file[ currentFileIndex ] + ")" ); /* * We create the segmented input stream with all just collected * descriptors */ siStream = new SegmentedInputStream( openFileStream( file[ currentFileIndex ] ) ); do { siStream.addBlock( currentDescriptor.toSegments() ); if ( ! descriptorIterator.hasNext() ) break; currentDescriptor = descriptorIterator.next(); } while ( currentDescriptor.fileIndex == currentFileIndex ); firstNextDescriptor = currentDescriptor; // The last assignment will be meaningless, but it won't be used anyway return true; }
private boolean nextFile() throws FileNotFoundException, IOException { if ( size() == 0 ) return false; IOUtils.closeQuietly( siStream ); if ( ! descriptorIterator.hasNext() ) return false; /* * We assume documents contained in the same gzip file are * contiguous so we collect all of them until we find a different * file index. */ TRECDocumentDescriptor currentDescriptor = firstNextDescriptor != null ? firstNextDescriptor : descriptorIterator.next(); int currentFileIndex = currentDescriptor.fileIndex; if ( DEBUG ) LOGGER.debug( "Skipping to contents file " + currentFileIndex + " (" + file[ currentFileIndex ] + ")" ); /* * We create the segmented input stream with all just collected * descriptors */ siStream = new SegmentedInputStream( openFileStream( file[ currentFileIndex ] ) ); do { siStream.addBlock( currentDescriptor.toSegments() ); if ( ! descriptorIterator.hasNext() ) break; currentDescriptor = descriptorIterator.next(); } while ( currentDescriptor.fileIndex == currentFileIndex ); firstNextDescriptor = currentDescriptor; // The last assignment will be meaningless, but it won't be used anyway return true; }
private boolean nextFile() throws FileNotFoundException, IOException { if ( size() == 0 ) return false; IOUtils.closeQuietly( siStream ); if ( ! descriptorIterator.hasNext() ) return false; /* * We assume documents contained in the same gzip file are * contiguous so we collect all of them until we find a different * file index. */ TRECDocumentDescriptor currentDescriptor = firstNextDescriptor != null ? firstNextDescriptor : descriptorIterator.next(); int currentFileIndex = currentDescriptor.fileIndex; if ( DEBUG ) LOGGER.debug( "Skipping to contents file " + currentFileIndex + " (" + file[ currentFileIndex ] + ")" ); /* * We create the segmented input stream with all just collected * descriptors */ siStream = new SegmentedInputStream( openFileStream( file[ currentFileIndex ] ) ); do { siStream.addBlock( currentDescriptor.toSegments() ); if ( ! descriptorIterator.hasNext() ) break; currentDescriptor = descriptorIterator.next(); } while ( currentDescriptor.fileIndex == currentFileIndex ); firstNextDescriptor = currentDescriptor; // The last assignment will be meaningless, but it won't be used anyway return true; }