Skip to content

Feature/proto creation#4

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

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

Conversation

@dionydion

@dionydion dionydion commented Dec 5, 2023

Copy link
Copy Markdown
Collaborator

Feature: attached storage engine to grpc server

string key = 1;
}

message GetResponse {

Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread pkg/server/grpcServer.go
}

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

Copy link
Copy Markdown
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

Comment thread pkg/server/grpcServer.go
func NewGrpcServer() *grpcServer {
newStorageConfig := storage.NewConfigWithOpts(
storage.WithTreeType(tree.BTree),
storage.WithFilePath("testFile.txt"),

Copy link
Copy Markdown
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

Comment thread pkg/server/grpcServer.go

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

Copy link
Copy Markdown
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

Comment thread pkg/storage/simpledb.go
@@ -0,0 +1,23 @@
package storage

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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