-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add properties to Connector #243
Add properties to Connector #243
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good % nits.
velox/connectors/Connector.h
Outdated
explicit Connector( | ||
const std::string& id, | ||
std::shared_ptr<const Config> properties) | ||
: id_(id), properties_(properties) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: std::move to avoid unnecessary increment/decrement of the reference count
velox/connectors/Connector.h
Outdated
|
||
virtual ~Connector() = default; | ||
|
||
const std::string& connectorId() const { | ||
return id_; | ||
} | ||
|
||
std::shared_ptr<const Config> connectorProperties() const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using const & for the return value to avoid unnecessary increment/decrement of the reference count
velox/connectors/Connector.h
Outdated
@@ -186,6 +193,7 @@ class Connector { | |||
|
|||
private: | |||
const std::string id_; | |||
std::shared_ptr<const Config> properties_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
velox/connectors/hive/FileHandle.h
Outdated
@@ -61,7 +62,13 @@ using FileHandleCache = SimpleLRUCache<std::string, FileHandle>; | |||
// Creates FileHandles via the Generator interface the CachedFactory requires. | |||
class FileHandleGenerator { | |||
public: | |||
FileHandleGenerator() {} | |||
FileHandleGenerator(std::shared_ptr<const Config> properties) | |||
: properties_(properties) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::move
velox/connectors/hive/FileHandle.h
Outdated
std::unique_ptr<FileHandle> operator()(const std::string& filename); | ||
|
||
private: | ||
std::shared_ptr<const Config> properties_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
all review comments are addressed. Thanks. |
@mbasmanova has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: This PR adds a config to the Connector class. For HiveConnector, we pass the connector config. Pull Request resolved: #243 Reviewed By: pedroerp Differential Revision: D31054347 Pulled By: mbasmanova fbshipit-source-id: e3fe02599ae7a4128bc480595708a38dfe23e01e
…tor#231)" (facebookincubator#243) This reverts commit 3ca08d7.
This PR adds a config to the Connector class.
For HiveConnector, we pass the connector config.