bigtable: emulator returns Unimplemented for snapshot RPCs
The emulator will return an error with code Unimplemented, instead of panicking,
on all snapshot-related RPCs.
Fixes
@@ -48,6 +48,7 @@ import (
"golang.org/x/net/context"
btapb "google.golang.org/genproto/googleapis/bigtable/admin/v2"
btpb "google.golang.org/genproto/googleapis/bigtable/v2"
+ "google.golang.org/genproto/googleapis/longrunning"
statpb "google.golang.org/genproto/googleapis/rpc/status"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
@@ -136,6 +137,10 @@ func (s *server) CreateTable(ctx context.Context, req *btapb.CreateTableRequest)
return &btapb.Table{Name: tbl}, nil
}
+func (s *server) CreateTableFromSnapshot(context.Context, *btapb.CreateTableFromSnapshotRequest) (*longrunning.Operation, error) {
+ return nil, status.Errorf(codes.Unimplemented, "the emulator does not currently support snapshots")
+}
+
func (s *server) ListTables(ctx context.Context, req *btapb.ListTablesRequest) (*btapb.ListTablesResponse, error) {
res := &btapb.ListTablesResponse{}
prefix := req.Parent + "/tables/"
@@ -295,6 +300,20 @@ func (s *server) CheckConsistency(ctx context.Context, req *btapb.CheckConsisten
}, nil
}
+func (s *server) SnapshotTable(context.Context, *btapb.SnapshotTableRequest) (*longrunning.Operation, error) {
+ return nil, status.Errorf(codes.Unimplemented, "the emulator does not currently support snapshots")
+}
+
+func (s *server) GetSnapshot(context.Context, *btapb.GetSnapshotRequest) (*btapb.Snapshot, error) {
+ return nil, status.Errorf(codes.Unimplemented, "the emulator does not currently support snapshots")
+}
+func (s *server) ListSnapshots(context.Context, *btapb.ListSnapshotsRequest) (*btapb.ListSnapshotsResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "the emulator does not currently support snapshots")
+}
+func (s *server) DeleteSnapshot(context.Context, *btapb.DeleteSnapshotRequest) (*emptypb.Empty, error) {
+ return nil, status.Errorf(codes.Unimplemented, "the emulator does not currently support snapshots")
+}
+
func (s *server) ReadRows(req *btpb.ReadRowsRequest, stream btpb.Bigtable_ReadRowsServer) error {
s.mu.Lock()
tbl, ok := s.tables[req.TableName]
