hbase-store: support snapshot

This commit is contained in:
disksing
2015-11-02 19:16:25 +08:00
parent d48c0f5fe8
commit 0f24ee5d6d

View File

@ -73,8 +73,8 @@ func (s *hbaseStore) Begin() (kv.Transaction, error) {
}
func (s *hbaseStore) GetSnapshot(ver kv.Version) (kv.MvccSnapshot, error) {
//TODO: support snapshot
return nil, errors.New("not implemented")
t := themis.NewTxn(s.cli)
return newHbaseSnapshot(t, s.storeName), nil
}
func (s *hbaseStore) Close() error {
@ -91,6 +91,8 @@ func (s *hbaseStore) UUID() string {
func (s *hbaseStore) CurrentVersion() (kv.Version, error) {
t := themis.NewTxn(s.cli)
defer t.Release()
return kv.Version{Ver: t.GetStartTS()}, nil
}