@Override public void close() throws IOException { IndexUtil.close(di); }
/** * Closes the stream. * @throws java.io.IOException if an I/O error occurs */ public void close() throws IOException { IndexUtil.close(dis); }
/** * Closes the stream. * @throws java.io.IOException if an I/O error occurs */ public void close() throws IOException { IndexUtil.close(dis); }
@Override public void close() throws IOException { IndexUtil.close(di); }
public void close() throws IOException { IndexUtil.close(lexIter); }
public void close() throws IOException { IndexUtil.close(doiIter); }
@Override public void close() throws IOException { // invoke the close methods on all currently open index structures for (Object o : structureCache.values()) { try { IndexUtil.close(o); } catch (IOException ioe) {/* ignore */ } } structureCache.clear(); flushProperties(); }
/** {@inheritDoc} */ public void close() throws IOException { file.close(); IndexUtil.close(pointerList); }
/** {@inheritDoc} */ public void close() throws IOException { file.close(); IndexUtil.close(pointerList); }
@Override public void close() throws IOException { // invoke the close methods on all currently open index structures for (Object o : structureCache.values()) { try { IndexUtil.close(o); } catch (IOException ioe) {/* ignore */ } } structureCache.clear(); flushProperties(); }
/** {@inheritDoc} */ public void close() throws IOException { file.close(); IndexUtil.close(pointerList); }
/** {@inheritDoc} */ public void close() throws IOException { file.close(); IndexUtil.close(pointerList); }
/** Print the contents of the meta index */ @SuppressWarnings("unchecked") public static void printMetaIndex(Index index, String structureName) throws IOException { Iterator<String[]> inputStream = (Iterator<String[]>)index.getIndexStructureInputStream(structureName); while(inputStream.hasNext()) { System.out.println(ArrayUtils.join(inputStream.next(), ", ")); } IndexUtil.close(inputStream); }
/** Print the contents of the meta index */ @SuppressWarnings("unchecked") public static void printMetaIndex(Index index, String structureName) throws IOException { Iterator<String[]> inputStream = (Iterator<String[]>)index.getIndexStructureInputStream(structureName); while(inputStream.hasNext()) { System.out.println(ArrayUtils.join(inputStream.next(), ", ")); } IndexUtil.close(inputStream); }
/** Print the contents of the document index */ @SuppressWarnings("unchecked") public static void printDocumentIndex(Index index, String structureName) throws IOException { Iterator<DocumentIndexEntry> iterator = (Iterator<DocumentIndexEntry>)index.getIndexStructureInputStream(structureName); int docid =0; while(iterator.hasNext()) { DocumentIndexEntry die = iterator.next(); System.out.println(docid +": " + die.toString()); docid++; } close(iterator); }
/** Print the contents of the document index */ @SuppressWarnings("unchecked") public static void printDocumentIndex(Index index, String structureName) throws IOException { Iterator<DocumentIndexEntry> iterator = (Iterator<DocumentIndexEntry>)index.getIndexStructureInputStream(structureName); int docid =0; while(iterator.hasNext()) { DocumentIndexEntry die = iterator.next(); System.out.println(docid +": " + die.toString()); docid++; } close(iterator); }
/** Closes the underlying structures.*/ public void close() throws IOException { dataSource.close(); offsetLookup.close(); for (Map<Text,IntWritable> m : forwardMetaMaps) { IndexUtil.close(m); } }
/** Closes the underlying structures.*/ public void close() throws IOException { dataSource.close(); offsetLookup.close(); for (Map<Text,IntWritable> m : forwardMetaMaps) { IndexUtil.close(m); } }
protected void testRandom(List<IntWritable> list) throws Exception { assertEquals(TEST_INTEGERS.length, list.size()); for(int i=0;i<TEST_INTEGERS.length;i++) { assertEquals(TEST_INTEGERS[i], list.get(i).get()); } for(int i=TEST_INTEGERS.length-1; i>=0;i--) { assertEquals(TEST_INTEGERS[i], list.get(i).get()); } IndexUtil.close(list); }
/** Test that the stream works as expected */ @Test public void testStream() throws Exception { Iterator<IntWritable> iterator = new FSArrayFile.ArrayFileIterator<IntWritable>(arrayFile, new FixedSizeIntWritableFactory()); int i=0; while(iterator.hasNext()) { assertEquals(TEST_INTEGERS[i], iterator.next().get()); i++; } assertEquals(TEST_INTEGERS.length, i); IndexUtil.close(iterator); }