Commit 5cfe0e8e authored by amir.yosef's avatar amir.yosef

Final

parent 5fed48e8
<component name="libraryTable">
<library name="io.quarkus.caffeine" type="repository">
<properties maven-id="io.quarkus:quarkus-caffeine:2.16.5.Final" />
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-caffeine/2.16.5.Final/quarkus-caffeine-2.16.5.Final.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-core/2.16.5.Final/quarkus-core-2.16.5.Final.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/jakarta/enterprise/jakarta.enterprise.cdi-api/2.0.2/jakarta.enterprise.cdi-api-2.0.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/jakarta/el/jakarta.el-api/3.0.3/jakarta.el-api-3.0.3.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/jakarta/interceptor/jakarta.interceptor-api/1.2.5/jakarta.interceptor-api-1.2.5.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/jakarta/ejb/jakarta.ejb-api/3.2.6/jakarta.ejb-api-3.2.6.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/jakarta/transaction/jakarta.transaction-api/1.3.2/jakarta.transaction-api-1.3.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/jakarta/inject/jakarta.inject-api/1.0/jakarta.inject-api-1.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-ide-launcher/2.16.5.Final/quarkus-ide-launcher-2.16.5.Final.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-development-mode-spi/2.16.5.Final/quarkus-development-mode-spi-2.16.5.Final.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/smallrye/config/smallrye-config/2.13.3/smallrye-config-2.13.3.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/smallrye/config/smallrye-config-core/2.13.3/smallrye-config-core-2.13.3.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/microprofile/config/microprofile-config-api/2.0.1/microprofile-config-api-2.0.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/smallrye/common/smallrye-common-annotation/1.13.2/smallrye-common-annotation-1.13.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/smallrye/common/smallrye-common-expression/1.13.2/smallrye-common-expression-1.13.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/smallrye/common/smallrye-common-function/1.13.2/smallrye-common-function-1.13.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/smallrye/common/smallrye-common-constraint/1.13.2/smallrye-common-constraint-1.13.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/smallrye/common/smallrye-common-classloader/1.13.2/smallrye-common-classloader-1.13.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm/9.4/asm-9.4.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/smallrye/config/smallrye-config-common/2.13.3/smallrye-config-common-2.13.3.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/logging/jboss-logging/3.5.0.Final/jboss-logging-3.5.0.Final.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/logmanager/jboss-logmanager-embedded/1.0.11/jboss-logmanager-embedded-1.0.11.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/logging/jboss-logging-annotations/2.2.1.Final/jboss-logging-annotations-2.2.1.Final.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/threads/jboss-threads/3.4.3.Final/jboss-threads-3.4.3.Final.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/slf4j/slf4j-jboss-logmanager/1.2.0.Final/slf4j-jboss-logmanager-1.2.0.Final.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/graalvm/sdk/graal-sdk/22.3.0/graal-sdk-22.3.0.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/wildfly/common/wildfly-common/1.5.4.Final-format-001/wildfly-common-1.5.4.Final-format-001.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-bootstrap-runner/2.16.5.Final/quarkus-bootstrap-runner-2.16.5.Final.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/smallrye/common/smallrye-common-io/1.13.2/smallrye-common-io-1.13.2.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/github/crac/org-crac/0.1.3/org-crac-0.1.3.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-fs-util/0.0.9/quarkus-fs-util-0.0.9.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/com/github/ben-manes/caffeine/caffeine/3.1.1/caffeine-3.1.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/com/google/errorprone/error_prone_annotations/2.14.0/error_prone_annotations-2.14.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-caffeine/2.16.5.Final/quarkus-caffeine-2.16.5.Final-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-core/2.16.5.Final/quarkus-core-2.16.5.Final-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/jakarta/enterprise/jakarta.enterprise.cdi-api/2.0.2/jakarta.enterprise.cdi-api-2.0.2-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/jakarta/el/jakarta.el-api/3.0.3/jakarta.el-api-3.0.3-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/jakarta/interceptor/jakarta.interceptor-api/1.2.5/jakarta.interceptor-api-1.2.5-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/jakarta/ejb/jakarta.ejb-api/3.2.6/jakarta.ejb-api-3.2.6-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/jakarta/transaction/jakarta.transaction-api/1.3.2/jakarta.transaction-api-1.3.2-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/jakarta/inject/jakarta.inject-api/1.0/jakarta.inject-api-1.0-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-ide-launcher/2.16.5.Final/quarkus-ide-launcher-2.16.5.Final-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-development-mode-spi/2.16.5.Final/quarkus-development-mode-spi-2.16.5.Final-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/smallrye/config/smallrye-config/2.13.3/smallrye-config-2.13.3-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/smallrye/config/smallrye-config-core/2.13.3/smallrye-config-core-2.13.3-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/eclipse/microprofile/config/microprofile-config-api/2.0.1/microprofile-config-api-2.0.1-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/smallrye/common/smallrye-common-annotation/1.13.2/smallrye-common-annotation-1.13.2-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/smallrye/common/smallrye-common-expression/1.13.2/smallrye-common-expression-1.13.2-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/smallrye/common/smallrye-common-function/1.13.2/smallrye-common-function-1.13.2-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/smallrye/common/smallrye-common-constraint/1.13.2/smallrye-common-constraint-1.13.2-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/smallrye/common/smallrye-common-classloader/1.13.2/smallrye-common-classloader-1.13.2-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/ow2/asm/asm/9.4/asm-9.4-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/smallrye/config/smallrye-config-common/2.13.3/smallrye-config-common-2.13.3-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/logging/jboss-logging/3.5.0.Final/jboss-logging-3.5.0.Final-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/logmanager/jboss-logmanager-embedded/1.0.11/jboss-logmanager-embedded-1.0.11-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/logging/jboss-logging-annotations/2.2.1.Final/jboss-logging-annotations-2.2.1.Final-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/threads/jboss-threads/3.4.3.Final/jboss-threads-3.4.3.Final-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/jboss/slf4j/slf4j-jboss-logmanager/1.2.0.Final/slf4j-jboss-logmanager-1.2.0.Final-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/graalvm/sdk/graal-sdk/22.3.0/graal-sdk-22.3.0-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/wildfly/common/wildfly-common/1.5.4.Final-format-001/wildfly-common-1.5.4.Final-format-001-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-bootstrap-runner/2.16.5.Final/quarkus-bootstrap-runner-2.16.5.Final-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/smallrye/common/smallrye-common-io/1.13.2/smallrye-common-io-1.13.2-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/github/crac/org-crac/0.1.3/org-crac-0.1.3-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/io/quarkus/quarkus-fs-util/0.0.9/quarkus-fs-util-0.0.9-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/com/github/ben-manes/caffeine/caffeine/3.1.1/caffeine-3.1.1-sources.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/com/google/errorprone/error_prone_annotations/2.14.0/error_prone_annotations-2.14.0-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
<component name="libraryTable">
<library name="lib">
<CLASSES>
<root url="file://$PROJECT_DIR$/../Socket/lib" />
</CLASSES>
<JAVADOC />
<SOURCES />
<jarDirectory url="file://$PROJECT_DIR$/../Socket/lib" recursive="false" />
</library>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="JsBuildToolPackageJson" sorting="DEFINITION_ORDER" /> <component name="JsBuildToolPackageJson" sorting="DEFINITION_ORDER" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_22" default="true" project-jdk-name="graalvm-22" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="21 (4)" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" /> <output url="file://$PROJECT_DIR$/out" />
</component> </component>
</project> </project>
\ No newline at end of file
---
# **Project Name**
## **Overview**
This project is a **Key_Value Server implementation in java** that implements a **Replication**. It is designed to handle multiple clients, efficiently manage caching, and execute commands in a reliable and scalable manner.
## **Project Structure**
The project is organized into several directories, each responsible for different components of the system:
- **`/commands`**: Contains the implementation of command handling. This directory includes classes and methods that define how commands are processed, executed, and managed within the system.
- **`/clients`**: Manages client interactions with the system. This directory includes:
- **`master client `**: Handles the communication and request processing for the master client.
- **`replica client `**: Manage how replica client see or handle the incoming Commands from the master.
- **`/parser`**: how we parse the command (Resp).
- **`/handlers`**: how each type of clients handle its own business
- **`/server`**: Contains the core server components. This directory includes the main server logic, networking, and the orchestration of client requests and command executions.
- **`/storage`**: Focuses on the storage and caching mechanisms. This directory includes:
- **Storage system components**: Manages the Caching system.
- **Caching system components**: Implements caching strategies to improve performance and reduce latency.
## **Attention**
You have no thing to do with any thing that specific to **Rdb** it just like configuration that needed for synchronization with replica (like Redis).
## **Getting Started**
### **Prerequisites**
Before you start, make sure you have the following installed on your machine:
- **Java JDK** (version 21 or higher)
- **redis-cli** (for easier testing)
### **Installation**
1. **Clone the repository:**
```bash
git clone https://git.hiast.edu.sy/amir.yosef/key_value-server
cd key_value-server
```
2. **Build the project:**
Use intellij Idea for building .
### **Running the Server**
To start the server:
1. **in the project directory ( class main args) :**
```Run configuration (args)
you can customize the type of the server,
if you passed the --Port <number> parameter the server will be starts on this port.
if you passsed the --replicaof "<master host> <master port" the type will be Replica Server.
```
2. **Run the server:**
```Directly
using intellij Idea
```
The server will start and listen for client connections.
### **Using Jar file**
after indexing required libraries.
1. **in Intellij add an artifact of the project using project structure in settings tap:**
2. **Build the Jar**
in intellij click on Build tap and build artifacts.
3. **Run the jar**
- navigate to the output (out) directory using terminal and do this:
- if you want to create Master Server just pass:
```bash
java -jar out/Server.jar --Port <number>
```
- if you want to create Replica Server ( Master Server required):
```bash
java -jar out/Server.jar --Port <number> --replicaof "<master host> <master port>"
```
### **Command Execution**
Commands are processed through the `/commands` module, which handles various types of commands (e.g., Set, Get, etc.). To execute a command:
1. **Use the redis-cli to send a command:**
Commands are typically sent from the master client to the server. The server processes the command and responds accordingly.
### **Storage and Caching**
The project uses a combination of managing storage and caching strategies to optimize performance:
- **Storage:** Manages the Storage components.
- **Caching:** Implements caching to store frequently accessed data in memory, reducing the need to query the storage system repeatedly.
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="lib" level="project" />
<orderEntry type="library" name="junit" level="project" /> <orderEntry type="library" name="junit" level="project" />
<orderEntry type="module-library" scope="TEST"> <orderEntry type="module-library" scope="TEST">
<library name="JUnit5.8.1"> <library name="JUnit5.8.1">
...@@ -27,6 +26,6 @@ ...@@ -27,6 +26,6 @@
</library> </library>
</orderEntry> </orderEntry>
<orderEntry type="library" name="io.quarkus.junit5.mockito" level="project" /> <orderEntry type="library" name="io.quarkus.junit5.mockito" level="project" />
<orderEntry type="library" name="io.quarkus.caffeine" level="project" /> <orderEntry type="library" name="github.ben.manes.caffeine" level="project" />
</component> </component>
</module> </module>
\ No newline at end of file
...@@ -10,7 +10,7 @@ public final class ServiceInfo { ...@@ -10,7 +10,7 @@ public final class ServiceInfo {
private ServiceInfo() { private ServiceInfo() {
info.put("role", "master"); info.put("role", "master");
info.put("cachePolicyName", "caffeine"); info.put("cachePolicyName", "lru");
} }
public static ServiceInfo getInstance() { public static ServiceInfo getInstance() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment