Reputation: 1653
I am trying to write a row to a Bigtable table using the Go SDK for Bigtable. I am using the apply method on a table object.
I receive the following error when I try to write more than once:
rpc error: code = Canceled desc = grpc: the client connection is closing
Following is my code:
func Put(tableName string, columnFamilyName string, rowKey string, attrMap map[string]interface{}) error {
tbl := BigTableClient.Open(tableName)
mut := bigtable.NewMutation()
for key, val := range attrMap {
if utils.IsJSON(val.(string)) {
v, _ := json.Marshal(val)
mut.Set(columnFamilyName, key, bigtable.Now(), []byte(v))
} else {
v := val.(string)
mut.Set(columnFamilyName, key, bigtable.Now(), []byte(v))
}
}
err := tbl.Apply(BigTableContext, rowKey, mut)
if err != nil {
errMsg := "Error while writing to BT: " + err.Error()
logger.LogError(errMsg)
}
return err
}
Can someone help me understand the issue?
Upvotes: 1
Views: 363