public static ShellResult configure()

in bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hbase/HBaseSetup.java [40:102]


    public static ShellResult configure(Params params) {
        log.info("Configuring HBase");
        HBaseParams hbaseParams = (HBaseParams) params;

        String confDir = hbaseParams.confDir();
        String hbaseUser = hbaseParams.user();
        String hbaseGroup = hbaseParams.group();

        LinuxFileUtils.createDirectories(hbaseParams.getHbaseLogDir(), hbaseUser, hbaseGroup, PERMISSION_755, true);
        LinuxFileUtils.createDirectories(hbaseParams.getHbasePidDir(), hbaseUser, hbaseGroup, PERMISSION_755, true);
        LinuxFileUtils.createDirectories(hbaseParams.getHbaseRootDir(), hbaseUser, hbaseGroup, PERMISSION_755, true);

        LinuxFileUtils.toFileByTemplate(
                hbaseParams.hbaseLimits(),
                MessageFormat.format("{0}/hbase.conf", HadoopParams.LIMITS_CONF_DIR),
                Constants.ROOT_USER,
                Constants.ROOT_USER,
                Constants.PERMISSION_644,
                hbaseParams.getGlobalParamsMap());

        LinuxFileUtils.toFileByTemplate(
                hbaseParams.getHbaseEnvContent(),
                MessageFormat.format("{0}/hbase-env.sh", confDir),
                hbaseUser,
                hbaseGroup,
                Constants.PERMISSION_644,
                hbaseParams.getGlobalParamsMap());

        LinuxFileUtils.toFile(
                ConfigType.XML,
                MessageFormat.format("{0}/hbase-site.xml", confDir),
                hbaseUser,
                hbaseGroup,
                Constants.PERMISSION_644,
                hbaseParams.hbaseSite());

        LinuxFileUtils.toFile(
                ConfigType.XML,
                MessageFormat.format("{0}/hbase-policy.xml", confDir),
                hbaseUser,
                hbaseGroup,
                Constants.PERMISSION_644,
                hbaseParams.hbasePolicy());

        LinuxFileUtils.toFileByTemplate(
                hbaseParams.getHbaseLog4jContent(),
                MessageFormat.format("{0}/log4j.properties", confDir),
                hbaseUser,
                hbaseGroup,
                Constants.PERMISSION_644,
                hbaseParams.getGlobalParamsMap());

        LinuxFileUtils.toFileByTemplate(
                hbaseParams.regionservers(),
                MessageFormat.format("{0}/regionservers", confDir),
                hbaseUser,
                hbaseGroup,
                Constants.PERMISSION_644,
                hbaseParams.getGlobalParamsMap());

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