-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
saflin hussain
committed
May 16, 2016
1 parent
5df3b3a
commit 5861f8e
Showing
1 changed file
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,58 @@ | ||
# prime-generator | ||
# prime-generator | ||
|
||
A simple restful webservice based prime generator. | ||
|
||
Presently support three implemenations | ||
|
||
1) Trial by division | ||
|
||
2) Eratosthenes Sieve | ||
|
||
3) Parallel version of Eratosthenes Sieve | ||
|
||
|
||
|
||
# Building the project | ||
|
||
Requires Java 1.8 and maven to build this project | ||
|
||
|
||
1) Clone the project to your local directory | ||
|
||
2) Go inside the local directory and execute below command | ||
|
||
mvn clean package | ||
|
||
|
||
# Running the application | ||
|
||
After building the project execute the below command | ||
|
||
java -jar target/prime-generator-1.0-SNAPSHOT.jar | ||
|
||
This should start the spring boot application. | ||
|
||
# Testing the application | ||
|
||
Project presently expose below rest endpoints | ||
|
||
1) Get all the supported prime generation algorithms | ||
|
||
http://localhost:8080/generator/algorithms | ||
|
||
2) Get all prime number upto 'n' using TRIAL_DIVISION algorithm | ||
|
||
http://localhost:8080/generator/prime?algorithm=TRIAL_DIVISION&ceiling=n | ||
|
||
3) Get all prime number upto 'n' using ERATOSTHENES_SIEVE_SEQUENTIAL algorithm | ||
|
||
http://localhost:8080/generator/prime?algorithm=ERATOSTHENES_SIEVE_SEQUENTIAL&ceiling=100 | ||
|
||
4) Get all prime number upto 'n' using ERATOSTHENES_SIEVE_PARALLEL algorithm | ||
|
||
http://localhost:8080/generator/prime?algorithm=ERATOSTHENES_SIEVE_PARALLEL&ceiling=100 | ||
|
||
|
||
|
||
|
||
|