package module

import (
	"errors"

	"gitlab.alibaba-inc.com/pai_biz_arch/pairec/recconf"
)

var (
	VectoryEmptyError = errors.New("vector empty")
)

type VectorDao interface {
	VectorString(id string) (string, error)
}

func NewVectorDao(config recconf.RecallConfig) VectorDao {
	if config.DaoConf.AdapterType == recconf.DaoConf_Adapter_Redis {
		return NewVectorRedisDao(config)
	} else if config.DaoConf.AdapterType == recconf.DaoConf_Adapter_HBase {
		return NewVectorHBaseDao(config)
	} else if config.VectorDaoConf.AdapterType == recconf.DaoConf_Adapter_Hologres {
		return NewVectorHologresDao(config)
	} else if config.VectorDaoConf.AdapterType == recconf.DaoConf_Adapter_Mysql {
		return NewVectorMysqlDao(config)
	}

	panic("not found VectorDao implement")
}
