@Test public void testGetTablespace() throws Exception { CatalogProtos.TablespaceProto space1 = catalog.getTablespace("space1"); assertEquals("space1", space1.getSpaceName()); assertEquals("http: CatalogProtos.TablespaceProto space2 = catalog.getTablespace("space2"); assertEquals("space2", space2.getSpaceName()); assertEquals("http: }
public Optional<Pair<String, URI>> getTablespace(final String spaceName) { Collection<MetadataProvider> filtered = filter(providerMap.values(), new Predicate<MetadataProvider>() { @Override public boolean apply(@Nullable MetadataProvider input) { return input.getTablespaceName().equals(spaceName); } }); if (filtered.isEmpty()) { return Optional.empty(); } else { MetadataProvider found = filtered.iterator().next(); return Optional.of(new Pair<>(found.getTablespaceName(), found.getTablespaceUri())); } }
LinkedMetadataManager { public Optional<Pair<String, URI>> getTablespace(final String spaceName) { Collection<MetadataProvider> filtered = filter(providerMap.values(), new Predicate<MetadataProvider>() { @Override public boolean apply(@Nullable MetadataProvider input) { return input.getTablespaceName().equals(spaceName); } }); if (filtered.isEmpty()) { return Optional.empty(); } else { MetadataProvider found = filtered.iterator().next(); return Optional.of(new Pair<>(found.getTablespaceName(), found.getTablespaceUri())); } } }
LinkedMetadataManager { public Optional<Pair<String, URI>> getTablespace(final String spaceName) { Collection<MetadataProvider> filtered = filter(providerMap.values(), new Predicate<MetadataProvider>() { @Override public boolean apply(@Nullable MetadataProvider input) { return input.getTablespaceName().equals(spaceName); } }); if (filtered.isEmpty()) { return Optional.empty(); } else { MetadataProvider found = filtered.iterator().next(); return Optional.of(new Pair<>(found.getTablespaceName(), found.getTablespaceUri())); } } LinkedMetadataManager(Collection<MetadataProvider> providers); }
LinkedMetadataManager { public Optional<Pair<String, URI>> getTablespace(final String spaceName) { Collection<MetadataProvider> filtered = filter(providerMap.values(), new Predicate<MetadataProvider>() { @Override public boolean apply(@Nullable MetadataProvider input) { return input.getTablespaceName().equals(spaceName); } }); if (filtered.isEmpty()) { return Optional.empty(); } else { MetadataProvider found = filtered.iterator().next(); return Optional.of(new Pair<>(found.getTablespaceName(), found.getTablespaceUri())); } } 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 Optional<Pair<String, URI>> getTablespace(final String spaceName) { Collection<MetadataProvider> filtered = filter(providerMap.values(), new Predicate<MetadataProvider>() { @Override public boolean apply(@Nullable MetadataProvider input) { return input.getTablespaceName().equals(spaceName); } }); if (filtered.isEmpty()) { return Optional.empty(); } else { MetadataProvider found = filtered.iterator().next(); return Optional.of(new Pair<>(found.getTablespaceName(), found.getTablespaceUri())); } } 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);  }