Skip to content

Commit

Permalink
Delete v1 concepts (#1194)
Browse files Browse the repository at this point in the history
* Cleanup common  module

Signed-off-by: Terence <terencelimxp@gmail.com>

* Cleanup core module

Signed-off-by: Terence <terencelimxp@gmail.com>

* Cleanup staging module

Signed-off-by: Terence <terencelimxp@gmail.com>

* Cleanup storage module

Signed-off-by: Terence <terencelimxp@gmail.com>

* Cleanup comments and tests

Signed-off-by: Terence <terencelimxp@gmail.com>

* Cleanup common-test and python sdk

Signed-off-by: Terence <terencelimxp@gmail.com>

* Remove models in core

Signed-off-by: Terence <terencelimxp@gmail.com>

* Cleanup protos and db migration

Signed-off-by: Terence <terencelimxp@gmail.com>

* Fix test

Signed-off-by: Terence <terencelimxp@gmail.com>

* Fix test

Signed-off-by: Terence <terencelimxp@gmail.com>

* Update golang protos

Signed-off-by: Terence <terencelimxp@gmail.com>

* Update go-mod go-sum

Signed-off-by: Terence <terencelimxp@gmail.com>

* Revert table removal in database

Signed-off-by: Terence <terencelimxp@gmail.com>
  • Loading branch information
terryyylim authored Nov 26, 2020
1 parent 542e7d7 commit 6583d72
Show file tree
Hide file tree
Showing 77 changed files with 2,865 additions and 9,063 deletions.
18 changes: 0 additions & 18 deletions common-test/src/main/java/feast/common/it/DataGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import feast.proto.core.FeatureProto;
import feast.proto.core.FeatureProto.FeatureSpecV2;
import feast.proto.core.FeatureTableProto.FeatureTableSpec;
import feast.proto.core.SourceProto;
import feast.proto.core.StoreProto;
import feast.proto.serving.ServingAPIProto;
import feast.proto.types.ValueProto;
Expand All @@ -50,8 +49,6 @@ public class DataGenerator {
createStore(
"test-store", StoreProto.Store.StoreType.REDIS, ImmutableList.of(defaultSubscription));

static SourceProto.Source defaultSource = createSource("localhost", "topic");

public static Triple<String, String, Boolean> getDefaultSubscription() {
return defaultSubscription;
}
Expand All @@ -60,21 +57,6 @@ public static StoreProto.Store getDefaultStore() {
return defaultStore;
}

public static SourceProto.Source getDefaultSource() {
return defaultSource;
}

public static SourceProto.Source createSource(String server, String topic) {
return SourceProto.Source.newBuilder()
.setType(SourceProto.SourceType.KAFKA)
.setKafkaSourceConfig(
SourceProto.KafkaSourceConfig.newBuilder()
.setBootstrapServers(server)
.setTopic(topic)
.build())
.build();
}

public static StoreProto.Store createStore(
String name,
StoreProto.Store.StoreType type,
Expand Down
55 changes: 0 additions & 55 deletions common/src/main/java/feast/common/models/Feature.java

This file was deleted.

44 changes: 0 additions & 44 deletions common/src/main/java/feast/common/models/FeatureSet.java

This file was deleted.

75 changes: 0 additions & 75 deletions common/src/main/java/feast/common/models/FeatureSetReference.java

This file was deleted.

58 changes: 0 additions & 58 deletions core/src/main/java/feast/core/config/FeatureStreamConfig.java

This file was deleted.

10 changes: 5 additions & 5 deletions core/src/main/java/feast/core/config/MonitoringConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
package feast.core.config;

import feast.core.dao.FeatureSetRepository;
import feast.core.dao.FeatureTableRepository;
import feast.core.dao.StoreRepository;
import feast.core.metrics.collector.FeastResourceCollector;
import feast.core.metrics.collector.JVMResourceCollector;
Expand Down Expand Up @@ -47,18 +47,18 @@ public ServletRegistrationBean<HttpServlet> metricsServlet() {
/**
* Register custom Prometheus collector that exports metrics about Feast Resources.
*
* <p>For example: total number of registered feature sets and stores.
* <p>For example: total number of registered feature tables and stores.
*
* @param featureSetRepository {@link FeatureSetRepository}
* @param featureTableRepository {@link FeatureTableRepository}
* @param storeRepository {@link StoreRepository}
* @return {@link FeastResourceCollector}
*/
@Bean
@Autowired
public FeastResourceCollector feastResourceCollector(
FeatureSetRepository featureSetRepository, StoreRepository storeRepository) {
FeatureTableRepository featureTableRepository, StoreRepository storeRepository) {
FeastResourceCollector collector =
new FeastResourceCollector(featureSetRepository, storeRepository);
new FeastResourceCollector(featureTableRepository, storeRepository);
collector.register();
return collector;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,18 @@
*/
package feast.core.controller;

import com.google.protobuf.InvalidProtocolBufferException;
import com.google.protobuf.Timestamp;
import feast.core.config.FeastProperties;
import feast.core.model.Project;
import feast.core.service.ProjectService;
import feast.core.service.SpecService;
import feast.proto.core.CoreServiceProto.GetFeastCoreVersionResponse;
import feast.proto.core.CoreServiceProto.ListEntitiesRequest;
import feast.proto.core.CoreServiceProto.ListEntitiesResponse;
import feast.proto.core.CoreServiceProto.ListFeatureSetsRequest;
import feast.proto.core.CoreServiceProto.ListFeatureSetsResponse;
import feast.proto.core.CoreServiceProto.ListFeatureTablesRequest;
import feast.proto.core.CoreServiceProto.ListFeatureTablesResponse;
import feast.proto.core.CoreServiceProto.ListFeaturesRequest;
import feast.proto.core.CoreServiceProto.ListFeaturesResponse;
import feast.proto.core.CoreServiceProto.ListProjectsResponse;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
Expand Down Expand Up @@ -74,42 +66,21 @@ public CoreServiceRestController(
*
* @return (200 OK) Returns {@link GetFeastCoreVersionResponse} in JSON.
*/
@RequestMapping(value = "/v1/version", method = RequestMethod.GET)
@RequestMapping(value = "/v2/version", method = RequestMethod.GET)
public GetFeastCoreVersionResponse getVersion() {
GetFeastCoreVersionResponse response =
GetFeastCoreVersionResponse.newBuilder().setVersion(feastProperties.getVersion()).build();
return response;
}

/**
* GET /feature-sets : Retrieve a list of Feature Sets according to filtering parameters of Feast
* project name and feature set name. If none matches, an empty JSON response is returned.
*
* @param project Request Parameter: Name of feast project to search in. If set to <code>"*"
* </code>, all existing projects will be filtered. However, asterisk can NOT be
* combined with other strings (for example <code>"merchant_*"</code>) to use as wildcard to
* filter feature sets.
* @param name Request Parameter: Feature set name. If set to "*", filter * all feature sets by
* default. Asterisk can be used as wildcard to filter * feature sets.
* @return (200 OK) Return {@link ListFeatureSetsResponse} in JSON.
*/
@RequestMapping(value = "/v1/feature-sets", method = RequestMethod.GET)
public ListFeatureSetsResponse listFeatureSets(
@RequestParam(defaultValue = Project.DEFAULT_NAME) String project, @RequestParam String name)
throws InvalidProtocolBufferException {
ListFeatureSetsRequest.Filter.Builder filterBuilder =
ListFeatureSetsRequest.Filter.newBuilder().setProject(project).setFeatureSetName(name);
return specService.listFeatureSets(filterBuilder.build());
}

/**
* GET /features : List Features based on project and entities.
*
* @param entities Request Parameter: List of all entities every returned feature should belong
* to. At least one entity is required. For example, if <code>entity1</code> and <code>entity2
* </code> are given, then all features returned (if any) will belong to BOTH
* entities.
* @param project (Optional) Request Parameter: A single project where the feature set of all
* @param project (Optional) Request Parameter: A single project where the feature table of all
* features returned is under. If not provided, the default project will be used, usually
* <code>default</code>.
* @return (200 OK) Return {@link ListFeaturesResponse} in JSON.
Expand All @@ -128,7 +99,7 @@ public ListFeaturesResponse listFeatures(
*
* @return (200 OK) Returns {@link ListProjectsResponse} in JSON.
*/
@RequestMapping(value = "/v1/projects", method = RequestMethod.GET)
@RequestMapping(value = "/v2/projects", method = RequestMethod.GET)
public ListProjectsResponse listProjects() {
List<Project> projects = projectService.listProjects();
return ListProjectsResponse.newBuilder()
Expand Down Expand Up @@ -165,11 +136,4 @@ public ListFeatureTablesResponse listFeatureTables(
ListFeatureTablesRequest.Filter.newBuilder().setProject(project);
return specService.listFeatureTables(filterBuilder.build());
}

private Timestamp utcTimeStringToTimestamp(String utcTimeString) {
long epochSecond =
LocalDate.parse(utcTimeString, DateTimeFormatter.ISO_DATE)
.toEpochSecond(LocalTime.MIN, ZoneOffset.UTC);
return Timestamp.newBuilder().setSeconds(epochSecond).setNanos(0).build();
}
}
Loading

0 comments on commit 6583d72

Please sign in to comment.