public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(1, getCatalogNameBytes()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(2, getDescriptionBytes()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(3, getConnectBytes()); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
/** * <code>repeated .exec.user.CatalogMetadata catalogs = 2;</code> */ public org.apache.drill.exec.proto.UserProtos.CatalogMetadata.Builder addCatalogsBuilder( int index) { return getCatalogsFieldBuilder().addBuilder( index, org.apache.drill.exec.proto.UserProtos.CatalogMetadata.getDefaultInstance()); } /**
@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 void mergeFrom(com.dyuproject.protostuff.Input input, org.apache.drill.exec.proto.UserProtos.GetCatalogsResp.Builder builder) throws java.io.IOException { for(int number = input.readFieldNumber(this);; number = input.readFieldNumber(this)) { switch(number) { case 0: return; case 1: builder.setStatus(org.apache.drill.exec.proto.UserProtos.RequestStatus.valueOf(input.readEnum())); break; case 2: builder.addCatalogs(input.mergeObject(org.apache.drill.exec.proto.UserProtos.CatalogMetadata.newBuilder(), org.apache.drill.exec.proto.SchemaUserProtos.CatalogMetadata.MERGE)); break; case 3: builder.setError(input.mergeObject(org.apache.drill.exec.proto.UserBitShared.DrillPBError.newBuilder(), org.apache.drill.exec.proto.SchemaUserBitShared.DrillPBError.MERGE)); break; default: input.handleUnknownField(number, this); } } } public boolean isInitialized(org.apache.drill.exec.proto.UserProtos.GetCatalogsResp.Builder builder)
public Builder mergeFrom(org.apache.drill.exec.proto.UserProtos.CatalogMetadata other) { if (other == org.apache.drill.exec.proto.UserProtos.CatalogMetadata.getDefaultInstance()) return this; if (other.hasCatalogName()) { bitField0_ |= 0x00000001; catalogName_ = other.catalogName_; onChanged(); } if (other.hasDescription()) { bitField0_ |= 0x00000002; description_ = other.description_; onChanged(); } if (other.hasConnect()) { bitField0_ |= 0x00000004; connect_ = other.connect_; onChanged(); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public org.apache.drill.exec.proto.UserProtos.CatalogMetadata buildPartial() { org.apache.drill.exec.proto.UserProtos.CatalogMetadata result = new org.apache.drill.exec.proto.UserProtos.CatalogMetadata(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } result.catalogName_ = catalogName_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } result.description_ = description_; if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } result.connect_ = connect_; result.bitField0_ = to_bitField0_; onBuilt(); return result; }
public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(1, getCatalogNameBytes()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(2, getDescriptionBytes()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream .computeBytesSize(3, getConnectBytes()); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; }
public Builder toBuilder() { return newBuilder(this); }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { output.writeBytes(1, getCatalogNameBytes()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { output.writeBytes(2, getDescriptionBytes()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { output.writeBytes(3, getConnectBytes()); } getUnknownFields().writeTo(output); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.apache.drill.exec.proto.UserProtos.CatalogMetadata prototype) {
public static Builder newBuilder(org.apache.drill.exec.proto.UserProtos.CatalogMetadata prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); }
public org.apache.drill.exec.proto.UserProtos.CatalogMetadata getDefaultInstanceForType() { return org.apache.drill.exec.proto.UserProtos.CatalogMetadata.getDefaultInstance(); }
@Override protected MetaImpl.MetaCatalog adapt(CatalogMetadata protoValue) { return new MetaImpl.MetaCatalog(protoValue.getCatalogName()); } }.getMeta(connection.getClient().getCatalogs(null));
@Override public int compare(CatalogMetadata left, CatalogMetadata right) { return Ordering.natural().compare(left.getCatalogName(), right.getCatalogName()); } };
/** * <code>optional string catalog_name = 1;</code> */ public Builder clearCatalogName() { bitField0_ = (bitField0_ & ~0x00000001); catalogName_ = getDefaultInstance().getCatalogName(); onChanged(); return this; } /**
/** * <code>repeated .exec.user.CatalogMetadata catalogs = 2;</code> */ public org.apache.drill.exec.proto.UserProtos.CatalogMetadata.Builder addCatalogsBuilder( int index) { return getCatalogsFieldBuilder().addBuilder( index, org.apache.drill.exec.proto.UserProtos.CatalogMetadata.getDefaultInstance()); } /**
/** * <code>repeated .exec.user.CatalogMetadata catalogs = 2;</code> */ public org.apache.drill.exec.proto.UserProtos.CatalogMetadata.Builder addCatalogsBuilder() { return getCatalogsFieldBuilder().addBuilder( org.apache.drill.exec.proto.UserProtos.CatalogMetadata.getDefaultInstance()); } /**
public org.apache.drill.exec.proto.UserProtos.CatalogMetadata.Builder newMessage() { return org.apache.drill.exec.proto.UserProtos.CatalogMetadata.newBuilder(); } public java.lang.String getFieldName(int number)
public void writeTo(com.dyuproject.protostuff.Output output, org.apache.drill.exec.proto.UserProtos.CatalogMetadata message) throws java.io.IOException { if(message.hasCatalogName()) output.writeString(1, message.getCatalogName(), false); if(message.hasDescription()) output.writeString(2, message.getDescription(), false); if(message.hasConnect()) output.writeString(3, message.getConnect(), false); } public boolean isInitialized(org.apache.drill.exec.proto.UserProtos.CatalogMetadata message)
/** * <code>optional string connect = 3;</code> */ public Builder clearConnect() { bitField0_ = (bitField0_ & ~0x00000004); connect_ = getDefaultInstance().getConnect(); onChanged(); return this; } /**