mirror of
https://github.com/talent-plan/tinykv.git
synced 2025-01-13 13:50:43 +08:00
37 lines
1.4 KiB
Go
37 lines
1.4 KiB
Go
|
package server
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"github.com/pingcap-incubator/tinykv/proto/pkg/kvrpcpb"
|
||
|
)
|
||
|
|
||
|
// The functions below are Server's Raw API. (implements TinyKvServer).
|
||
|
// Some helper methods can be found in sever.go in the current directory
|
||
|
|
||
|
// RawGet return the corresponding Get response based on RawGetRequest's CF and Key fields
|
||
|
func (server *Server) RawGet(_ context.Context, req *kvrpcpb.RawGetRequest) (*kvrpcpb.RawGetResponse, error) {
|
||
|
// Your Code Here (1).
|
||
|
return nil, nil
|
||
|
}
|
||
|
|
||
|
// RawPut puts the target data into storage and returns the corresponding response
|
||
|
func (server *Server) RawPut(_ context.Context, req *kvrpcpb.RawPutRequest) (*kvrpcpb.RawPutResponse, error) {
|
||
|
// Your Code Here (1).
|
||
|
// Hint: Consider using Storage.Modify to store data to be modified
|
||
|
return nil, nil
|
||
|
}
|
||
|
|
||
|
// RawDelete delete the target data from storage and returns the corresponding response
|
||
|
func (server *Server) RawDelete(_ context.Context, req *kvrpcpb.RawDeleteRequest) (*kvrpcpb.RawDeleteResponse, error) {
|
||
|
// Your Code Here (1).
|
||
|
// Hint: Consider using Storage.Modify to store data to be deleted
|
||
|
return nil, nil
|
||
|
}
|
||
|
|
||
|
// RawScan scan the data starting from the start key up to limit. and return the corresponding result
|
||
|
func (server *Server) RawScan(_ context.Context, req *kvrpcpb.RawScanRequest) (*kvrpcpb.RawScanResponse, error) {
|
||
|
// Your Code Here (1).
|
||
|
// Hint: Consider using reader.IterCF
|
||
|
return nil, nil
|
||
|
}
|