Question: The File Retrieval Engine must adhere to the architecture shown in Figure 1 and must contain three components: AppInterface, ProcessingEngine and IndexStore. The AppInterface component
The File Retrieval Engine must adhere to the architecture shown in Figure and must
contain three components: AppInterface, ProcessingEngine and IndexStore.
The AppInterface component is responsible with implementing a command line interface
that the user can use to interact with the File Retrieval Engine, with interpreting indexing
and search commands submitted by the user, with forwarding the commands to the
ProcessingEngine and with printing the results of the commands on screen.
The ProcessingEngine component is responsible with running the indexing and search
commands received from the AppInterface component. In terms of indexing, the
ProcessingEngine must use multiple worker threads, that are configured at execution
time, to build an index from the files found at a specified directory. Each worker thread is
responsible with building a local index and with forwarding the local index to the
Figure : File Retrieval Engine Architecture.
IndexStore in order to ultimately build a global index. In terms of search, the
ProcessingEngine must break down a search query into one or more single term queries,
must retrieve for each single term query the list of files in which the term can be found and
the number of occurrences, and must combine the list of files from each single term query
result, sort the files by occurrence and return the top files.
The IndexStore component is responsible with storing the global index and providing the
means to query the global index. More specifically, it should expose an interface to update
the global index with a local index and an interface to return the list of files and the number
of occurrences in which a term can be found.
package cscapp;
import java.lang.System;
import java.util.Scanner;
public class AppInterface
private ProcessingEngine engine;
public AppInterfaceProcessingEngine engine
this.engine engine;
TODO implement constructor
public void readCommands
TODO implement the read commands method
Scanner sc new ScannerSystemin;
String command;
while true
System.out.print;
read from command line
command scnext;
if the command is quit, terminate the program
if commandcompareToquit
engine.stopWorkers;
break;
if the command begins with index, index the files from the specified directory
if commandlength && command.substringcompareToindex
TODO implement index operation
continue;
if the command begins with search, search for files that matches the query
if commandlength && command.substringcompareTosearch
TODO implement index operation
continue;
System.out.printlnunrecognized command!";
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
