Package org.lilyproject.util.zookeeper

Examples of org.lilyproject.util.zookeeper.ZooKeeperItf


        return conf;
    }

    @Override
    public List<InputSplit> getSplits(JobContext jobContext) throws IOException, InterruptedException {
        ZooKeeperItf zk = null;
        LilyClient lilyClient = null;
        Configuration hbaseConf = null;
        List<InputSplit> inputSplits = Lists.newArrayList();
        try {
            zk = ZkUtil.connect(zkConnectString, 30000);
View Full Code Here


     * @param tableName    name of the repository table to write to
     */
    public static BulkIngester newBulkIngester(String zkConnString, int timeout, String repositoryName, String tableName,
                                               boolean bulkMode) {
        try {
            ZooKeeperItf zk = ZkUtil.connect(zkConnString, timeout);

            // we need a lily client for non bulk access
            LilyClient lilyClient = new LilyClient(zk);

            // we need an HBaseRepository for bulk access
View Full Code Here

    }

    private Server createServer() throws Exception {
        if (this.useSolrCloud) {
            // create path on zookeeper for solr cloud
            ZooKeeperItf zk = ZkUtil.connect("localhost:2181", 10000);
            ZkUtil.createPath(zk, "/solr");
            zk.close();
        }

        Server server = new Server(solrPort);
        WebAppContext ctx = new WebAppContext(solrWarPath, "/solr");
        // The reason to change the classloading behavior was primarily so that the logging libraries would
View Full Code Here

        listener.waitForEvents(0);
    }

    @Test
    public void testTwoModelInstances() throws Exception {
        ZooKeeperItf zk1 = ZkUtil.connect("localhost:" + zkClientPort, 15000);
        ZooKeeperItf zk2 = ZkUtil.connect("localhost:" + zkClientPort, 15000);
        RepositoryModel repositoryModel1 = new RepositoryModelImpl(zk1);
        RepositoryModel repositoryModel2 = new RepositoryModelImpl(zk2);

        TestListener model1Listener = new TestListener();
        assertEquals(1, repositoryModel1.getRepositories(model1Listener).size());

        TestListener model2Listener = new TestListener();
        assertEquals(1, repositoryModel2.getRepositories(model2Listener).size());

        repositoryModel1.create("repo1");
        repositoryModel1.create("repo2");
        repositoryModel2.create("repo3");
        repositoryModel2.create("repo4");

        model2Listener.waitForEvents(4);
        model1Listener.waitForEvents(4);

        assertEquals(5, repositoryModel1.getRepositories().size());
        assertEquals(5, repositoryModel2.getRepositories().size());

        ((RepositoryModelImpl)repositoryModel1).close();
        ((RepositoryModelImpl)repositoryModel2).close();

        zk1.close();
        zk2.close();
    }
View Full Code Here

TOP

Related Classes of org.lilyproject.util.zookeeper.ZooKeeperItf

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.