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); } } }
public Builder mergeFrom(feast.serving.ServingAPIProto.QueryFeatures.Request other) { if (other == feast.serving.ServingAPIProto.QueryFeatures.Request.getDefaultInstance()) return this; if (!other.getEntityName().isEmpty()) { entityName_ = other.entityName_; onChanged();
public Builder mergeFrom(feast.serving.ServingAPIProto.QueryFeatures.Request other) { if (other == feast.serving.ServingAPIProto.QueryFeatures.Request.getDefaultInstance()) return this; if (!other.getEntityName().isEmpty()) { entityName_ = other.entityName_; onChanged();
public Builder mergeFrom(feast.serving.ServingAPIProto.QueryFeatures.Request other) { if (other == feast.serving.ServingAPIProto.QueryFeatures.Request.getDefaultInstance()) return this; if (!other.getEntityName().isEmpty()) { entityName_ = other.entityName_; onChanged();
/** * Query feature from feast storage. * * @param request feature query request. * @return response of the query containing the feature values. */ public Response queryFeatures(Request request) { try (Scope scope = tracer.buildSpan("FeastServing-queryFeatures").startActive(true)) { List<RequestDetailWithSpec> requestDetails = joinRequestDetailsWithFeatureSpec(request); // create connection to feature storage if necessary checkAndConnectFeatureStorage( requestDetails .stream() .map(r -> r.getFeatureSpec().getDataStores().getServing().getId()) .collect(Collectors.toList())); scope.span().log("start retrieving all feature"); Map<String, Entity> result = featureRetrievalDispatcher.dispatchFeatureRetrieval( request.getEntityName(), request.getEntityIdList(), requestDetails, request.getTimestampRange()); scope.span().log("finished retrieving all feature"); // build response return Response.newBuilder() .setEntityName(request.getEntityName()) .putAllEntities(result) .build(); } }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + ENTITYNAME_FIELD_NUMBER; hash = (53 * hash) + getEntityName().hashCode(); if (getEntityIdCount() > 0) { hash = (37 * hash) + ENTITYID_FIELD_NUMBER; hash = (53 * hash) + getEntityIdList().hashCode(); } if (getRequestDetailsCount() > 0) { hash = (37 * hash) + REQUESTDETAILS_FIELD_NUMBER; hash = (53 * hash) + getRequestDetailsList().hashCode(); } if (hasTimestampRange()) { hash = (37 * hash) + TIMESTAMPRANGE_FIELD_NUMBER; hash = (53 * hash) + getTimestampRange().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + ENTITYNAME_FIELD_NUMBER; hash = (53 * hash) + getEntityName().hashCode(); if (getEntityIdCount() > 0) { hash = (37 * hash) + ENTITYID_FIELD_NUMBER; hash = (53 * hash) + getEntityIdList().hashCode(); } if (getRequestDetailsCount() > 0) { hash = (37 * hash) + REQUESTDETAILS_FIELD_NUMBER; hash = (53 * hash) + getRequestDetailsList().hashCode(); } if (hasTimestampRange()) { hash = (37 * hash) + TIMESTAMPRANGE_FIELD_NUMBER; hash = (53 * hash) + getTimestampRange().hashCode(); } 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.QueryFeatures.Request)) { return super.equals(obj); } feast.serving.ServingAPIProto.QueryFeatures.Request other = (feast.serving.ServingAPIProto.QueryFeatures.Request) obj; boolean result = true; result = result && getEntityName() .equals(other.getEntityName()); result = result && getEntityIdList() .equals(other.getEntityIdList()); result = result && getRequestDetailsList() .equals(other.getRequestDetailsList()); result = result && (hasTimestampRange() == other.hasTimestampRange()); if (hasTimestampRange()) { result = result && getTimestampRange() .equals(other.getTimestampRange()); } 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) + ENTITYNAME_FIELD_NUMBER; hash = (53 * hash) + getEntityName().hashCode(); if (getEntityIdCount() > 0) { hash = (37 * hash) + ENTITYID_FIELD_NUMBER; hash = (53 * hash) + getEntityIdList().hashCode(); } if (getRequestDetailsCount() > 0) { hash = (37 * hash) + REQUESTDETAILS_FIELD_NUMBER; hash = (53 * hash) + getRequestDetailsList().hashCode(); } if (hasTimestampRange()) { hash = (37 * hash) + TIMESTAMPRANGE_FIELD_NUMBER; hash = (53 * hash) + getTimestampRange().hashCode(); } 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.QueryFeatures.Request)) { return super.equals(obj); } feast.serving.ServingAPIProto.QueryFeatures.Request other = (feast.serving.ServingAPIProto.QueryFeatures.Request) obj; boolean result = true; result = result && getEntityName() .equals(other.getEntityName()); result = result && getEntityIdList() .equals(other.getEntityIdList()); result = result && getRequestDetailsList() .equals(other.getRequestDetailsList()); result = result && (hasTimestampRange() == other.hasTimestampRange()); if (hasTimestampRange()) { result = result && getTimestampRange() .equals(other.getTimestampRange()); } 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.QueryFeatures.Request)) { return super.equals(obj); } feast.serving.ServingAPIProto.QueryFeatures.Request other = (feast.serving.ServingAPIProto.QueryFeatures.Request) obj; boolean result = true; result = result && getEntityName() .equals(other.getEntityName()); result = result && getEntityIdList() .equals(other.getEntityIdList()); result = result && getRequestDetailsList() .equals(other.getRequestDetailsList()); result = result && (hasTimestampRange() == other.hasTimestampRange()); if (hasTimestampRange()) { result = result && getTimestampRange() .equals(other.getTimestampRange()); } result = result && unknownFields.equals(other.unknownFields); return result; }
/** * <pre> * e.g. "driver", "customer", "city". * </pre> * * <code>string entityName = 1;</code> */ public Builder clearEntityName() { entityName_ = getDefaultInstance().getEntityName(); onChanged(); return this; } /**
/** * <pre> * e.g. "driver", "customer", "city". * </pre> * * <code>string entityName = 1;</code> */ public Builder clearEntityName() { entityName_ = getDefaultInstance().getEntityName(); onChanged(); return this; } /**
/** * <pre> * e.g. "driver", "customer", "city". * </pre> * * <code>string entityName = 1;</code> */ public Builder clearEntityName() { entityName_ = getDefaultInstance().getEntityName(); onChanged(); return this; } /**