Beispiel #1
0
// delNeedle delete the hbase.bfsmeta colume vid and cookie by the key.
func (h *HBaseClient) delNeedle(key int64) (err error) {
	var (
		ks []byte
		c  *hbasethrift.THBaseServiceClient
	)
	if c, err = hbasePool.Get(); err != nil {
		log.Errorf("hbasePool.Get() error(%v)", err)
		return
	}
	ks = h.key(key)
	if err = c.DeleteSingle(_table, &hbasethrift.TDelete{
		Row: ks,
		Columns: []*hbasethrift.TColumn{
			&hbasethrift.TColumn{
				Family:    _familyBasic,
				Qualifier: _columnVid,
			},
			&hbasethrift.TColumn{
				Family:    _familyBasic,
				Qualifier: _columnCookie,
			},
		},
	}); err != nil {
		hbasePool.Put(c, true)
		return
	}
	hbasePool.Put(c, false)
	return
}
Beispiel #2
0
// delFile delete file from hbase.bucket_xxx.
func (h *HBaseClient) delFile(bucket, filename string) (err error) {
	var (
		ks []byte
		c  *hbasethrift.THBaseServiceClient
	)
	if c, err = hbasePool.Get(); err != nil {
		log.Errorf("hbasePool.Get() error(%v)", err)
		return
	}
	ks = []byte(filename)
	if err = c.DeleteSingle(h.tableName(bucket), &hbasethrift.TDelete{
		Row: ks,
		Columns: []*hbasethrift.TColumn{
			&hbasethrift.TColumn{
				Family:    _familyFile,
				Qualifier: _columnKey,
			},
			&hbasethrift.TColumn{
				Family:    _familyFile,
				Qualifier: _columnSha1,
			},
			&hbasethrift.TColumn{
				Family:    _familyFile,
				Qualifier: _columnMine,
			},
			&hbasethrift.TColumn{
				Family:    _familyFile,
				Qualifier: _columnStatus,
			},
			&hbasethrift.TColumn{
				Family:    _familyFile,
				Qualifier: _columnUpdateTime,
			},
		},
	}); err != nil {
		hbasePool.Put(c, true)
		return
	}
	hbasePool.Put(c, false)
	return
}