/** * <pre> * List of request details, contains: featureId, type of query, and limit. * </pre> * * <code>repeated .feast.serving.RequestDetail requestDetails = 3;</code> */ public feast.serving.ServingAPIProto.RequestDetail.Builder addRequestDetailsBuilder( int index) { return getRequestDetailsFieldBuilder().addBuilder( index, feast.serving.ServingAPIProto.RequestDetail.getDefaultInstance()); } /**
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + FEATUREID_FIELD_NUMBER; hash = (53 * hash) + getFeatureId().hashCode(); hash = (37 * hash) + TYPE_FIELD_NUMBER; hash = (53 * hash) + type_; hash = (37 * hash) + LIMIT_FIELD_NUMBER; hash = (53 * hash) + getLimit(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getFeatureIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, featureId_); } if (type_ != feast.serving.ServingAPIProto.RequestType.LAST.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(2, type_); } if (limit_ != 0) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(3, limit_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
requests .stream() .map(r -> new Pair<>(r.getFeatureSpec(), r.getRequestDetail().getLimit())) .collect(Collectors.toList());
if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
requestDetailWithSpecs .stream() .map(r -> new Pair<>(r.getFeatureSpec(), r.getRequestDetail().getLimit())) .collect(Collectors.toList()); featureValues =
if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable();
public static void validateRequest(Request request) { // entity name shall present if (Strings.isNullOrEmpty(request.getEntityName())) { throw new IllegalArgumentException("entity name must be set"); } // entity id list shall not be empty if (request.getEntityIdList().size() <= 0) { throw new IllegalArgumentException("entity ID must be provided"); } // request detail shall not be empty if (request.getRequestDetailsList().size() <= 0) { throw new IllegalArgumentException("request details must be provided"); } // feature id in each request detail shall have same entity name String entityName = request.getEntityName(); for (RequestDetail requestDetail : request.getRequestDetailsList()) { String featureId = requestDetail.getFeatureId(); if (!featureId.substring(0, featureId.indexOf(".")).equals(entityName)) { throw new IllegalArgumentException( "entity name of all feature ID in request details must be: " + entityName); } } }
/** * Attach request details with associated feature spec. * * @param request * @return */ private List<RequestDetailWithSpec> joinRequestDetailsWithFeatureSpec(Request request) { // dedup feature ID. Collection<String> featuresId = request .getRequestDetailsList() .stream() .map(RequestDetail::getFeatureId) .collect(Collectors.toSet()); Map<String, FeatureSpec> featureSpecMap = specStorage.getFeatureSpecs(featuresId); return request .getRequestDetailsList() .stream() .map(rd -> new RequestDetailWithSpec(rd, featureSpecMap.get(rd.getFeatureId()))) .collect(Collectors.toList()); } }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getFeatureIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, featureId_); } if (type_ != feast.serving.ServingAPIProto.RequestType.LAST.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(2, type_); } if (limit_ != 0) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(3, limit_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getFeatureIdBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, featureId_); } if (type_ != feast.serving.ServingAPIProto.RequestType.LAST.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(2, type_); } if (limit_ != 0) { size += com.google.protobuf.CodedOutputStream .computeInt32Size(3, limit_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof feast.serving.ServingAPIProto.RequestDetail)) { return super.equals(obj); } feast.serving.ServingAPIProto.RequestDetail other = (feast.serving.ServingAPIProto.RequestDetail) obj; boolean result = true; result = result && getFeatureId() .equals(other.getFeatureId()); result = result && type_ == other.type_; result = result && (getLimit() == other.getLimit()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof feast.serving.ServingAPIProto.RequestDetail)) { return super.equals(obj); } feast.serving.ServingAPIProto.RequestDetail other = (feast.serving.ServingAPIProto.RequestDetail) obj; boolean result = true; result = result && getFeatureId() .equals(other.getFeatureId()); result = result && type_ == other.type_; result = result && (getLimit() == other.getLimit()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + FEATUREID_FIELD_NUMBER; hash = (53 * hash) + getFeatureId().hashCode(); hash = (37 * hash) + TYPE_FIELD_NUMBER; hash = (53 * hash) + type_; hash = (37 * hash) + LIMIT_FIELD_NUMBER; hash = (53 * hash) + getLimit(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof feast.serving.ServingAPIProto.RequestDetail)) { return super.equals(obj); } feast.serving.ServingAPIProto.RequestDetail other = (feast.serving.ServingAPIProto.RequestDetail) obj; boolean result = true; result = result && getFeatureId() .equals(other.getFeatureId()); result = result && type_ == other.type_; result = result && (getLimit() == other.getLimit()); result = result && unknownFields.equals(other.unknownFields); return result; }
/** * <pre> * feature ID to be included in the query. * feature ID is in the form of [entity_name].[granularity].[feature_name] * e.g: "driver.day.total_accepted_booking" * all requested feature ID shall have same entity name. * </pre> * * <code>string featureId = 1;</code> */ public Builder clearFeatureId() { featureId_ = getDefaultInstance().getFeatureId(); onChanged(); return this; } /**
/** * <pre> * feature ID to be included in the query. * feature ID is in the form of [entity_name].[granularity].[feature_name] * e.g: "driver.day.total_accepted_booking" * all requested feature ID shall have same entity name. * </pre> * * <code>string featureId = 1;</code> */ public Builder clearFeatureId() { featureId_ = getDefaultInstance().getFeatureId(); onChanged(); return this; } /**
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + FEATUREID_FIELD_NUMBER; hash = (53 * hash) + getFeatureId().hashCode(); hash = (37 * hash) + TYPE_FIELD_NUMBER; hash = (53 * hash) + type_; hash = (37 * hash) + LIMIT_FIELD_NUMBER; hash = (53 * hash) + getLimit(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * <pre> * feature ID to be included in the query. * feature ID is in the form of [entity_name].[granularity].[feature_name] * e.g: "driver.day.total_accepted_booking" * all requested feature ID shall have same entity name. * </pre> * * <code>string featureId = 1;</code> */ public Builder clearFeatureId() { featureId_ = getDefaultInstance().getFeatureId(); onChanged(); return this; } /**