in ccmlib/node.py [0:0]
def __init__(self,
name,
cluster,
auto_bootstrap,
thrift_interface,
storage_interface,
jmx_port,
remote_debug_port,
initial_token,
save=True,
binary_interface=None,
byteman_port='0',
environment_variables=None,
byteman_startup_script=None,
derived_cassandra_version=None):
"""
Create a new Node.
- name: the name for that node
- cluster: the cluster this node is part of
- auto_bootstrap: whether or not this node should be set for auto-bootstrap
- thrift_interface: the (host, port) tuple for thrift
- storage_interface: the (host, port) tuple for internal cluster communication
- jmx_port: the port for JMX to bind to
- remote_debug_port: the port for remote debugging
- initial_token: the token for this node. If None, use Cassandra token auto-assignment
- save: copy all data useful for this node to the right position. Leaving this true
is almost always the right choice.
"""
self.name = name
self.cluster = cluster
self.status = Status.UNINITIALIZED
self.auto_bootstrap = auto_bootstrap
self.network_interfaces = {'thrift': common.normalize_interface(thrift_interface),
'storage': common.normalize_interface(storage_interface),
'binary': common.normalize_interface(binary_interface)}
(self.ip_addr, _) = self.network_interfaces['thrift'] if thrift_interface else self.network_interfaces['binary']
self.jmx_port = jmx_port
self.remote_debug_port = remote_debug_port
self.byteman_port = byteman_port
self.byteman_startup_script = byteman_startup_script
self.initial_token = initial_token
self.pid = None
self.data_center = None
self.workloads = []
self._dse_config_options = {}
self.__config_options = {}
self._topology = [('default', 'dc1')]
self.__install_dir = None
self.__global_log_level = None
self.__classes_log_level = {}
self.__environment_variables = environment_variables or {}
self.__environment_variables = self.__environment_variables.copy()
self.__original_java_home = None
self.__original_path = None
self.__conf_updated = False
if derived_cassandra_version:
self._cassandra_version = derived_cassandra_version
else:
try:
self._cassandra_version = self.get_version_from_build(self.get_install_dir(), cassandra=True)
# call get_base_cassandra_version() to validate _cassandra_version
self.get_base_cassandra_version()
except (common.CCMError, ValueError):
self._cassandra_version = self.cluster.cassandra_version()
if save:
self.import_config_files()
self.import_bin_files()
if common.is_win():
self.__clean_bat()