/** Open a file for random access reading */ public static RandomDataInput openFileRandom(File file) throws IOException { return openFileRandom(file.getPath()); }
/** Open a file for random access reading */ public static RandomDataInput openFileRandom(File file) throws IOException { return openFileRandom(file.getPath()); }
private RandomDataInput getFile() throws IOException { if (filePool.isEmpty()) filePool.push(Files.openFileRandom(filename)); RandomDataInput file = filePool.pop(); return file; }
/** * Constructs an instance of the class for a given filename * @param _file the underlying file * @param bufSize how much of the file to buffer */ public BitFileBuffered(File _file, int bufSize) { buffer_size = bufSize; fileSize = _file.length(); try { this.file = Files.openFileRandom(_file); } catch (IOException ioe) { logger.error("Input/Output exception while creating BitFileBuffered object.", ioe); } }
private RandomDataInput getFile() throws IOException { if (filePool.isEmpty()) filePool.push(Files.openFileRandom(filename)); RandomDataInput file = filePool.pop(); return file; }
/** * Constructs an instance of the class for a given filename * @param _file the underlying file * @param bufSize how much of the file to buffer */ public BitFileBuffered(File _file, int bufSize) { buffer_size = bufSize; fileSize = _file.length(); try { this.file = Files.openFileRandom(_file); } catch (IOException ioe) { logger.error("Input/Output exception while creating BitFileBuffered object.", ioe); } }
/** * Constructs an instance of the class for a given filename * * @param filename * java.lang.String the name of the underlying file * @param bufSize * how much of the file to buffer */ public ByteFileBuffered(String filename, int bufSize) { this.filename = filename; filePool = new Stack<RandomDataInput>(); bufferSize = bufSize; assert bufferSize > 8; try { filePool.push(Files.openFileRandom(filename)); } catch (IOException ioe) { logger.error( "Input/Output exception while creating ByteFileBuffered object.", ioe); } }
public OnDiskLookup(String path, String prefix, String structureName) throws IOException { lexIdFile = Files.openFileRandom( constructFilename(structureName, path, prefix, ID_EXT)); }
/** * Constructs an instance of the class for a given filename * @param filename java.lang.String the name of the underlying file * @param bufSize how much of the file to buffer */ public BitFileBuffered(String filename, int bufSize) { buffer_size = bufSize; try { fileSize = Files.length(filename); file = Files.openFileRandom(filename); } catch (IOException ioe) { logger.error("Input/Output exception while creating BitFileBuffered object.", ioe); } }
public OnDiskLookup(String path, String prefix, String structureName) throws IOException { lexIdFile = Files.openFileRandom( constructFilename(structureName, path, prefix, ID_EXT)); }
/** * Constructs an instance of the class for a given filename * * @param filename * java.lang.String the name of the underlying file * @param bufSize * how much of the file to buffer */ public ByteFileBuffered(String filename, int bufSize) { this.filename = filename; filePool = new Stack<RandomDataInput>(); bufferSize = bufSize; assert bufferSize > 8; try { filePool.push(Files.openFileRandom(filename)); } catch (IOException ioe) { logger.error( "Input/Output exception while creating ByteFileBuffered object.", ioe); } }
/** * Constructs an instance of the class for a given filename * @param filename java.lang.String the name of the underlying file * @param bufSize how much of the file to buffer */ public BitFileBuffered(String filename, int bufSize) { buffer_size = bufSize; try { fileSize = Files.length(filename); file = Files.openFileRandom(filename); } catch (IOException ioe) { logger.error("Input/Output exception while creating BitFileBuffered object.", ioe); } }
/** default constructor * * @param filename * @param updateable * @param _valueFactory * @throws IOException */ public FSArrayFile( String filename, boolean updateable, FixedSizeWriteableFactory<V> _valueFactory) throws IOException { this.dataFile = updateable ? Files.writeFileRandom(this.dataFilename = filename) : Files.openFileRandom(this.dataFilename = filename); this.valueFactory = _valueFactory; this.entrySize = _valueFactory.getSize(); this.numberOfEntries = (int) (dataFile.length() / (long)entrySize); }
/** default constructor * * @param filename * @param updateable * @param _valueFactory * @throws IOException */ public FSArrayFile( String filename, boolean updateable, FixedSizeWriteableFactory<V> _valueFactory) throws IOException { this.dataFile = updateable ? Files.writeFileRandom(this.dataFilename = filename) : Files.openFileRandom(this.dataFilename = filename); this.valueFactory = _valueFactory; this.entrySize = _valueFactory.getSize(); this.numberOfEntries = (int) (dataFile.length() / (long)entrySize); }
logger.warn("OutOfMemoryError: Structure "+ structureName + " reading data file directly from disk"); RandomDataInput rfi = Files.openFileRandom(dataFilename); _dataSource = (rfi instanceof RandomAccessFile) ? new ChannelByteAccessor((RandomAccessFile)rfi) +structureName+".data-source=fileinmem in the index properties file"); RandomDataInput rfi = Files.openFileRandom(dataFilename); dataSource = (rfi instanceof RandomAccessFile) ? new ChannelByteAccessor((RandomAccessFile)rfi)
logger.warn("OutOfMemoryError: Structure "+ structureName + " reading data file directly from disk"); RandomDataInput rfi = Files.openFileRandom(dataFilename); _dataSource = (rfi instanceof RandomAccessFile) ? new ChannelByteAccessor((RandomAccessFile)rfi) +structureName+".data-source=fileinmem in the index properties file"); RandomDataInput rfi = Files.openFileRandom(dataFilename); dataSource = (rfi instanceof RandomAccessFile) ? new ChannelByteAccessor((RandomAccessFile)rfi)
/** Construct a new object to access the underlying file data structure * * @param filename Filename of the file containing the structure * @param updateable Whether the file can be updated in this JVM * @param _keyFactory factory object for keys * @param _valueFactory factory object for values * @throws IOException thrown if an IO problem occurs */ public FSOrderedMapFile( String filename, boolean updateable, FixedSizeWriteableFactory<K> _keyFactory, FixedSizeWriteableFactory<V> _valueFactory) throws IOException { this.dataFile = updateable ? Files.writeFileRandom(this.dataFilename = filename) : Files.openFileRandom(this.dataFilename = filename); this.keyFactory = _keyFactory; this.valueFactory = _valueFactory; this.entrySize = _keyFactory.getSize() + _valueFactory.getSize(); //System.err.println("FSOrderedMapFile entrySize is "+ this.entrySize); this.numberOfEntries = (int) (dataFile.length() / (long)entrySize); this.shortcut = new DefaultMapFileBSearchShortcut<K>(); } /**
/** Construct a new object to access the underlying file data structure * * @param filename Filename of the file containing the structure * @param updateable Whether the file can be updated in this JVM * @param _keyFactory factory object for keys * @param _valueFactory factory object for values * @throws IOException thrown if an IO problem occurs */ public FSOrderedMapFile( String filename, boolean updateable, FixedSizeWriteableFactory<K> _keyFactory, FixedSizeWriteableFactory<V> _valueFactory) throws IOException { this.dataFile = updateable ? Files.writeFileRandom(this.dataFilename = filename) : Files.openFileRandom(this.dataFilename = filename); this.keyFactory = _keyFactory; this.valueFactory = _valueFactory; this.entrySize = _keyFactory.getSize() + _valueFactory.getSize(); //System.err.println("FSOrderedMapFile entrySize is "+ this.entrySize); this.numberOfEntries = (int) (dataFile.length() / (long)entrySize); this.shortcut = new DefaultMapFileBSearchShortcut<K>(); } /**
logger.warn("OutOfMemoryError: Structure "+ structureName + " reading lookup file directly from disk"); RandomDataInput rfi = Files.openFileRandom(indexFilename); offsetLookup = new OnDiskDocid2OffsetLookup( rfi instanceof RandomAccessFile logger.warn("OutOfMemoryError: Structure "+ structureName + " reading lookup file directly from disk"); RandomDataInput rfi = Files.openFileRandom(indexFilename); offsetLookup = new OnDiskDocid2OffsetLookup( rfi instanceof RandomAccessFile structureName+".index-source=fileinmem in the index properties file"); RandomDataInput rfi = Files.openFileRandom(indexFilename); offsetLookup = new OnDiskDocid2OffsetLookup( rfi instanceof RandomAccessFile
logger.warn("OutOfMemoryError: Structure "+ structureName + " reading lookup file directly from disk"); RandomDataInput rfi = Files.openFileRandom(indexFilename); offsetLookup = new OnDiskDocid2OffsetLookup( rfi instanceof RandomAccessFile logger.warn("OutOfMemoryError: Structure "+ structureName + " reading lookup file directly from disk"); RandomDataInput rfi = Files.openFileRandom(indexFilename); offsetLookup = new OnDiskDocid2OffsetLookup( rfi instanceof RandomAccessFile structureName+".index-source=fileinmem in the index properties file"); RandomDataInput rfi = Files.openFileRandom(indexFilename); offsetLookup = new OnDiskDocid2OffsetLookup( rfi instanceof RandomAccessFile