def __init__(self,<EOL>crate_dir: str,<EOL>env: Dict[str, Any] = None,<EOL>settings: Dict[str, Any] = None,<EOL>keep_data: bool = False,<EOL>java_magic: bool = False,<EOL>version: tuple = None) -> None:
super().__init__()<EOL>self.crate_dir = crate_dir<EOL>version = version or _extract_version(crate_dir)<EOL>self.env = env or {}<EOL>if java_magic:<EOL><INDENT>java_home = find_java_home(version)<EOL><DEDENT>else:<EOL><INDENT>java_home = os.environ.get('<STR_LIT>', '<STR_LIT>')<EOL><DEDENT>self.env.setdefault('<STR_LIT>', java_home)<EOL>self.env.setdefault('<STR_LIT>',<EOL>os.environ.get('<STR_LIT>', os.environ.get('<STR_LIT>')))<EOL>if not self.env['<STR_LIT>']:<EOL><INDENT>raise SystemError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>self.monitor = OutputMonitor()<EOL>self.process = None  <EOL>self.http_url = None  <EOL>self.http_host = None  <EOL>start_script = '<STR_LIT>' if sys.platform == '<STR_LIT:win32>' else '<STR_LIT>'<EOL>settings = _get_settings(settings)<EOL>if version < (<NUM_LIT:1>, <NUM_LIT:1>, <NUM_LIT:0>):<EOL><INDENT>settings.setdefault('<STR_LIT>', False)<EOL><DEDENT>self.data_path = settings.get('<STR_LIT>') or tempfile.mkdtemp()<EOL>self.logs_path = settings.get('<STR_LIT>') or os.path.join(crate_dir, '<STR_LIT>')<EOL>self.cluster_name = settings.get('<STR_LIT>') or '<STR_LIT>'<EOL>self.keep_data = keep_data<EOL>settings['<STR_LIT>'] = self.data_path<EOL>settings['<STR_LIT>'] = self.cluster_name<EOL>if version < (<NUM_LIT:1>, <NUM_LIT:0>, <NUM_LIT:0>):<EOL><INDENT>_format_option = _format_cmd_option_legacy<EOL><DEDENT>else:<EOL><INDENT>_format_option = _format_cmd_option<EOL><DEDENT>args = [_format_option(k, v) for k, v in settings.items()]<EOL>self.cmd = [<EOL>os.path.join(crate_dir, '<STR_LIT>', start_script)] + args<EOL>
Create a CrateNode

        Args:
            crate_dir: Path to the extracted Crate tarball
            env: Environment variables with which the Crate process will be
                started.
            settings: Additional Crate settings.
            java_magic: If set to true, it will attempt to set JAVA_HOME to
                some path that contains a Java version suited to run the given
                CrateDB instance.
            version:
                The CrateDB version as tuple in the format (major, minor, hotfix).
                This is usually inferred from the given `crate_dir`, but can be
                passed explicitly to overrule the detection mechanism.
                This argument is used to provide the right defaults and use the
                right commandline argument syntax to launch CrateDB.