We want to put all files into a file system(HDFS). It is easy to maintain if both config and index files are in the same place. You are right, we can put a dummy one to by pass that. But I have another idea. We subclass the Directory class to handle all the files access. If QueryElevationComponent use Directory class to check file existence, it should not have this problem. I am wondering if this is a bug.
Any thought will be appreciated. On Mon, Oct 29, 2012 at 1:26 AM, Amit Nithian <anith...@gmail.com> wrote: > Is the goal to have the elevation data read from somewhere else? In > other words, why don't you want the elevate.xml to exist locally? > > If you want to read the data from somewhere else, could you put a > dummy elevate.xml locally and subclass the QueryElevationComponent and > override the loadElevationMap() to read this data from your own custom > location? > > On Fri, Oct 26, 2012 at 6:47 PM, James Ji <jiayu...@gmail.com> wrote: > > Hi there > > > > We are currently working on having Solr files read from HDFS. We extended > > some of the classes so as to avoid modifying the original Solr code and > > make it compatible with the future release. So here comes the question, I > > found in QueryElevationComponent, there is a piece of code checking > whether > > elevate.xml exists at local file system. I am wondering if there is a way > > to by pass this? > > QueryElevationComponent.inform(){ > > .... > > File fC = new File(core.getResourceLoader().getConfigDir(), f); > > File fD = new File(core.getDataDir(), f); > > if (fC.exists() == fD.exists()) { throw new > > SolrException(SolrException.ErrorCode.SERVER_ERROR, > > "QueryElevationComponent missing config file: '" + f + "\n" + "either: " > + > > fC.getAbsolutePath() + " or " + fD.getAbsolutePath() + " must exist, but > > not both."); } > > if (fC.exists()) { exists = true; log.info("Loading QueryElevation from: > > "+fC.getAbsolutePath()); Config cfg = new > Config(core.getResourceLoader(), > > f); elevationCache.put(null, loadElevationMap(cfg)); } > > .... > > } > > > > -- > > Jiayu (James) Ji, > > > > *************************************** > > > > Cell: (312)823-7393 > > Website: https://sites.google.com/site/jiayuji/ > > > > *************************************** >