github.com/tsuna/gohbase@v0.0.0-20250731002811-4ffcadfba63e/hrpc/disable.go (about) 1 // Copyright (C) 2015 The GoHBase Authors. All rights reserved. 2 // This file is part of GoHBase. 3 // Use of this source code is governed by the Apache License 2.0 4 // that can be found in the COPYING file. 5 6 package hrpc 7 8 import ( 9 "context" 10 11 "github.com/tsuna/gohbase/pb" 12 "google.golang.org/protobuf/proto" 13 ) 14 15 // DisableTable represents a DisableTable HBase call 16 type DisableTable struct { 17 base 18 } 19 20 // NewDisableTable creates a new DisableTable request that will disable the 21 // given table in HBase. For use by the admin client. 22 func NewDisableTable(ctx context.Context, table []byte) *DisableTable { 23 return &DisableTable{ 24 base{ 25 table: table, 26 ctx: ctx, 27 resultch: make(chan RPCResult, 1), 28 }, 29 } 30 } 31 32 // Name returns the name of this RPC call. 33 func (dt *DisableTable) Name() string { 34 return "DisableTable" 35 } 36 37 // Description returns the description of this RPC call. 38 func (dt *DisableTable) Description() string { 39 return dt.Name() 40 } 41 42 // ToProto converts the RPC into a protobuf message 43 func (dt *DisableTable) ToProto() proto.Message { 44 return &pb.DisableTableRequest{ 45 TableName: &pb.TableName{ 46 // TODO: handle namespaces 47 Namespace: []byte("default"), 48 Qualifier: dt.table, 49 }, 50 } 51 } 52 53 // NewResponse creates an empty protobuf message to read the response of this 54 // RPC. 55 func (dt *DisableTable) NewResponse() proto.Message { 56 return &pb.DisableTableResponse{} 57 }