Package org.lilyproject.repository.api

Examples of org.lilyproject.repository.api.TableManager.tableExists()


    @DELETE
    @Path("{name}")
    public Response dropTable(@PathParam("name") String tableName, @Context UriInfo uriInfo) {
        try {
            TableManager tableManager = getRepository(uriInfo).getTableManager();
            if (!tableManager.tableExists(tableName)) {
                throw new ResourceException("Table '" + tableName + "' not found", NOT_FOUND.getStatusCode());
            }
            tableManager.dropTable(tableName);
            return Response.ok().build();
        } catch (IOException ioe) {
View Full Code Here


        repositoryManager = new HBaseRepositoryManager(typeManager, idGenerator,
                new RecordFactoryImpl(), hbaseTableFactory, blobManager, configuration, repositoryModel);

        TableManager repoTableManager =
                new TableManagerImpl(/* TODO multiple repositories */ "default", configuration, hbaseTableFactory);
        if (!repoTableManager.tableExists(Table.RECORD.name)) {
            repoTableManager.createTable(Table.RECORD.name);
        }

        repository = (Repository) repositoryManager.getDefaultRepository().getDefaultTable();
        table = repository.getDefaultTable();
View Full Code Here

    @Override
    public boolean tableExists(String repositoryName, String name)
            throws AvroInterruptedException, AvroIOException, AvroRepositoryException {
        try {
            TableManager tableMgr = repositoryManager.getRepository(repositoryName).getTableManager();
            return tableMgr.tableExists(name);
        } catch (InterruptedException e) {
            throw converter.convert(e);
        } catch (IOException e) {
            throw converter.convert(e);
        } catch (RepositoryException e) {
View Full Code Here

        tableManager.createTable("foo");

        assertEquals(2, tableManager.getTables().size());

        assertTrue(tableManager.tableExists("foo"));

        repository.getTable("foo");

        tableManager.dropTable("foo");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.