ppgohbase

package module
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

README

ppgohbase

This package instruments the tsuna/gohbase package.

Installation

$ go get github.com/pinpoint-apm/pinpoint-go-agent/plugin/gohbase
import "github.com/pinpoint-apm/pinpoint-go-agent/plugin/gohbase"

Usage

PkgGoDev

This package instruments the gohbase calls. Use the NewClient as the gohbase.NewClient.

client := ppgohbase.NewClient("localhost")

It is necessary to pass the context containing the pinpoint.Tracer to gohbase.Client.

ctx := pinpoint.NewContext(context.Background(), tracer)
putRequest, _ := hrpc.NewPutStr(ctx, "table", "key", values)
client.Put(putRequest)
import (
    "github.com/tsuna/gohbase/hrpc"
    "github.com/pinpoint-apm/pinpoint-go-agent"
    "github.com/pinpoint-apm/pinpoint-go-agent/plugin/gohbase"
)

func doHbase(w http.ResponseWriter, r *http.Request) {
    client := ppgohbase.NewClient("localhost")

    values := map[string]map[string][]byte{"cf": {"a": []byte{0}}}
    putRequest, err := hrpc.NewPutStr(r.Context(), "table", "key", values)
    _, err = client.Put(putRequest)
	
    ...
}

Full Example Source

Documentation

Overview

Package ppgohbase instruments the tsuna/gohbase package (https://github.com/tsuna/gohbase).

This package instruments the gohbase calls. Use the NewClient as the gohbase.NewClient.

client := ppgohbase.NewClient("localhost")

It is necessary to pass the context containing the pinpoint.Tracer to gohbase.Client.

ctx := pinpoint.NewContext(context.Background(), tracer)
putRequest, _ := hrpc.NewPutStr(ctx, "table", "key", values)
client.Put(putRequest)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	hbase.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(zkquorum string, options ...hbase.Option) *Client

NewClient wraps gohbase.NewClient and returns a gohbase.Client ready to instrument.

func (*Client) Append

func (c *Client) Append(a *hrpc.Mutate) (*hrpc.Result, error)

func (*Client) CheckAndPut

func (c *Client) CheckAndPut(p *hrpc.Mutate, family string, qualifier string, expectedValue []byte) (bool, error)

func (*Client) Delete

func (c *Client) Delete(d *hrpc.Mutate) (*hrpc.Result, error)

func (*Client) Get

func (c *Client) Get(g *hrpc.Get) (*hrpc.Result, error)

func (*Client) Increment

func (c *Client) Increment(i *hrpc.Mutate) (int64, error)

func (*Client) Put

func (c *Client) Put(p *hrpc.Mutate) (*hrpc.Result, error)

func (*Client) Scan

func (c *Client) Scan(s *hrpc.Scan) hrpc.Scanner

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL