-
Notifications
You must be signed in to change notification settings - Fork 141
StorageProxyFactory Abstraction
The StorageProxyFactory is used to abstract out implementation that is storage-engine-specific. Ideally, the code would not need to know which storage engine the user wants to use. Instead, it would make calls to the StorageProxyFactory that would return the appropriate parameters and implementation based on the storage engine specified in the config file (look here for more on the config file).
All files for the StorageProxyFactory Abstraction are located in the storage directory. NOTE: Elasticsearch counterparts are coming in a future pull request.
StorageProxyFactory.scala StorageProxy.scala solr/ SolrProxy.scala elasticsearch/ ElasticsearchProxy.scala
From bottom-up, each storage engine has a *Proxy.scala (ex: SolrProxy.scala). This proxy serves as a wrapper for the actual storage engine instance. Each of these proxies extend StorageProxy.scala which is a parent abstract class. We then return this StorageProxy in StorageProxyFactory.scala. This factory selects the appropriate proxy to return by consulting the config file for the storage engine in use.
The team will be expanding on this factory pattern abstraction in the coming weeks/months. This will likely include more abstraction for other storage-related code as well as the introduction of Elasticsearch-specific code.