Package org.lilyproject.client

Examples of org.lilyproject.client.LilyClient


    public static void setUpBeforeClass() throws Exception {
        TestHelper.setupLogging();
        lilyProxy = new LilyProxy(null, null, null, true);
        byte[] schemaData = IOUtils.toByteArray(LilyProxyTest.class.getResourceAsStream("lilytestutility_solr_schema.xml"));
        lilyProxy.start(schemaData);
        LilyClient lilyClient = lilyProxy.getLilyServerProxy().getClient();
        repository = lilyClient.getRepository();
    }
View Full Code Here


    private void init() throws Exception{
        //
        // Instantiate Lily client
        //
        lilyClient = new LilyClient(this.zkConnectionString, 20000, keepAlive);
        lilyClient.getRetryConf().setRetryMaxTime(5000);

        LRepository repository = lilyClient.getDefaultRepository();
        LTable table = repository.getDefaultTable();
View Full Code Here

        int result = super.run(cmd);
        if (result != 0) {
            return result;
        }

        lilyClient = new LilyClient(zkConnectionString, 60000);
        LRepository repository = lilyClient.getDefaultRepository();
        typeManager = repository.getTypeManager();

        Configuration hbaseConf = HBaseConfiguration.create();
        hbaseConf.set("hbase.zookeeper.quorum", zkConnectionString);
View Full Code Here

        int status = super.run(cmd);
        if (status != 0) {
            return status;
        }

        LilyClient lilyClient = new LilyClient(zkConnectionString, 30000);
        TableManager tableManager = lilyClient.getRepository(repositoryName).getTableManager();
        try {
            status = execute(tableManager);
        } finally {
            lilyClient.close();
        }
        return status;
    }
View Full Code Here

    }

    public synchronized LilyClient getClient() throws IOException, InterruptedException, KeeperException,
            ZkConnectException, NoServersException, RepositoryException {
        if (lilyClient == null) {
            lilyClient = new LilyClient("localhost:2181", 30000);
        }
        return lilyClient;
    }
View Full Code Here

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

        lilyClient = new LilyClient(zkConnectionString, zkSessionTimeout);

        for (String arg : (List<String>)cmd.getArgList()) {
            System.out.println("----------------------------------------------------------------------");
            System.out.println("Importing " + arg + " to " + tableName + " table of repository " + repositoryName);
            InputStream is = new FileInputStream(arg);
View Full Code Here

    public void testZkConnectionsGoneAfterLilyClientStop() throws Exception {

        // At this point, there should be no running ZK threads
        checkNoZkThread();

        LilyClient lilyClient = new LilyClient(System.getProperty("zkConn", "localhost:2181"), 20000);

        // Lily client is started, there should be (at least one) ZK thread
        checkZkThread();

        //System.out.println("Before close:");
View Full Code Here

    @Test
    public void testZkConnectionCount() throws Exception {
        // At this point, there should be no running ZK threads
        checkNoZkThread();

        LilyClient lilyClient = new LilyClient(System.getProperty("zkConn", "localhost:2181"), 20000);

        // What number of ZK connections we expect?
        //  1 for Lily
        //  1 for HBase (connection used for direct ops such as scanning, blobs)
        //  [not applicable anymore since CDH3u4] 1 for HBaseAdmin
View Full Code Here

*/
public class LilyClientHBaseConnectionsTest {
    @Test
    public void testZkConnectionsGoneAfterLilyClientStop() throws Exception {

        LilyClient lilyClient1 = new LilyClient(System.getProperty("zkConn", "localhost:2181"), 20000);
        LilyClient lilyClient2 = new LilyClient(System.getProperty("zkConn", "localhost:2181"), 20000);
        LilyClient lilyClient3 = new LilyClient(System.getProperty("zkConn", "localhost:2181"), 20000);

        assertEquals(3, HConnectionTestingUtility.getConnectionCount());

        Closer.close(lilyClient1);

View Full Code Here

    }

    @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);

            // Need connection to Lily to parse RecordScan (a bit lame)
            lilyClient = null;
            try {
                lilyClient = new LilyClient(zk);
            } catch (Exception e) {
                throw new IOException("Error setting up LilyClient", e);
            }

            LRepository repository = lilyClient.getRepository(repositoryName);
            RecordScan scan = getScan(repository);

            // Determine start and stop row
            byte[] startRow;
            if (scan.getRawStartRecordId() != null) {
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.