public org.apache.drill.exec.proto.UserProtos.GetCatalogsReq buildPartial() { org.apache.drill.exec.proto.UserProtos.GetCatalogsReq result = new org.apache.drill.exec.proto.UserProtos.GetCatalogsReq(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } if (catalogNameFilterBuilder_ == null) { result.catalogNameFilter_ = catalogNameFilter_; } else { result.catalogNameFilter_ = catalogNameFilterBuilder_.build(); } result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeMessage(1, catalogNameFilter_); } getUnknownFields().writeTo(output); }
com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { initFields(); int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
@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 org.apache.drill.exec.proto.UserProtos.GetCatalogsReq buildPartial() { org.apache.drill.exec.proto.UserProtos.GetCatalogsReq result = new org.apache.drill.exec.proto.UserProtos.GetCatalogsReq(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } if (catalogNameFilterBuilder_ == null) { result.catalogNameFilter_ = catalogNameFilter_; } else { result.catalogNameFilter_ = catalogNameFilterBuilder_.build(); } result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.apache.drill.exec.proto.UserProtos.GetCatalogsReq prototype) {
public org.apache.drill.exec.proto.UserProtos.GetCatalogsReq getDefaultInstanceForType() { return org.apache.drill.exec.proto.UserProtos.GetCatalogsReq.getDefaultInstance(); }
public static Builder newBuilder(org.apache.drill.exec.proto.UserProtos.GetCatalogsReq prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
public org.apache.drill.exec.proto.UserProtos.GetCatalogsReq build() { org.apache.drill.exec.proto.UserProtos.GetCatalogsReq result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
public boolean isInitialized(org.apache.drill.exec.proto.UserProtos.GetCatalogsReq message) { return message.isInitialized(); } public java.lang.String getFieldName(int number)
public org.apache.drill.exec.proto.UserProtos.GetCatalogsReq.Builder newMessage() { return org.apache.drill.exec.proto.UserProtos.GetCatalogsReq.newBuilder(); } public java.lang.String getFieldName(int number)
public void writeTo(com.dyuproject.protostuff.Output output, org.apache.drill.exec.proto.UserProtos.GetCatalogsReq message) throws java.io.IOException { if(message.hasCatalogNameFilter()) output.writeObject(1, message.getCatalogNameFilter(), org.apache.drill.exec.proto.SchemaUserProtos.LikeFilter.WRITE, false); } public boolean isInitialized(org.apache.drill.exec.proto.UserProtos.GetCatalogsReq message)
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeMessage(1, catalogNameFilter_); } getUnknownFields().writeTo(output); }
/** * Get the list of catalogs in <code>INFORMATION_SCHEMA.CATALOGS</code> table satisfying the given filters. * * @param catalogNameFilter Filter on <code>catalog name</code>. Pass null to apply no filter. * @return The list of catalogs in <code>INFORMATION_SCHEMA.CATALOGS</code> table satisfying the given filters. */ public DrillRpcFuture<GetCatalogsResp> getCatalogs(LikeFilter catalogNameFilter) { final GetCatalogsReq.Builder reqBuilder = GetCatalogsReq.newBuilder(); if (catalogNameFilter != null) { reqBuilder.setCatalogNameFilter(catalogNameFilter); } return client.send(RpcType.GET_CATALOGS, reqBuilder.build(), GetCatalogsResp.class); }
public Builder mergeFrom(org.apache.drill.exec.proto.UserProtos.GetCatalogsReq other) { if (other == org.apache.drill.exec.proto.UserProtos.GetCatalogsReq.getDefaultInstance()) return this; if (other.hasCatalogNameFilter()) { mergeCatalogNameFilter(other.getCatalogNameFilter()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, catalogNameFilter_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
public Builder toBuilder() { return newBuilder(this); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.apache.drill.exec.proto.UserProtos.GetCatalogsReq prototype) {