@Override public IndexOutput createOutput(String name) throws IOException { return directory.createOutput(name); }
@Override public IndexOutput createOutput(String name) throws IOException { return directory.createOutput(name); }
@Override public IndexOutput createOutput(String name, IOContext context) throws IOException { return fsDir.createOutput(name, context); }
/** * Outputs a vector store in Lucene binary format. * * @param vectorFileName The name of the file to write to * @param objectVectors The vector store to be written to disk */ public static void writeVectorsInLuceneFormat(String vectorFileName, FlagConfig flagConfig, VectorStore objectVectors) throws IOException { VerbatimLogger.info("About to write " + objectVectors.getNumVectors() + " vectors of dimension " + flagConfig.dimension() + " to Lucene format file: " + vectorFileName + " ... "); File vectorFile = new File(vectorFileName); java.nio.file.Files.deleteIfExists(vectorFile.toPath()); String parentPath = vectorFile.getParent(); if (parentPath == null) parentPath = ""; FSDirectory fsDirectory = FSDirectory.open(FileSystems.getDefault().getPath(parentPath)); IndexOutput outputStream = fsDirectory.createOutput(vectorFile.getName(), IOContext.DEFAULT); writeToIndexOutput(objectVectors, flagConfig, outputStream); outputStream.close(); fsDirectory.close(); }
if (parentPath == null) parentPath = ""; FSDirectory fsDirectory = FSDirectory.open(FileSystems.getDefault().getPath(parentPath)); IndexOutput outputStream = fsDirectory.createOutput(vectorFile.getName(), IOContext.DEFAULT); flagConfig.setDimension(newDimension); outputStream.writeString(VectorStoreWriter.generateHeaderString(flagConfig));
if (parentPath == null) parentPath = ""; FSDirectory fsDirectory = FSDirectory.open(FileSystems.getDefault().getPath(parentPath)); IndexOutput outputStream = fsDirectory.createOutput(vectorFile.getName(), IOContext.DEFAULT); outputStream.writeString(VectorStoreWriter.generateHeaderString(flagConfig));
IndexOutput outputStream = fsDirectory.createOutput(vectorFile.getName(), IOContext.DEFAULT);
private void writeOutput(DMat vT, DMat uT) throws IOException { IndexOutput outputStream = fsDirectory.createOutput( VectorStoreUtils.getStoreFileName(flagConfig.termvectorsfile(), flagConfig), IOContext.DEFAULT); outputStream = fsDirectory.createOutput( VectorStoreUtils.getStoreFileName(flagConfig.docvectorsfile(), flagConfig), IOContext.DEFAULT);
FSDirectory fsDirectory = FSDirectory.open(FileSystems.getDefault().getPath(parentPath)); IndexOutput outputStream = fsDirectory.createOutput(vectorFile.getName(), IOContext.DEFAULT);