From cfe9e4afb4a24f89a2b1efa0215334dc23d7aabf Mon Sep 17 00:00:00 2001 From: Riley Karson Date: Wed, 28 Jun 2017 09:54:26 -0700 Subject: [PATCH] Vendored updated bigtable client. --- vendor/cloud.google.com/go/bigtable/admin.go | 21 ++++++++++++++++++ .../cloud.google.com/go/bigtable/bigtable.go | 2 +- vendor/cloud.google.com/go/bigtable/filter.go | 22 +++++++++---------- vendor/vendor.json | 6 ++--- 4 files changed, 36 insertions(+), 15 deletions(-) diff --git a/vendor/cloud.google.com/go/bigtable/admin.go b/vendor/cloud.google.com/go/bigtable/admin.go index 4838d350..a1f5f01c 100644 --- a/vendor/cloud.google.com/go/bigtable/admin.go +++ b/vendor/cloud.google.com/go/bigtable/admin.go @@ -369,3 +369,24 @@ func (iac *InstanceAdminClient) Instances(ctx context.Context) ([]*InstanceInfo, } return is, nil } + +// InstanceInfo returns information about an instance. +func (iac *InstanceAdminClient) InstanceInfo(ctx context.Context, instanceId string) (*InstanceInfo, error) { + ctx = mergeOutgoingMetadata(ctx, iac.md) + req := &btapb.GetInstanceRequest{ + Name: "projects/" + iac.project + "/instances/" + instanceId, + } + res, err := iac.iClient.GetInstance(ctx, req) + if err != nil { + return nil, err + } + + m := instanceNameRegexp.FindStringSubmatch(res.Name) + if m == nil { + return nil, fmt.Errorf("malformed instance name %q", res.Name) + } + return &InstanceInfo{ + Name: m[2], + DisplayName: res.DisplayName, + }, nil +} diff --git a/vendor/cloud.google.com/go/bigtable/bigtable.go b/vendor/cloud.google.com/go/bigtable/bigtable.go index 5c2129cb..316e3d3c 100644 --- a/vendor/cloud.google.com/go/bigtable/bigtable.go +++ b/vendor/cloud.google.com/go/bigtable/bigtable.go @@ -73,7 +73,7 @@ func (c *Client) Close() error { } var ( - idempotentRetryCodes = []codes.Code{codes.DeadlineExceeded, codes.Unavailable, codes.Aborted, codes.Internal} + idempotentRetryCodes = []codes.Code{codes.DeadlineExceeded, codes.Unavailable, codes.Aborted} isIdempotentRetryCode = make(map[codes.Code]bool) retryOptions = []gax.CallOption{ gax.WithDelayTimeoutSettings(100*time.Millisecond, 2000*time.Millisecond, 1.2), diff --git a/vendor/cloud.google.com/go/bigtable/filter.go b/vendor/cloud.google.com/go/bigtable/filter.go index fb85498c..a1cf748a 100644 --- a/vendor/cloud.google.com/go/bigtable/filter.go +++ b/vendor/cloud.google.com/go/bigtable/filter.go @@ -154,7 +154,7 @@ func (stripValueFilter) proto() *btpb.RowFilter { return &btpb.RowFilter{Filter: &btpb.RowFilter_StripValueTransformer{true}} } -// TimestampRangeFilter returns a filter that matches any rows whose timestamp is within the given time bounds. A zero +// TimestampRangeFilter returns a filter that matches any cells whose timestamp is within the given time bounds. A zero // time means no bound. // The timestamp will be truncated to millisecond granularity. func TimestampRangeFilter(startTime time.Time, endTime time.Time) Filter { @@ -168,7 +168,7 @@ func TimestampRangeFilter(startTime time.Time, endTime time.Time) Filter { return trf } -// TimestampRangeFilterMicros returns a filter that matches any rows whose timestamp is within the given time bounds, +// TimestampRangeFilterMicros returns a filter that matches any cells whose timestamp is within the given time bounds, // specified in units of microseconds since 1 January 1970. A zero value for the end time is interpreted as no bound. // The timestamp will be truncated to millisecond granularity. func TimestampRangeFilterMicros(startTime Timestamp, endTime Timestamp) Filter { @@ -187,10 +187,10 @@ func (trf timestampRangeFilter) String() string { func (trf timestampRangeFilter) proto() *btpb.RowFilter { return &btpb.RowFilter{ Filter: &btpb.RowFilter_TimestampRangeFilter{ - &btpb.TimestampRange{ - int64(trf.startTime.TruncateToMilliseconds()), - int64(trf.endTime.TruncateToMilliseconds()), - }, + &btpb.TimestampRange{ + int64(trf.startTime.TruncateToMilliseconds()), + int64(trf.endTime.TruncateToMilliseconds()), + }, }} } @@ -228,8 +228,8 @@ func ValueRangeFilter(start, end []byte) Filter { } type valueRangeFilter struct { - start []byte - end []byte + start []byte + end []byte } func (vrf valueRangeFilter) String() string { @@ -260,8 +260,8 @@ func ConditionFilter(predicateFilter, trueFilter, falseFilter Filter) Filter { type conditionFilter struct { predicateFilter Filter - trueFilter Filter - falseFilter Filter + trueFilter Filter + falseFilter Filter } func (cf conditionFilter) String() string { @@ -282,7 +282,7 @@ func (cf conditionFilter) proto() *btpb.RowFilter { cf.predicateFilter.proto(), tf, ff, - }}} + }}} } // TODO(dsymonds): More filters: sampling diff --git a/vendor/vendor.json b/vendor/vendor.json index f303c341..2a736b49 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -3,10 +3,10 @@ "ignore": "appengine test github.com/hashicorp/nomad/", "package": [ { - "checksumSHA1": "fEobtlzPZ57VXi864qMmblI2gsA=", + "checksumSHA1": "NrTYYg3++pBxH1Z8xjVg6ssQTYY=", "path": "cloud.google.com/go/bigtable", - "revision": "69931d826ffbbcb4f8451b42d5cf7fc2ac6c7443", - "revisionTime": "2017-06-09T14:31:37Z" + "revision": "f6bedb5a8dbce75418580cedf5c2434c78d06cfa", + "revisionTime": "2017-06-27T21:12:08Z" }, { "checksumSHA1": "B1HkIrBavSgy6ntVyGr/eNUy44I=",