Browse Source

fix wrong column family

ftp
Chris Lu 4 years ago
parent
commit
c4a202ec41
  1. 4
      weed/filer/hbase/hbase_store.go
  2. 4
      weed/filer/hbase/hbase_store_kv.go

4
weed/filer/hbase/hbase_store.go

@ -22,7 +22,6 @@ type HbaseStore struct {
table []byte
cfKv string
cfMetaDir string
cfFlatDir string
column string
}
@ -42,7 +41,6 @@ func (store *HbaseStore) initialize(zkquorum, table string) (err error) {
store.table = []byte(table)
store.cfKv = "kv"
store.cfMetaDir = "meta"
store.cfFlatDir = "flat"
store.column = "a"
// check table exists
@ -59,7 +57,7 @@ func (store *HbaseStore) initialize(zkquorum, table string) (err error) {
// create table
adminClient := gohbase.NewAdminClient(zkquorum)
cFamilies := []string{store.cfKv, store.cfMetaDir, store.cfFlatDir}
cFamilies := []string{store.cfKv, store.cfMetaDir}
cf := make(map[string]map[string]string, len(cFamilies))
for _, f := range cFamilies {
cf[f] = nil

4
weed/filer/hbase/hbase_store_kv.go

@ -22,7 +22,7 @@ func (store *HbaseStore) KvDelete(ctx context.Context, key []byte) (err error) {
}
func (store *HbaseStore) doPut(ctx context.Context, cf string, key, value []byte) (err error) {
values := map[string]map[string][]byte{store.cfKv: map[string][]byte{}}
values := map[string]map[string][]byte{cf: map[string][]byte{}}
values[cf][COLUMN_NAME] = value
putRequest, err := hrpc.NewPut(ctx, store.table, key, values)
if err != nil {
@ -53,7 +53,7 @@ func (store *HbaseStore) doGet(ctx context.Context, cf string, key []byte) (valu
}
func (store *HbaseStore) doDelete(ctx context.Context, cf string, key []byte) (err error) {
values := map[string]map[string][]byte{store.cfKv: map[string][]byte{}}
values := map[string]map[string][]byte{cf: map[string][]byte{}}
values[cf][COLUMN_NAME] = nil
deleteRequest, err := hrpc.NewDel(ctx, store.table, key, values)
if err != nil {

Loading…
Cancel
Save