protected void setPostingImplementation(Class<? extends IterablePosting> postingClass) throws IOException { postingImplementation = postingClass; try{ postingConstructor = (fieldCount > 0) ? postingImplementation.getConstructor(BitIn.class, Integer.TYPE, DocumentIndex.class, Integer.TYPE) : postingImplementation.getConstructor(BitIn.class, Integer.TYPE, DocumentIndex.class); } catch (NoSuchMethodException e) { throw new WrappedIOException(e); } }
/** Make a WrappedIOException with the specified cause */ public WrappedIOException(final Throwable e) { super(); this.initCause(e); }
protected void setPostingImplementation(Class<? extends IterablePosting> postingClass) throws IOException { postingImplementation = postingClass; try{ postingConstructor = (fieldCount > 0) ? postingImplementation.getConstructor(BitIn.class, Integer.TYPE, DocumentIndex.class, Integer.TYPE) : postingImplementation.getConstructor(BitIn.class, Integer.TYPE, DocumentIndex.class); } catch (NoSuchMethodException e) { throw new WrappedIOException(e); } }
/** Make a WrappedIOException with the specified cause */ public WrappedIOException(final Throwable e) { super(); this.initCause(e); }
BitPostingIndexInputStream(String _filename, byte _fileCount, Iterator<? extends BitIndexPointer> _pointerList, Class<? extends IterablePosting> _postingIteratorClass, int _fieldCount) throws IOException { fileCount = 0; file = new BitInputStream(_filename); //file = new org.terrier.compression.BitFileBuffered(_filename).readReset(0l, (byte)0); if (DEBUG) file = new DebuggingBitIn(file); pointerList = _pointerList; postingIteratorClass = _postingIteratorClass; fieldCount = _fieldCount; 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); } } /**
/** Make a WrappedIOException with the specified message and cause */ public WrappedIOException(final String message, final Throwable e) { super(message); this.initCause(e); } }
BitPostingIndexInputStream(String _filename, byte _fileCount, Iterator<? extends BitIndexPointer> _pointerList, Class<? extends IterablePosting> _postingIteratorClass, int _fieldCount) throws IOException { fileCount = 0; file = new BitInputStream(_filename); //file = new org.terrier.compression.BitFileBuffered(_filename).readReset(0l, (byte)0); if (DEBUG) file = new DebuggingBitIn(file); pointerList = _pointerList; postingIteratorClass = _postingIteratorClass; fieldCount = _fieldCount; 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); } } /**
/** Make a WrappedIOException with the specified message and cause */ public WrappedIOException(final String message, final Throwable e) { super(message); this.initCause(e); } }
} else rtr = filterClass.getConstructor(OutputStream.class).newInstance(rtr); } catch (Exception e) { throw new WrappedIOException(e);
} else rtr = filterClass.getConstructor(OutputStream.class).newInstance(rtr); } catch (Exception e) { throw new WrappedIOException(e);
/** Opens an OutputStream to a file called Filename, processing all * allowed writable file systems named in writeFileSystemPrefixes * @param filename Filename of file to open * @throws IOException */ protected static InputStream openFile(String filename) throws IOException { filename = transform(filename); final FileSystem fs = getFileSystem(filename); if (fs == null) throw new FileNotFoundException("No file system for "+filename); if ((fs.capabilities() & FSCapability.READ) == 0) throw new IOException("File system not supporting reads for "+ filename); InputStream rtr = fs.openFileStream(filename); for(Pattern regex : inputStreamMap.keySet()) { if (regex.matcher(filename).matches()) { Class<? extends InputStream> filterClass = inputStreamMap.get(regex); try{ rtr = filterClass.getConstructor(InputStream.class).newInstance(rtr); } catch (Exception e) { throw new WrappedIOException(e); } } } return rtr; }
/** Opens an OutputStream to a file called Filename, processing all * allowed writable file systems named in writeFileSystemPrefixes * @param filename Filename of file to open * @throws IOException */ protected static InputStream openFile(String filename) throws IOException { filename = transform(filename); final FileSystem fs = getFileSystem(filename); if (fs == null) throw new FileNotFoundException("No file system for "+filename); if ((fs.capabilities() & FSCapability.READ) == 0) throw new IOException("File system not supporting reads for "+ filename); InputStream rtr = fs.openFileStream(filename); for(Pattern regex : inputStreamMap.keySet()) { if (regex.matcher(filename).matches()) { Class<? extends InputStream> filterClass = inputStreamMap.get(regex); try{ rtr = filterClass.getConstructor(InputStream.class).newInstance(rtr); } catch (Exception e) { throw new WrappedIOException(e); } } } return rtr; }
@Override public ByteIn readReset(long startByteOffset) throws IOException { try{ RandomDataInputMemory clone = (RandomDataInputMemory) rdim.clone(); clone.seek(startByteOffset); ByteIn in = new ByteInputStream(clone, startByteOffset); return in; } catch (CloneNotSupportedException e) { throw new WrappedIOException(e); } } }
this.file[i] = ApplicationSetup.getClass(_dataSource).asSubclass(BitInSeekable.class).getConstructor(String.class).newInstance(dataFilename); } catch (Exception e) { throw new WrappedIOException(e);
@Override public ByteIn readReset(long startByteOffset) throws IOException { try{ RandomDataInputMemory clone = (RandomDataInputMemory) rdim.clone(); clone.seek(startByteOffset); ByteIn in = new ByteInputStream(clone, startByteOffset); return in; } catch (CloneNotSupportedException e) { throw new WrappedIOException(e); } } }
this.file[i] = ApplicationSetup.getClass(_dataSource).asSubclass(BitInSeekable.class).getConstructor(String.class).newInstance(dataFilename); } catch (Exception e) { throw new WrappedIOException(e);
throw e; }catch (Exception e) { throw new WrappedIOException(e);
@Override public IterablePosting getPostings(Pointer pointer) throws IOException { final BitIn _file = this.file[((BitIndexPointer)pointer).getFileNumber()].readReset(((BitIndexPointer)pointer).getOffset(), ((BitIndexPointer)pointer).getOffsetBits()); IterablePosting rtr = null; try{ rtr = (fieldCount > 0) ? postingConstructor.newInstance(_file, pointer.getNumberOfEntries(), doi, fieldCount) : postingConstructor.newInstance(_file, pointer.getNumberOfEntries(), doi); } catch (Exception e) { throw new WrappedIOException(e); } return rtr; } /**
@Override public IterablePosting getPostings(Pointer pointer) throws IOException { final BitIn _file = this.file[((BitIndexPointer)pointer).getFileNumber()].readReset(((BitIndexPointer)pointer).getOffset(), ((BitIndexPointer)pointer).getOffsetBits()); IterablePosting rtr = null; try{ rtr = (fieldCount > 0) ? postingConstructor.newInstance(_file, pointer.getNumberOfEntries(), doi, fieldCount) : postingConstructor.newInstance(_file, pointer.getNumberOfEntries(), doi); } catch (Exception e) { throw new WrappedIOException(e); } return rtr; } /**
throw new WrappedIOException("Could not find a class for FSOMapFileLexicon", e);