private synchronized String[] readAllDocumentNames() throws IOException { if (this.numberOfChunks <= 0) return CharOperation.NO_STRINGS; InputStream stream = this.indexLocation.getInputStream(); try { int offset = this.chunkOffsets[0]; stream.skip(offset); this.streamBuffer = new byte[BUFFER_READ_SIZE]; this.bufferIndex = 0; this.bufferEnd = stream.read(this.streamBuffer, 0, this.streamBuffer.length); int lastIndex = this.numberOfChunks - 1; String[] docNames = new String[lastIndex * CHUNK_SIZE + this.sizeOfLastChunk]; for (int i = 0; i < this.numberOfChunks; i++) readChunk(docNames, stream, i * CHUNK_SIZE, i < lastIndex ? CHUNK_SIZE : this.sizeOfLastChunk); return docNames; } finally { stream.close(); this.indexLocation.close(); this.streamBuffer = null; } } private synchronized HashtableOfObject readCategoryTable(char[] categoryName, boolean readDocNumbers) throws IOException {
private synchronized String[] readAllDocumentNames() throws IOException { if (this.numberOfChunks <= 0) return CharOperation.NO_STRINGS; InputStream stream = this.indexLocation.getInputStream(); try { int offset = this.chunkOffsets[0]; stream.skip(offset); this.streamBuffer = new byte[BUFFER_READ_SIZE]; this.bufferIndex = 0; this.bufferEnd = stream.read(this.streamBuffer, 0, this.streamBuffer.length); int lastIndex = this.numberOfChunks - 1; String[] docNames = new String[lastIndex * CHUNK_SIZE + this.sizeOfLastChunk]; for (int i = 0; i < this.numberOfChunks; i++) readChunk(docNames, stream, i * CHUNK_SIZE, i < lastIndex ? CHUNK_SIZE : this.sizeOfLastChunk); return docNames; } finally { stream.close(); this.indexLocation.close(); this.streamBuffer = null; } } private synchronized HashtableOfObject readCategoryTable(char[] categoryName, boolean readDocNumbers) throws IOException {
private synchronized String[] readAllDocumentNames() throws IOException { if (this.numberOfChunks <= 0) return CharOperation.NO_STRINGS; InputStream stream = this.indexLocation.getInputStream(); try { int offset = this.chunkOffsets[0]; stream.skip(offset); this.streamBuffer = new byte[BUFFER_READ_SIZE]; this.bufferIndex = 0; this.bufferEnd = stream.read(this.streamBuffer, 0, this.streamBuffer.length); int lastIndex = this.numberOfChunks - 1; String[] docNames = new String[lastIndex * CHUNK_SIZE + this.sizeOfLastChunk]; for (int i = 0; i < this.numberOfChunks; i++) readChunk(docNames, stream, i * CHUNK_SIZE, i < lastIndex ? CHUNK_SIZE : this.sizeOfLastChunk); return docNames; } finally { stream.close(); this.indexLocation.close(); this.streamBuffer = null; } } private synchronized HashtableOfObject readCategoryTable(char[] categoryName, boolean readDocNumbers) throws IOException {
synchronized int[] readDocumentNumbers(Object arrayOffset) throws IOException { // arrayOffset is either a cached array of docNumbers or an Integer offset in the file if (arrayOffset instanceof int[]) return (int[]) arrayOffset; InputStream stream = this.indexLocation.getInputStream(); try { int offset = ((Integer) arrayOffset).intValue(); stream.skip(offset); this.streamBuffer = new byte[BUFFER_READ_SIZE]; this.bufferIndex = 0; this.bufferEnd = stream.read(this.streamBuffer, 0, this.streamBuffer.length); return readStreamDocumentArray(stream, readStreamInt(stream)); } finally { stream.close(); this.indexLocation.close(); this.streamBuffer = null; } } private void readHeaderInfo(InputStream stream) throws IOException {
private void cacheDocumentNames() throws IOException { // will need all document names so get them now this.cachedChunks = new String[this.numberOfChunks][]; InputStream stream = this.indexLocation.getInputStream(); try { if (this.numberOfChunks > 5) BUFFER_READ_SIZE <<= 1; int offset = this.chunkOffsets[0]; stream.skip(offset); this.streamBuffer = new byte[BUFFER_READ_SIZE]; this.bufferIndex = 0; this.bufferEnd = stream.read(this.streamBuffer, 0, this.streamBuffer.length); for (int i = 0; i < this.numberOfChunks; i++) { int size = i == this.numberOfChunks - 1 ? this.sizeOfLastChunk : CHUNK_SIZE; readChunk(this.cachedChunks[i] = new String[size], stream, 0, size); } } catch (IOException e) { this.cachedChunks = null; throw e; } finally { stream.close(); this.indexLocation.close(); this.streamBuffer = null; BUFFER_READ_SIZE = DEFAULT_BUFFER_SIZE; } } private String[] computeDocumentNames(String[] onDiskNames, int[] positions, SimpleLookupTable indexedDocuments, MemoryIndex memoryIndex) {
synchronized int[] readDocumentNumbers(Object arrayOffset) throws IOException { // arrayOffset is either a cached array of docNumbers or an Integer offset in the file if (arrayOffset instanceof int[]) return (int[]) arrayOffset; InputStream stream = this.indexLocation.getInputStream(); try { int offset = ((Integer) arrayOffset).intValue(); stream.skip(offset); this.streamBuffer = new byte[BUFFER_READ_SIZE]; this.bufferIndex = 0; this.bufferEnd = stream.read(this.streamBuffer, 0, this.streamBuffer.length); return readStreamDocumentArray(stream, readStreamInt(stream)); } finally { stream.close(); this.indexLocation.close(); this.streamBuffer = null; } } private void readHeaderInfo(InputStream stream) throws IOException {
private void cacheDocumentNames() throws IOException { // will need all document names so get them now this.cachedChunks = new String[this.numberOfChunks][]; InputStream stream = this.indexLocation.getInputStream(); try { if (this.numberOfChunks > 5) BUFFER_READ_SIZE <<= 1; int offset = this.chunkOffsets[0]; stream.skip(offset); this.streamBuffer = new byte[BUFFER_READ_SIZE]; this.bufferIndex = 0; this.bufferEnd = stream.read(this.streamBuffer, 0, this.streamBuffer.length); for (int i = 0; i < this.numberOfChunks; i++) { int size = i == this.numberOfChunks - 1 ? this.sizeOfLastChunk : CHUNK_SIZE; readChunk(this.cachedChunks[i] = new String[size], stream, 0, size); } } catch (IOException e) { this.cachedChunks = null; throw e; } finally { stream.close(); this.indexLocation.close(); this.streamBuffer = null; BUFFER_READ_SIZE = DEFAULT_BUFFER_SIZE; } } private String[] computeDocumentNames(String[] onDiskNames, int[] positions, SimpleLookupTable indexedDocuments, MemoryIndex memoryIndex) {
synchronized int[] readDocumentNumbers(Object arrayOffset) throws IOException { // arrayOffset is either a cached array of docNumbers or an Integer offset in the file if (arrayOffset instanceof int[]) return (int[]) arrayOffset; InputStream stream = this.indexLocation.getInputStream(); try { int offset = ((Integer) arrayOffset).intValue(); stream.skip(offset); this.streamBuffer = new byte[BUFFER_READ_SIZE]; this.bufferIndex = 0; this.bufferEnd = stream.read(this.streamBuffer, 0, this.streamBuffer.length); return readStreamDocumentArray(stream, readStreamInt(stream)); } finally { stream.close(); this.indexLocation.close(); this.streamBuffer = null; } } private void readHeaderInfo(InputStream stream) throws IOException {
private void cacheDocumentNames() throws IOException { // will need all document names so get them now this.cachedChunks = new String[this.numberOfChunks][]; InputStream stream = this.indexLocation.getInputStream(); try { if (this.numberOfChunks > 5) BUFFER_READ_SIZE <<= 1; int offset = this.chunkOffsets[0]; stream.skip(offset); this.streamBuffer = new byte[BUFFER_READ_SIZE]; this.bufferIndex = 0; this.bufferEnd = stream.read(this.streamBuffer, 0, this.streamBuffer.length); for (int i = 0; i < this.numberOfChunks; i++) { int size = i == this.numberOfChunks - 1 ? this.sizeOfLastChunk : CHUNK_SIZE; readChunk(this.cachedChunks[i] = new String[size], stream, 0, size); } } catch (IOException e) { this.cachedChunks = null; throw e; } finally { stream.close(); this.indexLocation.close(); this.streamBuffer = null; BUFFER_READ_SIZE = DEFAULT_BUFFER_SIZE; } } private String[] computeDocumentNames(String[] onDiskNames, int[] positions, SimpleLookupTable indexedDocuments, MemoryIndex memoryIndex) {
synchronized boolean addIndex(IPath containerPath, IndexLocation indexFile) { getIndexStates().put(indexFile, REUSE_STATE); this.indexLocations.put(containerPath, indexFile); Index index = getIndex(containerPath, indexFile, true, false); if (index == null) { indexFile.close(); this.indexLocations.put(containerPath, null); return false; } writeIndexMapFile(); return true; }
synchronized boolean addIndex(IPath containerPath, IndexLocation indexFile) { getIndexStates().put(indexFile, REUSE_STATE); this.indexLocations.put(containerPath, indexFile); Index index = getIndex(containerPath, indexFile, true, false); if (index == null) { indexFile.close(); this.indexLocations.put(containerPath, null); return false; } writeIndexMapFile(); return true; }
synchronized boolean addIndex(IPath containerPath, IndexLocation indexFile) { getIndexStates().put(indexFile, REUSE_STATE); this.indexLocations.put(containerPath, indexFile); Index index = getIndex(containerPath, indexFile, true, false); if (index == null) { indexFile.close(); this.indexLocations.put(containerPath, null); return false; } writeIndexMapFile(); return true; }
synchronized boolean addIndex(IPath containerPath, IndexLocation indexFile) { getIndexStates().put(indexFile, REUSE_STATE); this.indexLocations.put(containerPath, indexFile); Index index = getIndex(containerPath, indexFile, true, false); if (index == null) { indexFile.close(); this.indexLocations.put(containerPath, null); return false; } writeIndexMapFile(); return true; }
synchronized boolean addIndex(IPath containerPath, IndexLocation indexFile) { getIndexStates().put(indexFile, REUSE_STATE); this.indexLocations.put(containerPath, indexFile); Index index = getIndex(containerPath, indexFile, true, false); if (index == null) { indexFile.close(); this.indexLocations.put(containerPath, null); return false; } writeIndexMapFile(); return true; }
indexLocation.close(); this.indexLocations.put(containerPath, null); } else if (indexFile != null && indexFile.exists()) {
indexLocation.close(); this.indexLocations.put(containerPath, null); } else if (indexFile != null && indexFile.exists()) {
indexLocation.close(); this.indexLocations.put(containerPath, null); } else if (indexFile != null && indexFile.exists()) {
indexLocation.close(); this.indexLocations.put(containerPath, null); } else if (indexFile != null && indexFile.exists()) {
indexLocation.close(); this.indexLocations.put(containerPath, null); } else if (indexFile != null && indexFile.exists()) {
locations[count++] = indexLocation; if (this.indexStates.get(indexLocation) == REUSE_STATE) { indexLocation.close(); } else { if (DEBUG)