@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()); } } }
public Builder toBuilder() { return newBuilder(this); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.apache.drill.exec.proto.UserProtos.GetCatalogsResp prototype) {
public static Builder newBuilder(org.apache.drill.exec.proto.UserProtos.GetCatalogsResp prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
public org.apache.drill.exec.proto.UserProtos.GetCatalogsResp.Builder newMessage() { return org.apache.drill.exec.proto.UserProtos.GetCatalogsResp.newBuilder(); } public java.lang.String getFieldName(int number)
public Builder toBuilder() { return newBuilder(this); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.apache.drill.exec.proto.UserProtos.GetCatalogsResp prototype) {
public static Builder newBuilder(org.apache.drill.exec.proto.UserProtos.GetCatalogsResp prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
public org.apache.drill.exec.proto.UserProtos.GetCatalogsResp.Builder newMessage() { return org.apache.drill.exec.proto.UserProtos.GetCatalogsResp.newBuilder(); } public java.lang.String getFieldName(int number)