@Test public void testGetTablespaces() throws Exception { Collection<String> names = Collections2.transform(catalog.getAllTablespaces(), new Function<CatalogProtos.TablespaceProto, String>() { @Override public String apply(@Nullable CatalogProtos.TablespaceProto input) { return input.getSpaceName(); } }); assertEquals(Sets.newHashSet("space1", "space2", "default"), Sets.newHashSet(names)); }
public Collection<Pair<String, URI>> getTablespaces() { ImmutableList.Builder<Pair<String, URI>> builder = ImmutableList.builder(); for (MetadataProvider p : providerMap.values()) { builder.add(new Pair<>(p.getDatabaseName(), p.getTablespaceUri())); } return builder.build(); }
LinkedMetadataManager { public Collection<Pair<String, URI>> getTablespaces() { ImmutableList.Builder<Pair<String, URI>> builder = ImmutableList.builder(); for (MetadataProvider p : providerMap.values()) { builder.add(new Pair<>(p.getDatabaseName(), p.getTablespaceUri())); } return builder.build(); } }
LinkedMetadataManager { public Collection<Pair<String, URI>> getTablespaces() { ImmutableList.Builder<Pair<String, URI>> builder = ImmutableList.builder(); for (MetadataProvider p : providerMap.values()) { builder.add(new Pair<>(p.getDatabaseName(), p.getTablespaceUri())); } return builder.build(); } LinkedMetadataManager(Collection<MetadataProvider> providers); }
LinkedMetadataManager { public Collection<Pair<String, URI>> getTablespaces() { ImmutableList.Builder<Pair<String, URI>> builder = ImmutableList.builder(); for (MetadataProvider p : providerMap.values()) { builder.add(new Pair<>(p.getDatabaseName(), p.getTablespaceUri())); } return builder.build(); } LinkedMetadataManager(Collection<MetadataProvider> providers); Collection<String> getTablespaceNames(); Optional<Pair<String, URI>> getTablespace(final String spaceName); Collection<Pair<String, URI>> getTablespaces(); boolean existsTablespace(String tablespaceName); Collection<String> getDatabases(); boolean existsDatabase(String dbName); Collection<String> getSchemas(@Nullable String dbName); Collection<String> getTableNames(String dbName,
                                          @Nullable final String schemaPattern,
                                          @Nullable final String tablePattern); void createTable(TableDesc desc); void dropTable(String databaseName, String schemaName, String tableName); boolean existsTable(String dbName, String schemaName, String tableName); TableDesc getTable(String dbName, String schemaName, String tbName); }
LinkedMetadataManager { public Collection<Pair<String, URI>> getTablespaces() { ImmutableList.Builder<Pair<String, URI>> builder = ImmutableList.builder(); for (MetadataProvider p : providerMap.values()) { builder.add(new Pair<>(p.getDatabaseName(), p.getTablespaceUri())); } return builder.build(); } LinkedMetadataManager(Collection<MetadataProvider> providers); Collection<String> getTablespaceNames(); Optional<Pair<String, URI>> getTablespace(final String spaceName); Collection<Pair<String, URI>> getTablespaces(); boolean existsTablespace(String tablespaceName); Collection<String> getDatabases(); boolean existsDatabase(String dbName); Collection<String> getSchemas(@Nullable String dbName); Collection<String> getTableNames(String dbName,
                                          @Nullable final String schemaPattern,
                                          @Nullable final String tablePattern); void createTable(TableDesc desc); void dropTable(String databaseName, String schemaName, String tableName); boolean existsTable(String dbName, String schemaName, String tableName); TableDesc getTable(String dbName, String schemaName, String tbName);  }