code: private void loadIndexInMemory() throws Exception {
  		// create the memory objects with the appropriate initial size
  		if (numProductCentroids <= 256) {
  			pqByteCodes = new TByteArrayList(maxNumVectors * numSubVectors);
  		} else {
  			pqShortCodes = new TShortArrayList(maxNumVectors * numSubVectors);
  		}
  		long start = System.currentTimeMillis();
  		System.out.println("Loading persistent index in memory.");
  
  		DatabaseEntry foundKey = new DatabaseEntry();
  		DatabaseEntry foundData = new DatabaseEntry();
  
  		ForwardCursor cursor = null;
  		if (useDiskOrderedCursor) { // disk ordered cursor
  			DiskOrderedCursorConfig docc = new DiskOrderedCursorConfig();
  			cursor = iidToPqDB.openCursor(docc);
  		} else {
  			cursor = iidToPqDB.openCursor(null, null);
  		}
  
  		int counter = 0;
  		while (cursor.getNext(foundKey, foundData, LockMode.DEFAULT) == OperationStatus.SUCCESS
  				&& counter < maxNumVectors) {
  			TupleInput input = TupleBinding.entryToInput(foundData);
  
  			if (numProductCentroids <= 256) {
  				byte[] code = new byte[numSubVectors];
  				for (int i = 0; i < numSubVectors; i++) {
  					code[i] = input.readByte();
  				}
  				pqByteCodes.add(code); // update ram based index
  			} else {
  				short[] code = new short[numSubVectors];
  				for (int i = 0; i < numSubVectors; i++) {
  					code[i] = input.readShort();
  				}
  				pqShortCodes.add(code); // update ram based index
  			}
  			counter++;
  			if (counter % 1000 == 0) {
  				System.out.println(counter + " vectors loaded in memory!");
  			}
  		}
  		cursor.close();
  		long end = System.currentTimeMillis();
  		System.out.println(counter + " vectors loaded in " + (end - start) + " ms!");
  	}
docs: Loads the persistent index in memory.
  
  @throws Exception