Package org.lilyproject.client

Examples of org.lilyproject.client.LilyClient


    /**
     * Test scanners: scanners work directly on HBase, also remotely.
     */
    @Test
    public void testScanners() throws Exception {
        LilyClient client = lilyProxy.getLilyServerProxy().getClient();

        // Obtain a repository
        Repository repository = client.getRepository();
        IdGenerator idGenerator = repository.getIdGenerator();

        String NS = "org.lilyproject.client.test";

        // Create a field type and record type
View Full Code Here


        assertEquals("Number of scanned records", 10, i);
    }

    @Test
    public void testGetHostnames() throws Exception {
        LilyClient client = lilyProxy.getLilyServerProxy().getClient();
        Set<String> hosts = client.getLilyHostnames();
        assertEquals(1, hosts.size());
    }
View Full Code Here

                                               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
            Configuration conf = HBaseConfiguration.create();
            conf.set("hbase.zookeeper.quorum", zkConnString);
            HBaseTableFactory hbaseTableFactory = new HBaseTableFactoryImpl(conf);
View Full Code Here

                roles.add(role);
            }
            AuthorizationContextHolder.setCurrentContext(new AuthorizationContext("lily-scan-records", repositoryName, roles));
        }

        lilyClient = new LilyClient(zkConnectionString, zkSessionTimeout);
        LRepository repository = lilyClient.getRepository(repositoryName);
        LTable table = repository.getTable(tableName);
        if (cmd.hasOption(countOption.getOpt())) {
            RecordScanTool.count(repository, table, startId, stopId,recordTypeFilter, configFile);
        } else if (cmd.hasOption(printOption.getOpt())) {
View Full Code Here

        super.cleanup();
    }

    public void setupLily() throws IOException, ZkConnectException, NoServersException, InterruptedException,
            KeeperException, RepositoryException {
        lilyClient = new LilyClient(getZooKeeper());
        repository = lilyClient.getRepository(repositoryName);
        table = repository.getDefaultTable();
        idGenerator = repository.getIdGenerator();
        typeManager = repository.getTypeManager();
    }
View Full Code Here

        RecordScan scan = new RecordScan();
        scan.setRecordFilter(new RecordTypeFilter(new QName("mrsample", "Document")));

        // Need LilyClient here just to be able to serialize the RecordScan.
        // This is a bit lame, will improve in the future.
        LilyClient lilyClient = new LilyClient(zkConnectString, 30000);
        LRepository repository = lilyClient.getDefaultRepository();

        // Utility method will configure everything related to LilyInputFormat
        LilyMapReduceUtil.initMapperJob(scan, zkConnectString, repository, job);

        Closer.close(lilyClient);
View Full Code Here

    public void run() throws Exception {
        //
        // Instantiate Lily client
        //
        LilyClient lilyClient = new LilyClient(System.getProperty("zkConn", "localhost:2181"), 20000);
        LRepository repository = lilyClient.getDefaultRepository();
        LTable table = repository.getDefaultTable();

        //
        // Create a schema
        //
View Full Code Here

    @Override
    public ResultToSolrMapper createMapper(String indexName) throws IndexerConfException {
        String zookeeperConnectString = params.get(LResultToSolrMapper.ZOOKEEPER_KEY);
        String repositoryName = params.get(LResultToSolrMapper.REPO_KEY);
        ZooKeeperImpl zk = null;
        LilyClient lilyClient = null;
        LRepository lRepository;
        try {
            zk = new ZooKeeperImpl(zookeeperConnectString, 30000);
            lilyClient = new LilyClient(zk);
            if (repositoryName == null) {
                lRepository = lilyClient.getDefaultRepository();
            } else {
                lRepository = lilyClient.getRepository(repositoryName);
            }
        } catch (RepositoryException e) {
            Closer.close(lilyClient);
            Closer.close(zk);
            throw new AssertionError(e);
View Full Code Here

TOP

Related Classes of org.lilyproject.client.LilyClient

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.