本文整理汇总了Java中org.apache.solr.client.solrj.embedded.JettyConfig类的典型用法代码示例。如果您正苦于以下问题:Java JettyConfig类的具体用法?Java JettyConfig怎么用?Java JettyConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JettyConfig类属于org.apache.solr.client.solrj.embedded包,在下文中一共展示了JettyConfig类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: startJetty
import org.apache.solr.client.solrj.embedded.JettyConfig; //导入依赖的package包/类
void startJetty() throws Exception {
Properties props = new Properties();
props.setProperty("solrconfig", "solrconfig.xml");
props.setProperty("solr.data.dir", getDataDir());
JettyConfig jettyConfig = JettyConfig.builder(buildJettyConfig("/solr")).setPort(port).build();
jetty = new JettySolrRunner( getHomeDir(), props, jettyConfig );
jetty.start();
int newPort = jetty.getLocalPort();
if (port != 0 && newPort != port) {
throw new Exception( "TESTING FAILURE: could not grab requested port." );
}
this.port = newPort;
}
开发者ID:detnavillus,项目名称:multifield_suggester_code,代码行数:17,代码来源:MockSolrServer.java
示例2: startCluster
import org.apache.solr.client.solrj.embedded.JettyConfig; //导入依赖的package包/类
@BeforeClass
public static void startCluster() throws Exception {
TEMP_DIR = Files.createTempDirectory("MiniSolrCloudCluster");
JettyConfig.Builder jettyConfig = JettyConfig.builder();
jettyConfig.waitForLoadingCoresToFinish(null);
cluster = new MiniSolrCloudCluster(1, TEMP_DIR, jettyConfig.build());
cloudSolrClient = cluster.getSolrClient();
cloudSolrClient.connect();
assertTrue(!cloudSolrClient.getZkStateReader().getClusterState().getLiveNodes().isEmpty());
uploadDefaultConfigSet();
createDefaultCollection();
verifyCluster();
log.info("Start Solr Cluster");
}
开发者ID:lucidworks,项目名称:solr-hadoop-common,代码行数:18,代码来源:SolrCloudClusterSupport.java
示例3: start
import org.apache.solr.client.solrj.embedded.JettyConfig; //导入依赖的package包/类
@Override
public void start() throws UnableToStartException {
try {
File baseDir = Files.createTempDirectory("solrcomponent").toFile();
baseDir.deleteOnExit();
miniSolrCloudCluster = new MiniSolrCloudCluster(1, baseDir, new File(solrXmlPath), JettyConfig.builder().setPort(port).build());
for(String name: collections.keySet()) {
String configPath = collections.get(name);
miniSolrCloudCluster.uploadConfigDir(new File(configPath), name);
}
miniSolrCloudCluster.createCollection("metron", 1, 1, "metron", new HashMap<String, String>());
if (postStartCallback != null) postStartCallback.apply(this);
} catch(Exception e) {
throw new UnableToStartException(e.getMessage(), e);
}
}
开发者ID:apache,项目名称:metron,代码行数:17,代码来源:SolrComponent.java
示例4: init
import org.apache.solr.client.solrj.embedded.JettyConfig; //导入依赖的package包/类
@BeforeClass
public static void init() {
System.setProperty("solr.data.dir", initCoreDataDir.getAbsolutePath());
try {
SOLR = createJetty("src/solr",
JettyConfig.builder()
.setPort(8983)
.setContext("/solr")
.stopAtShutdown(true)
.build());
} catch (final Exception exception) {
throw new RuntimeException(exception);
}
}
开发者ID:agazzarini,项目名称:as-full-text-search-server,代码行数:16,代码来源:BaseIntegrationTest.java
示例5: startJettySolrRunner
import org.apache.solr.client.solrj.embedded.JettyConfig; //导入依赖的package包/类
/**
* Start a new Solr instance on a particular servlet context
*
* @param name the instance name
* @param hostContext the context to run on
* @param config a JettyConfig for the instance's {@link org.apache.solr.client.solrj.embedded.JettySolrRunner}
*
* @return a JettySolrRunner
*/
public JettySolrRunner startJettySolrRunner(String name, String hostContext, JettyConfig config) throws Exception {
Path runnerPath = createInstancePath(name);
String context = getHostContextSuitableForServletContext(hostContext);
JettyConfig newConfig = JettyConfig.builder(config).setContext(context).build();
JettySolrRunner jetty = new JettySolrRunner(runnerPath.toString(), newConfig);
jetty.start();
jettys.add(jetty);
return jetty;
}
开发者ID:BorisNaguet,项目名称:solr-maven-plugin,代码行数:19,代码来源:MiniSolrCloudCluster.java
示例6: beforeSolrJettyTestBase
import org.apache.solr.client.solrj.embedded.JettyConfig; //导入依赖的package包/类
@BeforeClass
public static void beforeSolrJettyTestBase() throws Exception {
final File origSolrHome = new File(SolrJettyTestBase.class.getResource("/solr").toURI());
final File tempSolrHome = tempSolrFolder.getRoot();
final File tempSolrData = tempSolrFolder.newFolder("data");
FileUtils.copyDirectory(origSolrHome, tempSolrHome);
final JettyConfig jettyConfig = JettyConfig.builder()
.setContext("/solr")
.setPort(8888)
.stopAtShutdown(true)
.build();
final Properties nodeProperties = new Properties();
nodeProperties.setProperty("solr.data.dir", tempSolrData.getCanonicalPath());
nodeProperties.setProperty("coreRootDirectory", tempSolrHome.toString());
nodeProperties.setProperty("configSetBaseDir", tempSolrHome.toString());
System.setProperty("jetty.testMode", "true");
jetty = new JettySolrRunner(tempSolrHome.toString(), nodeProperties, jettyConfig);
jetty.start();
client = createNewSolrClient();
}
开发者ID:ICIJ,项目名称:extract,代码行数:28,代码来源:SolrJettyTestBase.java
示例7: startJetty
import org.apache.solr.client.solrj.embedded.JettyConfig; //导入依赖的package包/类
public void startJetty(int delay) throws Exception {
Properties props = new Properties();
props.setProperty("solrconfig", "bad_solrconfig.xml");
props.setProperty("solr.data.dir", getDataDir());
JettyConfig.Builder jettyConfigBuilder = JettyConfig.builder().setContext("/solr").setPort(port);
jetty = new SlowJettySolrRunner(getHomeDir(), props, jettyConfigBuilder, delay);
jetty.start();
int newPort = jetty.getLocalPort();
if (port != 0 && newPort != port) {
fail("TESTING FAILURE: could not grab requested port.");
}
this.port = newPort;
}
开发者ID:whitepages,项目名称:SOLR-4449,代码行数:16,代码来源:TestBackupLBHttpSolrClient.java
示例8: finalizeBuilder
import org.apache.solr.client.solrj.embedded.JettyConfig; //导入依赖的package包/类
private static JettyConfig finalizeBuilder(JettyConfig.Builder config, int initDelay) {
if (initDelay >= 0) {
setDelay(initDelay);
config.withFilter(SlowFilter.class, "*");
}
return config.build();
}
开发者ID:whitepages,项目名称:SOLR-4449,代码行数:8,代码来源:SlowJettySolrRunner.java
示例9: initITTest
import org.apache.solr.client.solrj.embedded.JettyConfig; //导入依赖的package包/类
/**
* Initilisation procedure for this test case.
*
* @throws UnableToBuildSolRDFClientException in case the client cannot be built.
* @throws Exception in case of Solr startup failure.
*/
@BeforeClass
public static void initITTest() {
System.setProperty("tests.asserts", "false");
System.setProperty("jetty.port", "8080");
System.setProperty("solr.core.name", "store");
System.setProperty("solr.data.dir", initCoreDataDir.getAbsolutePath());
try {
SOLR = createJetty(
"target/solrdf-integration-tests-1.1-dev/solrdf",
JettyConfig.builder()
.setPort(8080)
.setContext("/solr")
.stopAtShutdown(true)
.build());
final HttpClient httpClient = HttpClientBuilder.create()
.setRoutePlanner(
new DefaultRoutePlanner(
new SchemePortResolver() {
@Override
public int resolve(final HttpHost host) throws UnsupportedSchemeException {
return SOLR.getLocalPort();
}
})).build();
SOLRDF_CLIENT = SolRDF.newBuilder()
.withEndpoint("http://127.0.0.1:8080/solr/store")
.withGraphStoreProtocolEndpointPath("/rdf-graph-store")
.withHttpClient(httpClient)
.withSPARQLEndpointPath("/sparql")
.build();
PLAIN_SOLR_CLIENT = new HttpSolrClient(SOLR_URI);
} catch (final Exception exception) {
throw new RuntimeException(exception);
}
}
开发者ID:spaziocodice,项目名称:SolRDF,代码行数:46,代码来源:IntegrationTestSupertypeLayer.java
示例10: buildJettyConfig
import org.apache.solr.client.solrj.embedded.JettyConfig; //导入依赖的package包/类
JettyConfig buildJettyConfig( String context ) {
return JettyConfig.builder().setContext( context ).withSSLConfig( null ).build();
}
开发者ID:detnavillus,项目名称:multifield_suggester_code,代码行数:4,代码来源:MockSolrServer.java
示例11: SlowJettySolrRunner
import org.apache.solr.client.solrj.embedded.JettyConfig; //导入依赖的package包/类
public SlowJettySolrRunner(String solrHome, Properties nodeProperties, JettyConfig.Builder config, int initDelay) {
super(solrHome, nodeProperties, finalizeBuilder(config, initDelay));
}
开发者ID:whitepages,项目名称:SOLR-4449,代码行数:4,代码来源:SlowJettySolrRunner.java
示例12: MiniSolrCloudCluster
import org.apache.solr.client.solrj.embedded.JettyConfig; //导入依赖的package包/类
/**
* Create a MiniSolrCloudCluster
*
* @param numServers number of Solr servers to start
* @param hostContext context path of Solr servers used by Jetty
* @param baseDir base directory that the mini cluster should be run from
* @param solrXml solr.xml file to be uploaded to ZooKeeper
* @param extraServlets Extra servlets to be started by Jetty
* @param extraRequestFilters extra filters to be started by Jetty
* @param sslConfig SSL configuration
*
* @throws Exception if there was an error starting the cluster
*/
public MiniSolrCloudCluster(int numServers, String hostContext, Path baseDir, String solrXml,
SortedMap<ServletHolder, String> extraServlets,
SortedMap<Class<? extends Filter>, String> extraRequestFilters,
SSLConfig sslConfig, String chroot) throws Exception {
this(numServers, baseDir, solrXml, JettyConfig.builder()
.setContext(hostContext)
.withSSLConfig(sslConfig)
.withFilters(extraRequestFilters)
.withServlets(extraServlets)
.build(),
chroot);
}
开发者ID:BorisNaguet,项目名称:solr-maven-plugin,代码行数:26,代码来源:MiniSolrCloudCluster.java
注:本文中的org.apache.solr.client.solrj.embedded.JettyConfig类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论