synchronized void recover(RecoveryFile recoveryFile, int recoveryIndex, TaskMonitor monitor)
			throws IOException, CancelledException {

		if (corruptedState) {
			throw new IOException("Corrupted BufferMgr state");
		}

		boolean success = false;
		try {

			startCheckpoint();

			int[] bufferIndexes = recoveryFile.getBufferIndexes();
			monitor.initialize(bufferIndexes.length);

			// Ensure that all indexes are allocated
			int origIndexCount = indexProvider.getIndexCount();
			int recoveryIndexCount = recoveryFile.getIndexCount();
			if (recoveryIndexCount > origIndexCount) {
				// Allocate and free all indexes added to end of file
				int maxIndex = recoveryIndexCount - 1;
				indexProvider.allocateIndex(maxIndex);
				indexProvider.freeIndex(maxIndex);
			}

			// Recover free buffer list
			int[] freeIndexes = recoveryFile.getFreeIndexList();
			for (int index : freeIndexes) {
				monitor.checkCancelled();
				if (index >= origIndexCount) {
					// Newly allocated free buffer
					BufferNode node = createNewBufferNode(index, currentCheckpointHead, null);
					node.isDirty = true;
					node.modified = true;
					node.empty = true;
				}
				else if (!indexProvider.isFree(index)) {
					deleteBuffer(index);
				}
			}

//			// Recover parameters
//			cacheFile.clearParameters();
//			String[] parmNames = recoveryFile.getUserParameterNames();
//			for (int i = 0; i < parmNames.length; i++) {
//				cacheFile.setParameter(parmNames[i], recoveryFile.getUserParameter(parmNames[i]));
//			}

			// Recover modified buffers
			Arrays.sort(bufferIndexes);
			for (int i = 0; i < bufferIndexes.length; i++) {

				monitor.checkCancelled();
				monitor.setProgress(i + 1);

				// Get recovery buffer
				int index = bufferIndexes[i];
				indexProvider.allocateIndex(index);

				BufferNode node = createNewBufferNode(index, currentCheckpointHead, null);
				DataBuffer buf = getCacheBuffer();
				buf.setId(index);
				buf.setDirty(true);
				buf.setEmpty(false);

				recoveryFile.getBuffer(buf, index);

				node.isDirty = true;
				node.modified = true;
				node.empty = false;
				node.snapshotTaken[recoveryIndex] = true; // buffer already stored in recovery file

				// Add node to cache
				returnToCache(node, buf);
			}
			checkpoint();
			success = true;
		}
		finally {
			if (!success) {
				Msg.error(this, "Buffer file recover failed using: " + recoveryFile.getFile());
			}
			corruptedState = !success;
		}

	}
Recover data from recovery file
@param recoveryFile recovery file
@param recoveryIndex recovery index (0 or 1) which corresponds to
recoveryFile.
@param monitor task monitor
@throws IOException if IO error occurs
@throws CancelledException if task monitor is cancelled
Ghidra/Framework/DB/src/main/java/db/buffers/BufferMgr.java