Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use NewAdminClient to create a table error #10

Closed
zaDDaz opened this issue May 6, 2016 · 3 comments
Closed

use NewAdminClient to create a table error #10

zaDDaz opened this issue May 6, 2016 · 3 comments

Comments

@zaDDaz
Copy link

zaDDaz commented May 6, 2016

code:


 package main

import (
    "log"

    "github.com/tsuna/gohbase"
    "github.com/tsuna/gohbase/hrpc"
    "golang.org/x/net/context"
)

func main() {
    admin := gohbase.NewAdminClient("master")
    columns := []string{"phone"}
    table := "table"
    createReq := hrpc.NewCreateTable(context.Background(), []byte(table), columns)
    result, err := admin.CreateTable(createReq)
    if err != nil {
        log.Println("err:", err)
    }
    log.Println("result:", result)
}

i use the above code to create a table in HBase,bu it give me a java exception:


ym@master:~/gopath/src/test$ go run hbase_createtable.go 
2016/05/06 11:15:50 Connected to 192.168.0.116:2181
2016/05/06 11:15:50 Authenticated: id=95836126668718128, timeout=30000
2016/05/06 11:15:50 Recv loop terminated: err=EOF
2016/05/06 11:15:50 Send loop terminated: err=
2016/05/06 11:15:50 err: HBase Java exception java.io.IOException: 
java.io.IOException: null
        at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2159)
        at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:104)
        at org.apache.hadoop.hbase.ipc.RpcExecutor.consumerLoop(RpcExecutor.java:133)
        at org.apache.hadoop.hbase.ipc.RpcExecutor$1.run(RpcExecutor.java:108)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NumberFormatException: null
        at java.lang.Integer.parseInt(Integer.java:542)
        at java.lang.Integer.parseInt(Integer.java:615)
        at org.apache.hadoop.hbase.HColumnDescriptor.getMaxVersions(HColumnDescriptor.java:617)
        at org.apache.hadoop.hbase.master.HMaster.sanityCheckTableDescriptor(HMaster.java:1582)
        at org.apache.hadoop.hbase.master.HMaster.createTable(HMaster.java:1452)
        at org.apache.hadoop.hbase.master.MasterRpcServices.createTable(MasterRpcServices.java:429)
        at org.apache.hadoop.hbase.protobuf.generated.MasterProtos$MasterService$2.callBlockingMethod(MasterProtos.java:52195)
        at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2117)
        ... 4 more

2016/05/06 11:15:50 result: 

is it a bug of gohbase or my usage error?please help me to fix this problem.
i am sure the HBase server is work normal,because i can create a table in shell commad.

@timoha
Copy link
Collaborator

timoha commented May 17, 2016

Could you please specify which version of HBase you are running?

@zaDDaz
Copy link
Author

zaDDaz commented May 23, 2016

The HBase version is 1.1.4,HDFS version is 2.6.4.If you need more information,message me please.

@timoha
Copy link
Collaborator

timoha commented May 31, 2016

It seems to me that you are on an older gohbase commit, try pulling from master, and let me know if that fixes it.

@timoha timoha closed this as completed Feb 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants