hcat.py 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #!/usr/bin/env python
  2. """
  3. Licensed to the Apache Software Foundation (ASF) under one
  4. or more contributor license agreements. See the NOTICE file
  5. distributed with this work for additional information
  6. regarding copyright ownership. The ASF licenses this file
  7. to you under the Apache License, Version 2.0 (the
  8. "License"); you may not use this file except in compliance
  9. with the License. You may obtain a copy of the License at
  10. http://www.apache.org/licenses/LICENSE-2.0
  11. Unless required by applicable law or agreed to in writing, software
  12. distributed under the License is distributed on an "AS IS" BASIS,
  13. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. See the License for the specific language governing permissions and
  15. limitations under the License.
  16. """
  17. from resource_management import *
  18. import sys
  19. from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl
  20. from ambari_commons import OSConst
  21. @OsFamilyFuncImpl(os_family=OSConst.WINSRV_FAMILY)
  22. def hcat():
  23. import params
  24. XmlConfig("hive-site.xml",
  25. conf_dir = params.hive_conf_dir,
  26. configurations = params.config['configurations']['hive-site'],
  27. owner=params.hive_user,
  28. configuration_attributes=params.config['configuration_attributes']['hive-site']
  29. )
  30. @OsFamilyFuncImpl(os_family=OsFamilyImpl.DEFAULT)
  31. def hcat():
  32. import params
  33. from setup_atlas_hive import setup_atlas_hive
  34. Directory(params.hive_conf_dir,
  35. create_parents = True,
  36. owner=params.hcat_user,
  37. group=params.user_group,
  38. )
  39. Directory(params.hcat_conf_dir,
  40. create_parents = True,
  41. owner=params.hcat_user,
  42. group=params.user_group,
  43. )
  44. Directory(params.hcat_pid_dir,
  45. owner=params.webhcat_user,
  46. create_parents = True
  47. )
  48. XmlConfig("hive-site.xml",
  49. conf_dir=params.hive_client_conf_dir,
  50. configurations=params.config['configurations']['hive-site'],
  51. configuration_attributes=params.config['configuration_attributes']['hive-site'],
  52. owner=params.hive_user,
  53. group=params.user_group,
  54. mode=0644)
  55. File(format("{hcat_conf_dir}/hcat-env.sh"),
  56. owner=params.hcat_user,
  57. group=params.user_group,
  58. content=InlineTemplate(params.hcat_env_sh_template)
  59. )
  60. setup_atlas_hive()