hbase_data_source.py 671 B

123456789101112131415161718192021222324252627282930
  1. # -*- coding:utf-8 -*-
  2. from dw_base.datax.datasources.data_source import DataSource
  3. # HBase Data Source
  4. DS_TYPE_HBASE = 'hbase'
  5. DS_HBASE_KEYS = [
  6. 'kerberos.enabled',
  7. 'kerberos.realm',
  8. 'kerberos.kdc',
  9. 'kerberos.krb5Conf',
  10. 'zookeeper.quorum',
  11. 'zookeeper.port'
  12. ]
  13. class HBaseDataSource(DataSource):
  14. def __init__(self, ds_file: str):
  15. super(HBaseDataSource, self).__init__(ds_file)
  16. self.source_type = DS_TYPE_HBASE
  17. self.keys = DS_HBASE_KEYS
  18. @staticmethod
  19. def generate_definition(conf: str) -> str:
  20. lines = [
  21. '[base]',
  22. 'conf = %s' % conf
  23. ]
  24. return '\n'.join(lines)