@java.lang.Override public feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest buildPartial() { feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest result = new feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest(this); int from_bitField0_ = bitField0_; if (((bitField0_ & 0x00000001) == 0x00000001)) { ids_ = ids_.getUnmodifiableView(); bitField0_ = (bitField0_ & ~0x00000001); } result.ids_ = ids_; onBuilt(); return result; }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; { int dataSize = 0; for (int i = 0; i < ids_.size(); i++) { dataSize += computeStringSizeNoTag(ids_.getRaw(i)); } size += dataSize; size += 1 * getIdsList().size(); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
public Builder mergeFrom(feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest other) { if (other == feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest.getDefaultInstance()) return this; if (!other.ids_.isEmpty()) { if (ids_.isEmpty()) { ids_ = other.ids_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureIdsIsMutable(); ids_.addAll(other.ids_); } onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; makeExtensionsImmutable();
if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; makeExtensionsImmutable();
if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; makeExtensionsImmutable();
/** * Gets specs for all entities requested in the request. If the retrieval of any one of them * fails, the whole request will fail, giving an internal error. */ @Override public void getEntities( GetEntitiesRequest request, StreamObserver<GetEntitiesResponse> responseObserver) { long now = System.currentTimeMillis(); statsDClient.increment("get_entities_request_count"); try { List<EntitySpec> entitySpecs = specService .getEntities(request.getIdsList()) .stream() .map(EntityInfo::getEntitySpec) .collect(Collectors.toList()); GetEntitiesResponse response = GetEntitiesResponse.newBuilder().addAllEntities(entitySpecs).build(); responseObserver.onNext(response); responseObserver.onCompleted(); statsDClient.increment("get_entities_request_success"); } catch (RetrievalException | IllegalArgumentException e) { statsDClient.increment("get_entities_request_failed"); log.error("Error in getEntities: {}", e); responseObserver.onError(getRuntimeException(e)); } finally { long duration = System.currentTimeMillis() - now; statsDClient.gauge("get_entities_latency_ms", duration); } }
@io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "GetEntities", requestType = feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest.class, responseType = feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor<feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest, feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesResponse> getGetEntitiesMethod() { io.grpc.MethodDescriptor<feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest, feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesResponse> getGetEntitiesMethod; if ((getGetEntitiesMethod = CoreServiceGrpc.getGetEntitiesMethod) == null) { synchronized (CoreServiceGrpc.class) { if ((getGetEntitiesMethod = CoreServiceGrpc.getGetEntitiesMethod) == null) { CoreServiceGrpc.getGetEntitiesMethod = getGetEntitiesMethod = io.grpc.MethodDescriptor.<feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest, feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesResponse>newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setFullMethodName(generateFullMethodName( "feast.core.CoreService", "GetEntities")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesResponse.getDefaultInstance())) .setSchemaDescriptor(new CoreServiceMethodDescriptorSupplier("GetEntities")) .build(); } } } return getGetEntitiesMethod; }
@io.grpc.stub.annotations.RpcMethod( fullMethodName = SERVICE_NAME + '/' + "GetEntities", requestType = feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest.class, responseType = feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesResponse.class, methodType = io.grpc.MethodDescriptor.MethodType.UNARY) public static io.grpc.MethodDescriptor<feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest, feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesResponse> getGetEntitiesMethod() { io.grpc.MethodDescriptor<feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest, feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesResponse> getGetEntitiesMethod; if ((getGetEntitiesMethod = CoreServiceGrpc.getGetEntitiesMethod) == null) { synchronized (CoreServiceGrpc.class) { if ((getGetEntitiesMethod = CoreServiceGrpc.getGetEntitiesMethod) == null) { CoreServiceGrpc.getGetEntitiesMethod = getGetEntitiesMethod = io.grpc.MethodDescriptor.<feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest, feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesResponse>newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setFullMethodName(generateFullMethodName( "feast.core.CoreService", "GetEntities")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesResponse.getDefaultInstance())) .setSchemaDescriptor(new CoreServiceMethodDescriptorSupplier("GetEntities")) .build(); } } } return getGetEntitiesMethod; }
/** * Get map of entity ID and {@link EntitySpec} from Core API, given a collection of entityId. * * @param entityIds collection of entityId to retrieve. * @return map of entity ID as key and {@link EntitySpec} value. * @throws SpecRetrievalException if any error happens during retrieval */ public Map<String, EntitySpec> getEntitySpecs(Iterable<String> entityIds) { GetEntitiesRequest request = GetEntitiesRequest.newBuilder().addAllIds(entityIds).build(); try { GetEntitiesResponse response = blockingStub.getEntities(request); return response .getEntitiesList() .stream() .collect(Collectors.toMap(EntitySpec::getName, Function.identity())); } catch (StatusRuntimeException e) { log.error("GRPC error in getEntitySpecs: {}", e.getStatus()); throw new SpecRetrievalException("Unable to retrieve entity spec", e); } }
public static io.grpc.MethodDescriptor<feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest, feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesResponse> getGetEntitiesMethod() { io.grpc.MethodDescriptor<feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest, feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesResponse> getGetEntitiesMethod; if ((getGetEntitiesMethod = CoreServiceGrpc.getGetEntitiesMethod) == null) { synchronized (CoreServiceGrpc.class) { if ((getGetEntitiesMethod = CoreServiceGrpc.getGetEntitiesMethod) == null) { CoreServiceGrpc.getGetEntitiesMethod = getGetEntitiesMethod = io.grpc.MethodDescriptor.<feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest, feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesResponse>newBuilder() .setType(io.grpc.MethodDescriptor.MethodType.UNARY) .setFullMethodName(generateFullMethodName( "feast.core.CoreService", "GetEntities")) .setSampledToLocalTracing(true) .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest.getDefaultInstance())) .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesResponse.getDefaultInstance())) .setSchemaDescriptor(new CoreServiceMethodDescriptorSupplier("GetEntities")) .build(); } } } return getGetEntitiesMethod; }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; { int dataSize = 0; for (int i = 0; i < ids_.size(); i++) { dataSize += computeStringSizeNoTag(ids_.getRaw(i)); } size += dataSize; size += 1 * getIdsList().size(); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
public Builder mergeFrom(feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest other) { if (other == feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest.getDefaultInstance()) return this; if (!other.ids_.isEmpty()) { if (ids_.isEmpty()) { ids_ = other.ids_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureIdsIsMutable(); ids_.addAll(other.ids_); } onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
public Builder mergeFrom(feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest other) { if (other == feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest.getDefaultInstance()) return this; if (!other.ids_.isEmpty()) { if (ids_.isEmpty()) { ids_ = other.ids_; bitField0_ = (bitField0_ & ~0x00000001); } else { ensureIdsIsMutable(); ids_.addAll(other.ids_); } onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest)) { return super.equals(obj); } feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest other = (feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest) obj; boolean result = true; result = result && getIdsList() .equals(other.getIdsList()); 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.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest)) { return super.equals(obj); } feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest other = (feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest) obj; boolean result = true; result = result && getIdsList() .equals(other.getIdsList()); 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.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest)) { return super.equals(obj); } feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest other = (feast.core.CoreServiceProto.CoreServiceTypes.GetEntitiesRequest) obj; boolean result = true; result = result && getIdsList() .equals(other.getIdsList()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; { int dataSize = 0; for (int i = 0; i < ids_.size(); i++) { dataSize += computeStringSizeNoTag(ids_.getRaw(i)); } size += dataSize; size += 1 * getIdsList().size(); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (getIdsCount() > 0) { hash = (37 * hash) + IDS_FIELD_NUMBER; hash = (53 * hash) + getIdsList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * Get map of entity ID and {@link EntitySpec} from Core API, given a collection of entityId. */ public Map<String, EntitySpec> getEntitySpecs(Iterable<String> entityIds) { GetEntitiesRequest request = GetEntitiesRequest.newBuilder().addAllIds(entityIds).build(); try { GetEntitiesResponse response = blockingStub.getEntities(request); return response .getEntitiesList() .stream() .collect(Collectors.toMap(EntitySpec::getName, Function.identity())); } catch (StatusRuntimeException e) { log.error("GRPC error in getEntitySpecs: {}", e.getStatus()); throw new SpecRetrievalException("Unable to retrieve entity spec", e); } }