@Test @Ignore public void testCreateCore() throws Exception { StratioStreamingMessage message= new StratioStreamingMessage( StreamsHelper.STREAM_NAME, Long.parseLong("1234567890"), StreamsHelper.COLUMNS); service.createCore(message); }
public void createCore(StratioStreamingMessage message) throws IOException, URISyntaxException, SolrServerException, ParserConfigurationException, SAXException, TransformerException, InterruptedException { String core = message.getStreamName(); String dataPath = this.dataDir + '/' + core + "/data"; String confPath = this.dataDir + '/' + core + "/conf"; createDirs(dataPath, confPath); createSolrConfig(confPath); createSolrSchema(message.getColumns(), confPath); SolrClient solrClient = getSolrclient(core); CoreAdminRequest.Create createCore = new CoreAdminRequest.Create(); createCore.setDataDir(dataPath); createCore.setInstanceDir(dataDir + '/' + core); createCore.setCoreName(core); createCore.setSchemaName("schema.xml"); createCore.setConfigName("solrconfig.xml"); if (solrClient instanceof CloudSolrClient) { ((CloudSolrClient)solrClient).uploadConfig(Paths.get(confPath), core); } solrClient.request(createCore); }
SolrOperationsService { public void createCore(StratioStreamingMessage message) throws IOException, URISyntaxException, SolrServerException, ParserConfigurationException, SAXException, TransformerException, InterruptedException { String core = message.getStreamName(); String dataPath = this.dataDir + '/' + core + "/data"; String confPath = this.dataDir + '/' + core + "/conf"; createDirs(dataPath, confPath); createSolrConfig(confPath); createSolrSchema(message.getColumns(), confPath); SolrClient solrClient = getSolrclient(core); CoreAdminRequest.Create createCore = new CoreAdminRequest.Create(); createCore.setDataDir(dataPath); createCore.setInstanceDir(dataDir + '/' + core); createCore.setCoreName(core); createCore.setSchemaName("schema.xml"); createCore.setConfigName("solrconfig.xml"); if (solrClient instanceof CloudSolrClient) { ((CloudSolrClient)solrClient).uploadConfig(Paths.get(confPath), core); } solrClient.request(createCore); } }
SolrOperationsService { public void createCore(StratioStreamingMessage message) throws IOException, URISyntaxException, SolrServerException, ParserConfigurationException, SAXException, TransformerException, InterruptedException { String core = message.getStreamName(); String dataPath = this.dataDir + '/' + core + "/data"; String confPath = this.dataDir + '/' + core + "/conf"; createDirs(dataPath, confPath); createSolrConfig(confPath); createSolrSchema(message.getColumns(), confPath); SolrClient solrClient = getSolrclient(core); CoreAdminRequest.Create createCore = new CoreAdminRequest.Create(); createCore.setDataDir(dataPath); createCore.setInstanceDir(dataDir + '/' + core); createCore.setCoreName(core); createCore.setSchemaName("schema.xml"); createCore.setConfigName("solrconfig.xml"); if (solrClient instanceof CloudSolrClient) { ((CloudSolrClient)solrClient).uploadConfig(Paths.get(confPath), core); } solrClient.request(createCore); } SolrOperationsService(String solrHosts, String zkHosts, String dataDir, Boolean isCloud); }
SolrOperationsService { public void createCore(StratioStreamingMessage message) throws IOException, URISyntaxException, SolrServerException, ParserConfigurationException, SAXException, TransformerException, InterruptedException { String core = message.getStreamName(); String dataPath = this.dataDir + '/' + core + "/data"; String confPath = this.dataDir + '/' + core + "/conf"; createDirs(dataPath, confPath); createSolrConfig(confPath); createSolrSchema(message.getColumns(), confPath); SolrClient solrClient = getSolrclient(core); CoreAdminRequest.Create createCore = new CoreAdminRequest.Create(); createCore.setDataDir(dataPath); createCore.setInstanceDir(dataDir + '/' + core); createCore.setCoreName(core); createCore.setSchemaName("schema.xml"); createCore.setConfigName("solrconfig.xml"); if (solrClient instanceof CloudSolrClient) { ((CloudSolrClient)solrClient).uploadConfig(Paths.get(confPath), core); } solrClient.request(createCore); } SolrOperationsService(String solrHosts, String zkHosts, String dataDir, Boolean isCloud); void createCore(StratioStreamingMessage message); void createDirs(String dataPath, String confPath); void createSolrConfig(String confPath); void createSolrSchema(List<ColumnNameTypeValue> columns, String confpath); List<String> getCoreList(); }
SolrOperationsService { public void createCore(StratioStreamingMessage message) throws IOException, URISyntaxException, SolrServerException, ParserConfigurationException, SAXException, TransformerException, InterruptedException { String core = message.getStreamName(); String dataPath = this.dataDir + '/' + core + "/data"; String confPath = this.dataDir + '/' + core + "/conf"; createDirs(dataPath, confPath); createSolrConfig(confPath); createSolrSchema(message.getColumns(), confPath); SolrClient solrClient = getSolrclient(core); CoreAdminRequest.Create createCore = new CoreAdminRequest.Create(); createCore.setDataDir(dataPath); createCore.setInstanceDir(dataDir + '/' + core); createCore.setCoreName(core); createCore.setSchemaName("schema.xml"); createCore.setConfigName("solrconfig.xml"); if (solrClient instanceof CloudSolrClient) { ((CloudSolrClient)solrClient).uploadConfig(Paths.get(confPath), core); } solrClient.request(createCore); } SolrOperationsService(String solrHosts, String zkHosts, String dataDir, Boolean isCloud); void createCore(StratioStreamingMessage message); void createDirs(String dataPath, String confPath); void createSolrConfig(String confPath); void createSolrSchema(List<ColumnNameTypeValue> columns, String confpath); List<String> getCoreList();  }