Skip to content

Feature/proto creation#4

Open
dionydion wants to merge 18 commits intomainfrom
feature/proto-creation
Open

Feature/proto creation#4
dionydion wants to merge 18 commits intomainfrom
feature/proto-creation

Conversation

@dionydion
Copy link
Collaborator

@dionydion dionydion commented Dec 5, 2023

Feature: attached storage engine to grpc server

string key = 1;
}

message GetResponse {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should return the key back to user as well

string value = 2;
}

message PutResponse {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should return key and value back to user as well

}

func NewGrpcServer() *grpcServer {
newStorageConfig := storage.NewConfigWithOpts(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see how its done in the http server, you dont build a new storage engine everytime, its a singleton that is shared between all servers, not an instance that is instantiated everytime

func NewGrpcServer() *grpcServer {
newStorageConfig := storage.NewConfigWithOpts(
storage.WithTreeType(tree.BTree),
storage.WithFilePath("testFile.txt"),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is taken in as a flag


func NewGrpcServer() *grpcServer {
newStorageConfig := storage.NewConfigWithOpts(
storage.WithTreeType(tree.BTree),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see how its done in http server, all these are abstracted from the grpc server

@@ -0,0 +1,23 @@
package storage

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this file added again

@@ -0,0 +1,29 @@
import SimpleDB

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the client or server, if its the server, its not needed

@@ -0,0 +1,17 @@
import KVStoreService
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also can rename the dreictory to sth like py-cli?

)


class KeyValueServiceServicer(object):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ServiceServicer?

import KVStoreService
from enum.command import Command

class KVStoreController():
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont call it controller, controllers mean different things in the cloud and go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants