public File downloadConfigDir ( SolrZkClient zkClient , String configName , File dir ) throws IOException , InterruptedException , KeeperException { Preconditions . checkArgument ( dir . exists ( ) ) ; Preconditions . checkArgument ( dir . isDirectory ( ) ) ; ZkConfigManager manager = new ZkConfigManager ( zkClient ) ; manager . downloadConfigDir ( configName , dir . toPath ( ) ) ; File confDir = new File ( dir , "conf" ) ; if ( ! confDir . isDirectory ( ) ) { // create a temporary directory with "conf" subdir and mv the config in there. This is // necessary because of CDH-11188; solrctl does not generate nor accept directories with e.g. // conf/solrconfig.xml which is necessary for proper solr operation. This should work // even if solrctl changes. confDir = new File ( Files . createTempDir ( ) . getAbsolutePath ( ) , "conf" ) ; confDir . getParentFile ( ) . deleteOnExit ( ) ; Files . move ( dir , confDir ) ; dir = confDir . getParentFile ( ) ; } verifyConfigDir ( confDir ) ; return dir ; }
Download and return the config directory from ZK