private static AlluxioConfiguration loadClusterConfiguration ( GetConfigurationPResponse response , AlluxioConfiguration conf ) { String clientVersion = conf . get ( PropertyKey . VERSION ) ; LOG . info ( "Alluxio client (version {}) is trying to load cluster level configurations" , clientVersion ) ; List < alluxio . grpc . ConfigProperty > clusterConfig = response . getConfigsList ( ) ; Properties clusterProps = loadClientProperties ( clusterConfig , ( key , value ) -> String . format ( "Loading property: %s (%s) -> %s" , key , key . getScope ( ) , value ) ) ; // Check version. String clusterVersion = clusterProps . get ( PropertyKey . VERSION ) . toString ( ) ; if ( ! clientVersion . equals ( clusterVersion ) ) { LOG . warn ( "Alluxio client version ({}) does not match Alluxio cluster version ({})" , clientVersion , clusterVersion ) ; clusterProps . remove ( PropertyKey . VERSION ) ; } // Merge conf returned by master as the cluster default into conf object AlluxioProperties props = conf . copyProperties ( ) ; props . merge ( clusterProps , Source . CLUSTER_DEFAULT ) ; // Use the constructor to set cluster defaults as being loaded. InstancedConfiguration updatedConf = new InstancedConfiguration ( props , true ) ; updatedConf . validate ( ) ; LOG . info ( "Alluxio client has loaded cluster level configurations" ) ; return updatedConf ; }
Loads the cluster level configuration from the get configuration response and merges it with the existing configuration .