Sorry, some typos

        I used to think that ranger-admin-default-site.xml is the hard-coded 
default value of Ranger-admin-site.xml.
    until today, I found that setup.sh could even modify 
Ranger-admin-default-site.xml.

在 2022/2/19 23:37,“Zhou Tianling”<[email protected]> 写入:


    In java code, the 2 are always used together except we explicit pass an 
alternative of ranger-admin-site.xml by command-line
    args of EmbeddedServer::main.

    How to decide which of these two files a new option/parameter should be 
placed in?

    In RangerAdminConfig.java
        private boolean addAdminResources() {
            String defaultCfg = "ranger-admin-default-site.xml";
            String addlCfg    = "ranger-admin-site.xml";
            String coreCfg    = "core-site.xml";
            if (!addResourceIfReadable(defaultCfg)) {}
            if (!addResourceIfReadable(addlCfg)) {}
            if (!addResourceIfReadable(coreCfg)){}
        }

    In EmbeddedServerUtil.java
        private static final String CONFIG_FILE = "ranger-admin-site.xml";
        private static final String CORE_SITE_CONFIG_FILENAME = "core-site.xml";
        private static final String DEFAULT_CONFIG_FILENAME = 
"ranger-admin-default-site.xml";
        private EmbeddedServerUtil() {
                loadRangerConfigProperties(CONFIG_FILE);
        }
        public static void loadRangerConfigProperties(String configFile) {
                if (CONFIG_FILE.equalsIgnoreCase(configFile)) {
                        XMLUtils.loadConfig(DEFAULT_CONFIG_FILENAME, 
rangerConfigProperties);
                }
                XMLUtils.loadConfig(CORE_SITE_CONFIG_FILENAME, 
rangerConfigProperties);
                XMLUtils.loadConfig(configFile, rangerConfigProperties);
        }
        public static Properties getRangerConfigProperties() {
                if (rangerConfigProperties.isEmpty()) {
                        loadRangerConfigProperties(CONFIG_FILE);
                }
                return rangerConfigProperties;
        }


    In setup.sh:

                propertyName=ranger.sso.publicKey
                newPropertyValue="${sso_publickey}"
                updatePropertyToFilePy $propertyName $newPropertyValue 
$to_file_ranger


                propertyName=ranger.keystore.file
                newPropertyValue="${javax_net_ssl_keyStore}"
                updatePropertyToFilePy $propertyName $newPropertyValue 
$to_file_default











Reply via email to