@@ -3,12 +3,6 @@ package feast
33import (
44 "errors"
55 "fmt"
6- // "os"
7- "os/exec"
8- "github.com/hashicorp/go-plugin"
9- // "github.com/hashicorp/go-hclog"
10- "log"
11- "io/ioutil"
126)
137
148func getOnlineStore (config * RepoConfig ) (OnlineStore , error ) {
@@ -20,57 +14,6 @@ func getOnlineStore(config *RepoConfig) (OnlineStore, error) {
2014 onlineStore , err := NewRedisOnlineStore (config .Project , config .OnlineStore )
2115 return onlineStore , err
2216 } else {
23- // TODO(willem): Python connectors here
24- KV_PLUGIN := config .OnlineStore ["KV_PLUGIN" ].(string )
25- return connectorClient (KV_PLUGIN )
17+ return nil , errors .New ("Only Redis is supported as an online store for now" )
2618 }
27- }
28-
29- func connectorClient (KV_PLUGIN string ) (OnlineStore , error ) {
30- // We don't want to see the plugin logs.
31- log .SetOutput (ioutil .Discard )
32-
33- // We're a host. Start by launching the plugin process.
34- cmd := exec .Command ("sh" , "-c" , KV_PLUGIN )
35-
36- // logger := hclog.New(&hclog.LoggerOptions{
37- // Name: "plugin",
38- // Output: os.Stdout,
39- // Level: hclog.Debug,
40- // })
41-
42- client := plugin .NewClient (& plugin.ClientConfig {
43- HandshakeConfig : Handshake ,
44- Plugins : PluginMap ,
45- Cmd : cmd ,
46- AllowedProtocols : []plugin.Protocol {
47- plugin .ProtocolGRPC },
48- // Logger: logger,
49- })
50-
51- // Connect via RPC
52- rpcClient , err := client .Client ()
53- if err != nil {
54- return nil , err
55- }
56- // Request the plugin
57- raw , err := rpcClient .Dispense ("onlinestore_grpc" )
58- if err != nil {
59- return nil , err
60- }
61-
62- // We should have a OnlineStore now! This feels like a normal interface
63- // implementation but is in fact over an RPC connection.
64- if onlineStore , ok := raw .(OnlineStore ); ! ok {
65- return nil , errors .New ("Error creating a Connector OnlineStore" )
66- } else {
67- grpcClient , ok := onlineStore .(* GRPCClient )
68- if ! ok {
69- return nil , errors .New ("Connector is not a *connector.GrpcClient" )
70- }
71- grpcClient .destructor = func () {
72- client .Kill ()
73- }
74- return onlineStore , nil
75- }
76- }
19+ }
0 commit comments