Skip to content

Latest commit

 

History

History
121 lines (76 loc) · 1.79 KB

common.md

File metadata and controls

121 lines (76 loc) · 1.79 KB

common/utils.sh

Provides common utility functions

populate_nodeinfo()

Function to populate nodeinfo

Please call this method at start of node bootstrap

Example

populate_nodeinfo

Function has no arguments.

is_hadoop2_cluster()

Function to check if the node belongs to a Hadoop2 cluster

Example

if is_hadoop2_cluster; then
    # do something here
fi

Function has no arguments.

Exit codes

  • 0: If the cluster runs hadoop2
  • 1: Otherwise

is_hs2_enabled()

Function to check if a HiveServer2 is configured to run on a master node

Example

if is_hs2_enabled; then
    # do something here
fi

Function has no arguments.

Exit codes

  • 0: When HiveServer2 is configured on a master node
  • 1: Otherwise

is_hs2_cluster()

Function to check if a node belongs to a HiveServer2 cluster

Example

if is_hs2_cluster; then
    # do something here
fi

Function has no arguments.

Exit codes

  • 0: When node belongs to a HiveServer2 cluster
  • 1: Otherwise

is_master_node()

Function to check if a node is a cluster master node

Example

if is_master_node; then
    # do something here
fi

Function has no arguments.

Exit codes

  • 0: When node is a cluster master node
  • 1: Otherwise

is_worker_node()

Function to check if a node is a cluster worker node

Example

if is_worker_node; then
    # do something here
fi

Function has no arguments.

Exit codes

  • 0: When node is a cluster worker node
  • 1: Otherwise