@Override public TableManager getTableManager() { return repository.getTableManager(); }
@Override public List<String> getTables(String repositoryName) throws AvroInterruptedException, AvroIOException, AvroRepositoryException { try { TableManager tableMgr = repositoryManager.getRepository(repositoryName).getTableManager(); List<String> tables = new ArrayList<String>(); for (RepositoryTable table : tableMgr.getTables()) { tables.add(table.getName()); } return tables; } catch (InterruptedException e) { throw converter.convert(e); } catch (IOException e) { throw converter.convert(e); } catch (RepositoryException e) { throw converter.convert(e); } }
@Override public int run(CommandLine cmd) throws Exception { 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; }
@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) { throw converter.convert(e); } } }
@Override public Object dropTable(String repositoryName, String name) throws AvroInterruptedException, AvroIOException, AvroRepositoryException { try { TableManager tableMgr = repositoryManager.getRepository(repositoryName).getTableManager(); tableMgr.dropTable(name); return null; } catch (InterruptedException e) { throw converter.convert(e); } catch (IOException e) { throw converter.convert(e); } catch (RepositoryException e) { throw converter.convert(e); } }
@Override public Object createTable(String repository, AvroTableCreateDescriptor tableCreateDescriptor) throws AvroInterruptedException, AvroIOException, AvroRepositoryException { try { TableManager tableMgr = repositoryManager.getRepository(repository).getTableManager(); tableMgr.createTable(converter.convert(tableCreateDescriptor)); return null; } catch (InterruptedException e) { throw converter.convert(e); } catch (IOException e) { throw converter.convert(e); } catch (RepositoryException e) { throw converter.convert(e); } }