code: public synchronized boolean indexVector(String id, double[] vector) throws Exception {
  		long startIndexing = System.currentTimeMillis();
  		// check if we can index more vectors
  		if (loadCounter >= maxNumVectors) {
  			System.out.println("Maximum index capacity reached, no more vectors can be indexed!");
  			return false;
  		}
  		// check if name is already indexed
  		if (isIndexed(id)) {
  			System.out.println("Vector '" + id + "' already indexed!");
  			return false;
  		}
  		// do the indexing
  		// persist id to name and the reverse mapping
  		long startMapping = System.currentTimeMillis();
  		createMapping(id);
  		totalIdMappingTime += System.currentTimeMillis() - startMapping;
  		// method specific indexing
  		long startInternalIndexing = System.currentTimeMillis();
  		indexVectorInternal(vector);
  		totalInternalVectorIndexingTime += System.currentTimeMillis() - startInternalIndexing;
  
  		loadCounter++; // increase the loadCounter
  		if (loadCounter % 100 == 0) { // debug message
  			System.out.println(new Date() + " # indexed vectors: " + loadCounter);
  		}
  		totalVectorIndexingTime += System.currentTimeMillis() - startIndexing;
  		return true;
  	}
docs: Updates the index with the given vector. This is a synchronized method, i.e. when a thread calls this
  method, all other threads wait for the first thread to complete before executing the method. This
  ensures that the persistent BDB store will remain consistent when multiple threads call the indexVector
  method.
  
  @param id
  The id of the vector
  @param vector
  The vector
  @return True if the vector is successfully indexed, false otherwise.
  @throws Exception