Beispiel #1
0
    def ensure_correct_execution_environment(self):
        """Make sure the cluster environment we're executing on conforms to our
        expectations.

        For now just check that the cluster has a single JDK installed.

        :return: without error if only a single JDK is installed, otherwise exit
        """
        try:
            determine_jdk_directory(self)
        except Exception as e:
            sys.stderr.write(e.message)
            sys.stderr.flush()
            sys.exit(1)
    def ensure_correct_execution_environment(self):
        """Make sure the cluster environment we're executing on conforms to our
        expectations.

        For now just check that the cluster has a single JDK installed.

        :return: without error if only a single JDK is installed, otherwise exit
        """
        try:
            determine_jdk_directory(self)
        except Exception as e:
            sys.stderr.write(e.message)
            sys.stderr.flush()
            sys.exit(1)
def get_config(cluster, override=None):
    jdk_dir = os.path.join('/usr/java', determine_jdk_directory(cluster))
    conf = {
        DIR: '/opt/slider',
        ADMIN_USER: '******',
        HADOOP_CONF: '/etc/hadoop/conf',
        SSH_PORT: 22,
        SLIDER_USER: '******',
        HOST: 'master',
        JAVA_HOME: jdk_dir,
        APPNAME: 'presto'
    }

    if override:
        conf.update(override)
    return conf