/** * <code>repeated .exec.user.CatalogMetadata catalogs = 2;</code> */ public Builder setCatalogs( int index, org.apache.drill.exec.proto.UserProtos.CatalogMetadata.Builder builderForValue) { if (catalogsBuilder_ == null) { ensureCatalogsIsMutable(); catalogs_.set(index, builderForValue.build()); onChanged(); } else { catalogsBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .exec.user.CatalogMetadata catalogs = 2;</code> */ public Builder addCatalogs( org.apache.drill.exec.proto.UserProtos.CatalogMetadata.Builder builderForValue) { if (catalogsBuilder_ == null) { ensureCatalogsIsMutable(); catalogs_.add(builderForValue.build()); onChanged(); } else { catalogsBuilder_.addMessage(builderForValue.build()); } return this; } /**
/** * <code>repeated .exec.user.CatalogMetadata catalogs = 2;</code> */ public Builder addCatalogs( int index, org.apache.drill.exec.proto.UserProtos.CatalogMetadata.Builder builderForValue) { if (catalogsBuilder_ == null) { ensureCatalogsIsMutable(); catalogs_.add(index, builderForValue.build()); onChanged(); } else { catalogsBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
@Override protected Response runInternal(final UserSession session, final SchemaTreeProvider schemaProvider) { final GetCatalogsResp.Builder respBuilder = GetCatalogsResp.newBuilder(); final InfoSchemaFilter filter = createInfoSchemaFilter( req.hasCatalogNameFilter() ? req.getCatalogNameFilter() : null, null, null, null, null); try { final PojoRecordReader<Catalog> records = getPojoRecordReader(CATALOGS, filter, getConfig(), schemaProvider, session); List<CatalogMetadata> metadata = new ArrayList<>(); for(Catalog c : records) { final CatalogMetadata.Builder catBuilder = CatalogMetadata.newBuilder(); catBuilder.setCatalogName(c.CATALOG_NAME); catBuilder.setDescription(c.CATALOG_DESCRIPTION); catBuilder.setConnect(c.CATALOG_CONNECT); metadata.add(catBuilder.build()); } // Reorder results according to JDBC spec Collections.sort(metadata, CATALOGS_ORDERING); respBuilder.addAllCatalogs(metadata); respBuilder.setStatus(RequestStatus.OK); } catch (Throwable e) { respBuilder.setStatus(RequestStatus.FAILED); respBuilder.setError(createPBError("get catalogs", e)); } finally { return new Response(RpcType.CATALOGS, respBuilder.build()); } } }
/** * <code>repeated .exec.user.CatalogMetadata catalogs = 2;</code> */ public Builder addCatalogs( int index, org.apache.drill.exec.proto.UserProtos.CatalogMetadata.Builder builderForValue) { if (catalogsBuilder_ == null) { ensureCatalogsIsMutable(); catalogs_.add(index, builderForValue.build()); onChanged(); } else { catalogsBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .exec.user.CatalogMetadata catalogs = 2;</code> */ public Builder setCatalogs( int index, org.apache.drill.exec.proto.UserProtos.CatalogMetadata.Builder builderForValue) { if (catalogsBuilder_ == null) { ensureCatalogsIsMutable(); catalogs_.set(index, builderForValue.build()); onChanged(); } else { catalogsBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .exec.user.CatalogMetadata catalogs = 2;</code> */ public Builder addCatalogs( org.apache.drill.exec.proto.UserProtos.CatalogMetadata.Builder builderForValue) { if (catalogsBuilder_ == null) { ensureCatalogsIsMutable(); catalogs_.add(builderForValue.build()); onChanged(); } else { catalogsBuilder_.addMessage(builderForValue.build()); } return this; } /**