Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Build fixes for old example tools.

  • Loading branch information...
commit e1e0742358cd61fd98f8d5a5dd89e899828cf856 1 parent 4614728
@dustin dustin authored
Showing with 15 additions and 5 deletions.
  1. +2 −2 hello/hello.go
  2. +10 −0 pools.go
  3. +3 −3 populate/populate.go
View
4 hello/hello.go
@@ -15,7 +15,7 @@ func maybeFatal(err error) {
}
}
-func doOps(b couchbase.Bucket) {
+func doOps(b *couchbase.Bucket) {
fmt.Printf("Doing some ops on %s\n", b.Name)
start := time.Now()
total := 2048
@@ -34,7 +34,7 @@ func doOps(b couchbase.Bucket) {
total*3, time.Now().Sub(start).String())
}
-func exploreBucket(bucket couchbase.Bucket) {
+func exploreBucket(bucket *couchbase.Bucket) {
fmt.Printf(" %v uses %s\n", bucket.Name,
bucket.VBucketServerMap.HashAlgorithm)
for pos, server := range bucket.VBucketServerMap.ServerList {
View
10 pools.go
@@ -208,6 +208,16 @@ func (p *Pool) GetBucket(name string) (b *Bucket, err error) {
return &rv, nil
}
+// Get the pool to which this bucket belongs.
+func (b *Bucket) GetPool() *Pool {
+ return b.pool
+}
+
+// Get the client from which we got this pool.
+func (p *Pool) GetClient() *Client {
+ return &p.client
+}
+
// Convenience function for getting a named bucket from a URL
func GetBucket(endpoint, poolname, bucketname string) (*Bucket, error) {
var err error
View
6 populate/populate.go
@@ -53,7 +53,7 @@ type Record struct {
Score int `json:"score"`
}
-func report(c couchbase.Client, b *couchbase.Bucket) {
+func report(c *couchbase.Client, b *couchbase.Bucket) {
fmt.Printf("-----------------------------------------------------\n")
fmt.Printf("Got %d success messages, %d not-my-vbucket\n",
c.Statuses[0], c.Statuses[7])
@@ -80,7 +80,7 @@ func report(c couchbase.Client, b *couchbase.Bucket) {
}
}
-func harass(c couchbase.Client, b *couchbase.Bucket) {
+func harass(c *couchbase.Client, b *couchbase.Bucket) {
fmt.Printf("Doing stuff\n")
go func() {
@@ -115,5 +115,5 @@ func main() {
}
defer bucket.Close()
- harass(bucket.Pool, bucket)
+ harass(bucket.GetPool().GetClient(), bucket)
}
Please sign in to comment.
Something went wrong with that request. Please try again.