@@ -0,0 +1,1922 @@
+package de.unipotsdam.hpi.database;%0A%0Aimport java.io.IOException;%0Aimport java.util.Iterator;%0A%0Aimport de.unipotsdam.hpi.input.InputVector;%0A%0Apublic class VectorDatabaseBuilder %7B%0A%0A  private Settings vdbSettings = new Settings();%0A  private Iterator%3CInputVector%3E inputVectors;%0A  %0A  public VectorDatabaseBuilder alphabetSize(int size) %7B%0A    vdbSettings.setInputVectorSize(size);%0A    return this;%0A  %7D%0A%0A  public VectorDatabaseBuilder numHyperplanes(int numHyperplanes) %7B%0A    vdbSettings.setLshSize(numHyperplanes);%0A    return this;%0A  %7D%0A%0A  public VectorDatabaseBuilder numPermutations(int numPermutations) %7B%0A    vdbSettings.setNumPermutations(numPermutations);%0A    return this;%0A  %7D%0A%0A  public VectorDatabaseBuilder basePath(String basePath) %7B%0A    vdbSettings.setBasePath(basePath);%0A    return this;%0A  %7D%0A  %0A  public VectorDatabaseBuilder data(Iterator%3CInputVector%3E inputVectors) %7B%0A    this.inputVectors = inputVectors;%0A    return this;%0A  %7D%0A  %0A  public VectorDatabaseBuilder indexBlockSize(int indexBlockSize) %7B%0A    vdbSettings.setBlockSize(indexBlockSize);%0A    return this;%0A  %7D%0A  %0A  public VectorDatabaseBuilder parallelSorting(boolean parallelSorting) %7B%0A    vdbSettings.setPerformParallelSorting(parallelSorting);%0A    return this;%0A  %7D%0A  %0A  public VectorDatabaseBuilder parallelLSH(boolean parallelLsh) %7B%0A    vdbSettings.setPerformParallelLsh(parallelLsh);%0A    return this;%0A  %7D%0A  %0A  public VectorDatabase buildVectorDatabase() %7B%0A    try %7B%0A      VectorDatabase vdb = new VectorDatabase(vdbSettings);%0A      vdb.bulkLoad(inputVectors);%0A      return vdb;%0A    %7D catch (IOException e) %7B%0A      throw new RuntimeException(%22Cannot build vector database%22, e);%0A    %7D%0A  %7D%0A%0A  public VectorDatabase recoverVectorDatabase() %7B%0A    try %7B%0A      VectorDatabase vdb = new VectorDatabase(vdbSettings);%0A      vdb.recover();%0A      return vdb;%0A    %7D catch (IOException e) %7B%0A      throw new RuntimeException(%22Cannot recover vector database%22, e);%0A    %7D%0A  %7D%0A%0A%7D%0A

add builder to fluently create a vector db