private MetaResultSet serverGetTables(String catalog, final Pat schemaPattern, final Pat tableNamePattern, final List<String> typeList) { // Catalog is not a pattern final LikeFilter catalogNameFilter = newLikeFilter(quote(catalog)); final LikeFilter schemaNameFilter = newLikeFilter(schemaPattern); final LikeFilter tableNameFilter = newLikeFilter(tableNamePattern); return new MetadataAdapter<MetaImpl.MetaTable, GetTablesResp, TableMetadata>(MetaTable.class) { @Override protected RequestStatus getStatus(GetTablesResp response) { return response.getStatus(); }; @Override protected DrillPBError getError(GetTablesResp response) { return response.getError(); }; @Override protected List<TableMetadata> getResult(GetTablesResp response) { return response.getTablesList(); } @Override protected MetaImpl.MetaTable adapt(TableMetadata protoValue) { return new MetaImpl.MetaTable(protoValue.getCatalogName(), protoValue.getSchemaName(), protoValue.getTableName(), protoValue.getType()); }; }.getMeta(connection.getClient().getTables(catalogNameFilter, schemaNameFilter, tableNameFilter, typeList)); }
private MetaResultSet serverGetTables(String catalog, final Pat schemaPattern, final Pat tableNamePattern, final List<String> typeList) { // Catalog is not a pattern final LikeFilter catalogNameFilter = newLikeFilter(quote(catalog)); final LikeFilter schemaNameFilter = newLikeFilter(schemaPattern); final LikeFilter tableNameFilter = newLikeFilter(tableNamePattern); return new MetadataAdapter<MetaImpl.MetaTable, GetTablesResp, TableMetadata>(MetaTable.class) { @Override protected RequestStatus getStatus(GetTablesResp response) { return response.getStatus(); }; @Override protected DrillPBError getError(GetTablesResp response) { return response.getError(); }; @Override protected List<TableMetadata> getResult(GetTablesResp response) { return response.getTablesList(); } @Override protected MetaImpl.MetaTable adapt(TableMetadata protoValue) { return new MetaImpl.MetaTable(protoValue.getCatalogName(), protoValue.getSchemaName(), protoValue.getTableName(), protoValue.getType()); }; }.getMeta(connection.getClient().getTables(catalogNameFilter, schemaNameFilter, tableNameFilter, typeList)); }