VIBE v5.1.6
Search Engine
Loading...
Searching...
No Matches
edu.usfca.cs272.ThreadSafeQueryProcessor Class Reference
Inheritance diagram for edu.usfca.cs272.ThreadSafeQueryProcessor:
edu.usfca.cs272.Processor

Public Member Functions

 ThreadSafeQueryProcessor (ThreadSafeInvertedIndex index, WorkQueue queue, boolean partialSearch)
 
void parseQuery (Path query) throws IOException
 
void toJson (Path path) throws IOException
 
int numOfResults ()
 
List< InvertedIndex.Score > getScores (String query)
 
Set< String > getQueries ()
 
void parseQuery (String query)
 
String toString ()
 
- Public Member Functions inherited from edu.usfca.cs272.Processor
default int numOfScores (String query)
 
default boolean hasQuery (String query)
 

Detailed Description

Thread-safe variation of the Processor

Author
Ravneet Singh Bhatia
Version
Spring 2024

Constructor & Destructor Documentation

◆ ThreadSafeQueryProcessor()

edu.usfca.cs272.ThreadSafeQueryProcessor.ThreadSafeQueryProcessor ( ThreadSafeInvertedIndex index,
WorkQueue queue,
boolean partialSearch )

Creates a new ThreadSafeQueryProcessor

Parameters
indexthe thread safe invertedindex to search through.
queuethe workqueue to use.
partialSearchtrue if partial search needs to be performed.

Member Function Documentation

◆ getQueries()

Set< String > edu.usfca.cs272.ThreadSafeQueryProcessor.getQueries ( )

Returns the set of queries.

Returns
the set of queries.

Implements edu.usfca.cs272.Processor.

◆ getScores()

List< InvertedIndex.Score > edu.usfca.cs272.ThreadSafeQueryProcessor.getScores ( String query)

Returns the scores for a query.

Parameters
querythe query for which to return scores.
Returns
the scores for a query.

Implements edu.usfca.cs272.Processor.

◆ numOfResults()

int edu.usfca.cs272.ThreadSafeQueryProcessor.numOfResults ( )

Returns the number of queries for which there is a result.

Returns
the number of queries for which there is a result.

Implements edu.usfca.cs272.Processor.

◆ parseQuery() [1/2]

void edu.usfca.cs272.ThreadSafeQueryProcessor.parseQuery ( Path query) throws IOException

Reads a file containing queries to parse the queries within.

Parameters
querythe file containing the queries.
Exceptions
IOExceptionif the file is not found.

Implements edu.usfca.cs272.Processor.

◆ parseQuery() [2/2]

void edu.usfca.cs272.ThreadSafeQueryProcessor.parseQuery ( String query)

Parses a query.

Parameters
querythe query to be searched.

Implements edu.usfca.cs272.Processor.

◆ toJson()

void edu.usfca.cs272.ThreadSafeQueryProcessor.toJson ( Path path) throws IOException

Writes the search results in pretty Json to file path.

Parameters
paththe path of the file.
Exceptions
IOExceptionif the file is not found.

Implements edu.usfca.cs272.Processor.


The documentation for this class was generated from the following file: