public static ShellResult configure()

in bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hive/HiveSetup.java [40:117]


    public static ShellResult configure(Params params) {
        log.info("Configuring Hive");
        HiveParams hiveParams = (HiveParams) params;

        String confDir = hiveParams.confDir();
        String hiveUser = hiveParams.user();
        String hiveGroup = hiveParams.group();

        LinuxFileUtils.createDirectories(hiveParams.getHiveLogDir(), hiveUser, hiveGroup, PERMISSION_755, true);
        LinuxFileUtils.createDirectories(hiveParams.getHivePidDir(), hiveUser, hiveGroup, PERMISSION_755, true);

        LinuxFileUtils.toFileByTemplate(
                hiveParams.hiveLimits(),
                MessageFormat.format("{0}/hive.conf", HadoopParams.LIMITS_CONF_DIR),
                Constants.ROOT_USER,
                Constants.ROOT_USER,
                Constants.PERMISSION_644,
                hiveParams.getGlobalParamsMap());

        LinuxFileUtils.toFileByTemplate(
                hiveParams.getHiveEnvContent(),
                MessageFormat.format("{0}/hive-env.sh", confDir),
                hiveUser,
                hiveGroup,
                Constants.PERMISSION_644,
                hiveParams.getGlobalParamsMap());

        LinuxFileUtils.toFile(
                ConfigType.XML,
                MessageFormat.format("{0}/hive-site.xml", confDir),
                hiveUser,
                hiveGroup,
                Constants.PERMISSION_644,
                hiveParams.hiveSite());

        LinuxFileUtils.toFileByTemplate(
                hiveParams.getHiveLog4j2Content(),
                MessageFormat.format("{0}/hive-log4j2.properties", confDir),
                hiveUser,
                hiveGroup,
                Constants.PERMISSION_644,
                hiveParams.getGlobalParamsMap());

        LinuxFileUtils.toFileByTemplate(
                hiveParams.getBeelineLog4j2Content(),
                MessageFormat.format("{0}/beeline-log4j2.properties", confDir),
                hiveUser,
                hiveGroup,
                Constants.PERMISSION_644,
                hiveParams.getGlobalParamsMap());

        LinuxFileUtils.toFileByTemplate(
                hiveParams.getHiveExecLog4j2Content(),
                MessageFormat.format("{0}/hive-exec-log4j2.properties", confDir),
                hiveUser,
                hiveGroup,
                Constants.PERMISSION_644,
                hiveParams.getGlobalParamsMap());

        LinuxFileUtils.toFileByTemplate(
                hiveParams.getLlapCliLog4j2Content(),
                MessageFormat.format("{0}/llap-cli-log4j2.properties", confDir),
                hiveUser,
                hiveGroup,
                Constants.PERMISSION_644,
                hiveParams.getGlobalParamsMap());

        LinuxFileUtils.toFileByTemplate(
                hiveParams.getLlapDaemonLog4j2Content(),
                MessageFormat.format("{0}/llap-daemon-log4j2.properties", confDir),
                hiveUser,
                hiveGroup,
                Constants.PERMISSION_644,
                hiveParams.getGlobalParamsMap());

        log.info("Successfully configured Hive");
        return ShellResult.success();
    }