vendor: update all dependencies
This commit is contained in:
+29
-26
@@ -317,7 +317,8 @@ func (s *server) ReadRows(req *btpb.ReadRowsRequest, stream btpb.Bigtable_ReadRo
|
||||
return true
|
||||
}
|
||||
|
||||
if req.Rows != nil {
|
||||
if req.Rows != nil &&
|
||||
len(req.Rows.RowKeys)+len(req.Rows.RowRanges) > 0 {
|
||||
// Add the explicitly given keys
|
||||
for _, key := range req.Rows.RowKeys {
|
||||
k := string(key)
|
||||
@@ -698,8 +699,7 @@ func (s *server) MutateRows(req *btpb.MutateRowsRequest, stream btpb.Bigtable_Mu
|
||||
}
|
||||
r.mu.Unlock()
|
||||
}
|
||||
stream.Send(res)
|
||||
return nil
|
||||
return stream.Send(res)
|
||||
}
|
||||
|
||||
func (s *server) CheckAndMutateRow(ctx context.Context, req *btpb.CheckAndMutateRowRequest) (*btpb.CheckAndMutateRowResponse, error) {
|
||||
@@ -861,12 +861,13 @@ func (s *server) ReadModifyWriteRow(ctx context.Context, req *btpb.ReadModifyWri
|
||||
if !ok {
|
||||
return nil, status.Errorf(codes.NotFound, "table %q not found", req.TableName)
|
||||
}
|
||||
updates := make(map[string]cell) // copy of updated cells; keyed by full column name
|
||||
|
||||
fs := tbl.columnFamilies()
|
||||
|
||||
rowKey := string(req.RowKey)
|
||||
r := tbl.mutableRow(rowKey)
|
||||
resultRow := newRow(rowKey) // copy of updated cells
|
||||
|
||||
// This must be done before the row lock, acquired below, is released.
|
||||
r.mu.Lock()
|
||||
defer r.mu.Unlock()
|
||||
@@ -914,35 +915,37 @@ func (s *server) ReadModifyWriteRow(ctx context.Context, req *btpb.ReadModifyWri
|
||||
binary.BigEndian.PutUint64(val[:], uint64(v))
|
||||
newCell = cell{ts: ts, value: val[:]}
|
||||
}
|
||||
key := strings.Join([]string{fam, col}, ":")
|
||||
updates[key] = newCell
|
||||
|
||||
// Store the new cell
|
||||
f.cells[col] = appendOrReplaceCell(f.cellsByColumn(col), newCell)
|
||||
|
||||
// Store a copy for the result row
|
||||
resultFamily := resultRow.getOrCreateFamily(fam, fs[fam].order)
|
||||
resultFamily.cellsByColumn(col) // create the column
|
||||
resultFamily.cells[col] = []cell{newCell} // overwrite the cells
|
||||
}
|
||||
|
||||
// Build the response using the result row
|
||||
res := &btpb.Row{
|
||||
Key: req.RowKey,
|
||||
Key: req.RowKey,
|
||||
Families: make([]*btpb.Family, len(resultRow.families)),
|
||||
}
|
||||
for col, cell := range updates {
|
||||
i := strings.Index(col, ":")
|
||||
fam, qual := col[:i], col[i+1:]
|
||||
var f *btpb.Family
|
||||
for _, ff := range res.Families {
|
||||
if ff.Name == fam {
|
||||
f = ff
|
||||
break
|
||||
|
||||
for i, family := range resultRow.sortedFamilies() {
|
||||
res.Families[i] = &btpb.Family{
|
||||
Name: family.name,
|
||||
Columns: make([]*btpb.Column, len(family.colNames)),
|
||||
}
|
||||
|
||||
for j, colName := range family.colNames {
|
||||
res.Families[i].Columns[j] = &btpb.Column{
|
||||
Qualifier: []byte(colName),
|
||||
Cells: []*btpb.Cell{{
|
||||
TimestampMicros: family.cells[colName][0].ts,
|
||||
Value: family.cells[colName][0].value,
|
||||
}},
|
||||
}
|
||||
}
|
||||
if f == nil {
|
||||
f = &btpb.Family{Name: fam}
|
||||
res.Families = append(res.Families, f)
|
||||
}
|
||||
f.Columns = append(f.Columns, &btpb.Column{
|
||||
Qualifier: []byte(qual),
|
||||
Cells: []*btpb.Cell{{
|
||||
TimestampMicros: cell.ts,
|
||||
Value: cell.value,
|
||||
}},
|
||||
})
|
||||
}
|
||||
return &btpb.ReadModifyWriteRowResponse{Row: res}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user