Package org.lilyproject.repository.api

Examples of org.lilyproject.repository.api.RepositoryManager


    private AvroLilyImpl avroLilyImpl;
    private final static String repositoryName = "default";

    @Before
    public void setUp() throws IOException, InterruptedException, RepositoryException {
        RepositoryManager repositoryManager = mock(RepositoryManager.class);
        table = mock(LTable.class);
        Repository repository = mock(Repository.class);
        this.repository = repository;
        when(repository.getTable(Table.RECORD.name)).thenReturn(table);
        when(repositoryManager.getRepository(repositoryName)).thenReturn(repository);
        TypeManager typeManager = mock(TypeManager.class);
        avroConverter = mock(AvroConverter.class);
        avroLilyImpl = new AvroLilyImpl(repositoryManager, typeManager);
        avroLilyImpl.setAvroConverter(avroConverter);
    }
View Full Code Here


        // Set the authorization context
        setUser("jules", Sets.newHashSet("engineering"));

        // In-VM access to the repository manager (not going over the RPC interface)
        RepositoryManager repositoryManager = (RepositoryManager)lilyProxy.getLilyServerProxy()
                .getLilyServerTestingUtility().getRuntime().getJavaServiceManager()
                .getService(org.lilyproject.repository.api.RepositoryManager.class);

        // Create a record type
        LRepository repository = repositoryManager.getDefaultRepository();
        TypeManager typeManager = repository.getTypeManager();
        typeManager.recordTypeBuilder()
                .defaultNamespace("authztest")
                .name("Type1")
                .fieldEntry().defineField().name("field1").create().add()
View Full Code Here

        return confDir;
    }

    @Test
    public void testOne() throws Exception {
        RepositoryManager repoMgr = lilyProxy.getLilyServerProxy().getClient();

        //
        // Create some content in the default table of the default repository
        //
        LRepository repository = repoMgr.getDefaultRepository();
        TypeManager typeManager = repository.getTypeManager();
        IdGenerator idGenerator = repository.getIdGenerator();
        LTable table = repository.getDefaultTable();

        FieldType ft1 = typeManager.createFieldType("STRING", new QName("test", "field1"), Scope.NON_VERSIONED);

        RecordType rt1 = typeManager.recordTypeBuilder()
                .defaultNamespace("test")
                .name("rt1")
                .fieldEntry().use(ft1).add()
                .create();

        for (int i = 0; i < 100; i++) {
            table.recordBuilder()
                    .id(String.format("%1$03d", i))
                    .recordType(rt1.getName())
                    .field(ft1.getName(), "foo bar bar")
                    .create();
        }

        //
        // Also create some content in another repository with two tables
        //
        RepositoryModelImpl repositoryModel = new RepositoryModelImpl(lilyProxy.getLilyServerProxy().getZooKeeper());
        String repositoryName = "otherrepo";
        repositoryModel.create(repositoryName);
        assertTrue(repositoryModel.waitUntilRepositoryInState(repositoryName, RepositoryLifecycleState.ACTIVE, 60000L));
        repositoryModel.close();

        LRepository repository2 = repoMgr.getRepository(repositoryName);
        repository2.getTableManager().createTable("foobar");
        LTable table2 = repository2.getTable("foobar");
        LTable table3 = repository2.getDefaultTable();

        for (int i = 0; i < 50; i++) {
View Full Code Here

        RepositoryModel repositoryModel = new RepositoryModelImpl(zk);
        IdGenerator idGenerator = new IdGeneratorImpl();
        TypeManager typeManager = new HBaseTypeManager(idGenerator, conf, zk, hbaseTableFactory);
        RecordFactory recordFactory = new RecordFactoryImpl();

        RepositoryManager repositoryManager = new HBaseRepositoryManager(typeManager, idGenerator,
                recordFactory, hbaseTableFactory, new BlobsNotSupportedBlobManager(), conf, repositoryModel);
        HBaseRepository hbaseRepository;
        if (tableName != null) {
            hbaseRepository = (HBaseRepository) repositoryManager.getRepository(repositoryName).getTable(tableName);
        } else {
            hbaseRepository = (HBaseRepository) repositoryManager.getRepository(repositoryName);
        }
        return hbaseRepository;
    }
View Full Code Here

        AvroLilyTransceiver transceiver = new AvroLilyTransceiver(lilySocketAddr, keepAlive);
        HBaseTableFactoryImpl tableFactory = new HBaseTableFactoryImpl(hbaseConf);
        AvroConverter avroConverter = new AvroConverter();
        RemoteTypeManager remoteTypeManager = new RemoteTypeManager(lilySocketAddr, avroConverter, idGenerator, zk, schemaCache, keepAlive);
        RecordFactory recordFactory = new RecordFactoryImpl();
        RepositoryManager repositoryManager = new RemoteRepositoryManager(remoteTypeManager, idGenerator, recordFactory,
                transceiver, avroConverter, blobManager, tableFactory, repositoryModel);
        return repositoryManager;
    }
View Full Code Here

TOP

Related Classes of org.lilyproject.repository.api.RepositoryManager

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.