Search in sources :

Example 1 with ZooKeeperStorageIO

use of org.apache.solr.rest.ManagedResourceStorage.ZooKeeperStorageIO in project lucene-solr by apache.

the class TestManagedResourceStorage method testZkBasedJsonStorage.

/**
   * Runs persisted managed resource creation and update tests on Zookeeper storage.
   */
@Test
public void testZkBasedJsonStorage() throws Exception {
    // test using ZooKeeper
    assertTrue("Not using ZooKeeper", h.getCoreContainer().isZooKeeperAware());
    SolrZkClient zkClient = h.getCoreContainer().getZkController().getZkClient();
    SolrResourceLoader loader = new SolrResourceLoader(Paths.get("./"));
    // Solr unit tests can only write to their working directory due to
    // a custom Java Security Manager installed in the test environment
    NamedList<String> initArgs = new NamedList<>();
    try {
        ZooKeeperStorageIO zkStorageIO = new ZooKeeperStorageIO(zkClient, "/test");
        zkStorageIO.configure(loader, initArgs);
        doStorageTests(loader, zkStorageIO);
    } finally {
        loader.close();
    }
}
Also used : SolrResourceLoader(org.apache.solr.core.SolrResourceLoader) NamedList(org.apache.solr.common.util.NamedList) ZooKeeperStorageIO(org.apache.solr.rest.ManagedResourceStorage.ZooKeeperStorageIO) SolrZkClient(org.apache.solr.common.cloud.SolrZkClient) Test(org.junit.Test)

Aggregations

SolrZkClient (org.apache.solr.common.cloud.SolrZkClient)1 NamedList (org.apache.solr.common.util.NamedList)1 SolrResourceLoader (org.apache.solr.core.SolrResourceLoader)1 ZooKeeperStorageIO (org.apache.solr.rest.ManagedResourceStorage.ZooKeeperStorageIO)1 Test (org.junit.Test)1