Commit 2ff3bcac authored by NILANJAN DAW's avatar NILANJAN DAW

README added, moved to multifile setup

parent 7e608ee6
# High Performance Distributed Object Store [HPDOS]
## About
The HPDOS project is an attempt to optimise the storage stack in hyperconverged setups in recognition of recent advances in hardware technologies like SmartNICs, NVMe SSDs and persistent memories.
Here we plan to take advantage of SmartNIC technologies more specifically SoC based NICs to speed up the storage stack.
## Getting started
The folder code contains the HPDOS server and client implementation. To use them clone this repo.
HPDOS uses `gRPC` system calls with `protocol buffers` as the data exchange standard. The project is managed using `Gradle` project manager. As a first step, install the system requirements listed at the end of this section.
### Compile
To compile the codebase run `./gradlew build` separately from the client and server root directory. Gradle should take care of installing and managing any third party libraries used.
### Execute
To execute the server and client run `./gradlew run` in separate terminals.
### Clean
The project build generated files can be cleaned by running `./gradlew clean`
### System Requirements
- Java | OpenJDK 14.0+
- Gradle
- Protocol Buffer / Protobuf
\ No newline at end of file
......@@ -6,7 +6,9 @@ package HpdosClient;
import HpdosClient.MessageFormat.MessageConstants;
import HpdosClient.MessageFormat.RequestBuilder;
import hpdos.grpc.NetworkServiceGrpc;
import hpdos.grpc.Packet;
import hpdos.grpc.PacketFormatProto;
import hpdos.grpc.Request;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
......@@ -26,12 +28,12 @@ public class ClientRunner {
.build();
String key = "dummy", value = "dummy";
NetworkServiceGrpc.NetworkServiceBlockingStub stub = NetworkServiceGrpc.newBlockingStub(channel);
ArrayList<PacketFormatProto.Request> request = new ArrayList<>();
ArrayList<Request> request = new ArrayList<>();
request.add(RequestBuilder.buildRequest(MessageConstants.METADATA_LOOKUP_REQUEST,
0, 0, key, 0, value));
PacketFormatProto.Packet packet = RequestBuilder.buildPacket(request);
Packet packet = RequestBuilder.buildPacket(request);
Timestamp timestamp = Timestamp.from(Instant.now());
PacketFormatProto.Packet response = stub.getMetadata(packet);
Packet response = stub.getMetadata(packet);
System.out.println(response);
System.out.println("Time taken in ms: " + (Timestamp.from(Instant.now()).getTime() - timestamp.getTime()));
......
package HpdosClient.MessageFormat;
import hpdos.grpc.PacketFormatProto.Packet;
import hpdos.grpc.PacketFormatProto.Request;
import hpdos.grpc.Packet;
import hpdos.grpc.Request;
import java.util.ArrayList;
public class RequestBuilder {
public static Request buildRequest(int operationType, int version,
int dataSize, String key, int crc, String value) {
int dataSize, String key, int crc, String value) {
Request.Builder request = Request.newBuilder();
request.setOperationType(operationType);
request.setVersion(version);
......
package HpdosClient.MessageFormat;
import hpdos.grpc.PacketFormatProto;
import hpdos.grpc.*;
import java.util.ArrayList;
public class ResponseBuilder {
public static PacketFormatProto.Ack buildAck(int version, int dataSize, String key, int crc, String value) {
PacketFormatProto.Ack.Builder ack = PacketFormatProto.Ack.newBuilder();
public static Ack buildAck(int version, int dataSize, String key, int crc, String value) {
Ack.Builder ack = Ack.newBuilder();
ack.setStatus(MessageConstants.STATUS_OK);
ack.setKey(key);
ack.setVersion(version);
......@@ -16,8 +16,8 @@ public class ResponseBuilder {
return ack.build();
}
public static PacketFormatProto.Nack buildNack(int version, int reason, String key) {
PacketFormatProto.Nack.Builder nack = PacketFormatProto.Nack.newBuilder();
public static Nack buildNack(int version, int reason, String key) {
Nack.Builder nack = Nack.newBuilder();
nack.setStatus(MessageConstants.STATUS_FAIL);
nack.setKey(key);
nack.setVersion(version);
......@@ -25,10 +25,10 @@ public class ResponseBuilder {
return nack.build();
}
public static PacketFormatProto.Response buildResponsePacket(int operationType,
ArrayList<PacketFormatProto.Ack> acks,
ArrayList<PacketFormatProto.Nack> nacks) {
PacketFormatProto.Response.Builder response = PacketFormatProto.Response.newBuilder();
public static Response buildResponsePacket(int operationType,
ArrayList<Ack> acks,
ArrayList<Nack> nacks) {
Response.Builder response = Response.newBuilder();
response.setOperationType(operationType);
if (acks != null)
response.addAllAck(acks);
......@@ -41,8 +41,8 @@ public class ResponseBuilder {
return response.build();
}
public static PacketFormatProto.Packet buildPacket(ArrayList<PacketFormatProto.Response> responses) {
PacketFormatProto.Packet.Builder packet = PacketFormatProto.Packet.newBuilder();
public static Packet buildPacket(ArrayList<Response> responses) {
Packet.Builder packet = Packet.newBuilder();
packet.setPacketType(MessageConstants.PACKET_METADATA_RESPONSE);
packet.addAllResponse(responses);
return packet.build();
......
......@@ -2,6 +2,7 @@ syntax = "proto3";
package hpdos.grpc;
option java_multiple_files = true;
option java_package = "hpdos.grpc";
option java_outer_classname = "PacketFormatProto";
......
package hpdos;
import hpdos.grpc.PacketFormatProto;
import hpdos.grpc.*;
import hpdos.messageformat.*;
import hpdos.grpc.NetworkServiceGrpc;
import io.grpc.stub.StreamObserver;
......@@ -11,18 +10,18 @@ import java.util.ArrayList;
public class NetworkHandler extends NetworkServiceGrpc.NetworkServiceImplBase {
@Override
public void getMetadata(PacketFormatProto.Packet request,
StreamObserver<PacketFormatProto.Packet> responseObserver) {
public void getMetadata(Packet request,
StreamObserver<Packet> responseObserver) {
System.out.println("Data received" + request.toString());
String key = "dummy";
String value = "dummy";
ArrayList<PacketFormatProto.Ack> acks = new ArrayList<>();
ArrayList<Ack> acks = new ArrayList<>();
acks.add(ResponseBuilder.buildAck(0, 100, key, 0, value));
ArrayList<PacketFormatProto.Response> responses = new ArrayList<>();
ArrayList<Response> responses = new ArrayList<>();
responses.add(ResponseBuilder.
buildResponsePacket(MessageConstants.METADATA_LOOKUP_RESPONSE, acks, null));
PacketFormatProto.Packet packet = ResponseBuilder.buildPacket(responses);
Packet packet = ResponseBuilder.buildPacket(responses);
System.out.println(packet);
responseObserver.onNext(packet);
responseObserver.onCompleted();
......
package hpdos.messageformat;
import hpdos.grpc.Packet;
import hpdos.grpc.PacketFormatProto;
import hpdos.grpc.Request;
import java.util.ArrayList;
public class RequestBuilder {
public static PacketFormatProto.Request buildRequest(int operationType, int version,
public static Request buildRequest(int operationType, int version,
int dataSize, String key, int crc, String value) {
PacketFormatProto.Request.Builder request = PacketFormatProto.Request.newBuilder();
Request.Builder request = Request.newBuilder();
request.setOperationType(operationType);
request.setVersion(version);
request.setDataSize(dataSize);
......@@ -18,8 +20,8 @@ public class RequestBuilder {
return request.build();
}
public static PacketFormatProto.Packet buildPacket(ArrayList<PacketFormatProto.Request> requests) {
PacketFormatProto.Packet.Builder packet = PacketFormatProto.Packet.newBuilder();
public static Packet buildPacket(ArrayList<Request> requests) {
Packet.Builder packet = Packet.newBuilder();
packet.setPacketType(MessageConstants.PACKET_METADATA_REQUEST);
packet.addAllRequest(requests);
return packet.build();
......
package hpdos.messageformat;
import java.util.ArrayList;
import hpdos.grpc.PacketFormatProto;
import hpdos.grpc.*;
public class ResponseBuilder {
public static PacketFormatProto.Ack buildAck(int version, int dataSize, String key, int crc, String value) {
PacketFormatProto.Ack.Builder ack = PacketFormatProto.Ack.newBuilder();
public static Ack buildAck(int version, int dataSize, String key, int crc, String value) {
Ack.Builder ack = Ack.newBuilder();
ack.setStatus(MessageConstants.STATUS_OK);
ack.setKey(key);
ack.setVersion(version);
......@@ -15,8 +16,8 @@ public class ResponseBuilder {
return ack.build();
}
public static PacketFormatProto.Nack buildNack(int version, int reason, String key) {
PacketFormatProto.Nack.Builder nack = PacketFormatProto.Nack.newBuilder();
public static Nack buildNack(int version, int reason, String key) {
Nack.Builder nack = Nack.newBuilder();
nack.setStatus(MessageConstants.STATUS_FAIL);
nack.setKey(key);
nack.setVersion(version);
......@@ -24,10 +25,10 @@ public class ResponseBuilder {
return nack.build();
}
public static PacketFormatProto.Response buildResponsePacket(int operationType,
ArrayList<PacketFormatProto.Ack> acks,
ArrayList<PacketFormatProto.Nack> nacks) {
PacketFormatProto.Response.Builder response = PacketFormatProto.Response.newBuilder();
public static Response buildResponsePacket(int operationType,
ArrayList<Ack> acks,
ArrayList<Nack> nacks) {
Response.Builder response = Response.newBuilder();
response.setOperationType(operationType);
if (acks != null)
response.addAllAck(acks);
......@@ -40,8 +41,8 @@ public class ResponseBuilder {
return response.build();
}
public static PacketFormatProto.Packet buildPacket(ArrayList<PacketFormatProto.Response> responses) {
PacketFormatProto.Packet.Builder packet = PacketFormatProto.Packet.newBuilder();
public static Packet buildPacket(ArrayList<Response> responses) {
Packet.Builder packet = Packet.newBuilder();
packet.setPacketType(MessageConstants.PACKET_METADATA_RESPONSE);
packet.addAllResponse(responses);
return packet.build();
......
......@@ -2,6 +2,7 @@ syntax = "proto3";
package hpdos.grpc;
option java_multiple_files = true;
option java_package = "hpdos.grpc";
option java_outer_classname = "PacketFormatProto";
......
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