public Builder mergeFrom(org.apache.drill.exec.proto.UserProtos.GetCatalogsResp other) { if (other == org.apache.drill.exec.proto.UserProtos.GetCatalogsResp.getDefaultInstance()) return this; if (other.hasStatus()) { setStatus(other.getStatus()); if (other.hasError()) { mergeError(other.getError()); this.mergeUnknownFields(other.getUnknownFields()); return this;
public org.apache.drill.exec.proto.UserProtos.GetCatalogsResp buildPartial() { org.apache.drill.exec.proto.UserProtos.GetCatalogsResp result = new org.apache.drill.exec.proto.UserProtos.GetCatalogsResp(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.status_ = status_; if (catalogsBuilder_ == null) { if (((bitField0_ & 0x00000002) == 0x00000002)) { catalogs_ = java.util.Collections.unmodifiableList(catalogs_); bitField0_ = (bitField0_ & ~0x00000002); } result.catalogs_ = catalogs_; } else { result.catalogs_ = catalogsBuilder_.build(); } if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000002; } if (errorBuilder_ == null) { result.error_ = error_; } else { result.error_ = errorBuilder_.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.writeEnum(1, status_.getNumber()); } for (int i = 0; i < catalogs_.size(); i++) { output.writeMessage(2, catalogs_.get(i)); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeMessage(3, error_); } getUnknownFields().writeTo(output); }
return QueryPlanFragments.getDefaultInstance(); case RpcType.CATALOGS_VALUE: return GetCatalogsResp.getDefaultInstance(); case RpcType.SCHEMAS_VALUE: return GetSchemasResp.getDefaultInstance();
public Builder mergeFrom(org.apache.drill.exec.proto.UserProtos.GetCatalogsResp other) { if (other == org.apache.drill.exec.proto.UserProtos.GetCatalogsResp.getDefaultInstance()) return this; if (other.hasStatus()) { setStatus(other.getStatus()); if (other.hasError()) { mergeError(other.getError()); this.mergeUnknownFields(other.getUnknownFields()); return this;
public org.apache.drill.exec.proto.UserProtos.GetCatalogsResp buildPartial() { org.apache.drill.exec.proto.UserProtos.GetCatalogsResp result = new org.apache.drill.exec.proto.UserProtos.GetCatalogsResp(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.status_ = status_; if (catalogsBuilder_ == null) { if (((bitField0_ & 0x00000002) == 0x00000002)) { catalogs_ = java.util.Collections.unmodifiableList(catalogs_); bitField0_ = (bitField0_ & ~0x00000002); } result.catalogs_ = catalogs_; } else { result.catalogs_ = catalogsBuilder_.build(); } if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000002; } if (errorBuilder_ == null) { result.error_ = error_; } else { result.error_ = errorBuilder_.build(); } result.bitField0_ = to_bitField0_; onBuilt(); return result; }
@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 int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(1, status_.getNumber()); } for (int i = 0; i < catalogs_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, catalogs_.get(i)); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, error_); } 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.GetCatalogsResp prototype) {
@Override protected DrillPBError getError(GetCatalogsResp response) { return response.getError(); }
@Override protected RequestStatus getStatus(GetCatalogsResp response) { return response.getStatus(); }
public org.apache.drill.exec.proto.UserProtos.GetCatalogsResp getDefaultInstanceForType() { return org.apache.drill.exec.proto.UserProtos.GetCatalogsResp.getDefaultInstance(); }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeEnum(1, status_.getNumber()); } for (int i = 0; i < catalogs_.size(); i++) { output.writeMessage(2, catalogs_.get(i)); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeMessage(3, error_); } getUnknownFields().writeTo(output); }
@Override protected List<CatalogMetadata> getResult(GetCatalogsResp response) { return response.getCatalogsList(); }
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 void writeTo(com.dyuproject.protostuff.Output output, org.apache.drill.exec.proto.UserProtos.GetCatalogsResp message) throws java.io.IOException { if(message.hasStatus()) output.writeEnum(1, message.getStatus().getNumber(), false); for(org.apache.drill.exec.proto.UserProtos.CatalogMetadata catalogs : message.getCatalogsList()) output.writeObject(2, catalogs, org.apache.drill.exec.proto.SchemaUserProtos.CatalogMetadata.WRITE, true); if(message.hasError()) output.writeObject(3, message.getError(), org.apache.drill.exec.proto.SchemaUserBitShared.DrillPBError.WRITE, false); } public boolean isInitialized(org.apache.drill.exec.proto.UserProtos.GetCatalogsResp message)
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(1, status_.getNumber()); } for (int i = 0; i < catalogs_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, catalogs_.get(i)); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, error_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
public Builder toBuilder() { return newBuilder(this); }