hive

package module
v0.0.0-...-dd7bf60 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2014 License: Apache-2.0 Imports: 4 Imported by: 2

README

hive

thrift hive generated code

Documentation

Overview

Hive: The go thrift library for connecting to hive server.

This is just the generated Thrift-Hive and a very small connection wrapper.

Usage:

func main() {

  hive.MakePool("192.168.1.17:10000")

  conn, err := GetHiveConn()
  if err == nil {
    er, err := conn.Client.Execute("SELECT * FROM logevent")
    if er == nil && err == nil {
      for {
        row, _, _ := conn.Client.FetchOne()
        log.Println("row ", row)
      }
    }
  }
  if conn != nil {
    // make sure to check connection back into pool
    conn.Checkin()
  }
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakePool

func MakePool(server string)

create connection pool, initialize connections

Types

type HiveConnection

type HiveConnection struct {
	Server string
	Id     int
	Client *thrifthive.ThriftHiveClient
}

func GetHiveConn

func GetHiveConn() (conn *HiveConnection, err error)

main entry point for checking out a connection from a list

func (*HiveConnection) Checkin

func (conn *HiveConnection) Checkin()

func (*HiveConnection) Open

func (conn *HiveConnection) Open() error

opens a hive connection

Notes

Bugs

  • an error occured on batch mutate <nil> <nil> <nil> Cannot read. Remote side has closed. Tried to read 4 bytes, but only got 0 bytes.

Jump to

Keyboard shortcuts

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