Skip to content
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

Closed

Conversation

majetideepak
Copy link
Collaborator

This PR adds a config to the Connector class.
For HiveConnector, we pass the connector config.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 17, 2021
Copy link
Contributor

@mbasmanova mbasmanova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good % nits.

explicit Connector(
const std::string& id,
std::shared_ptr<const Config> properties)
: id_(id), properties_(properties) {}
Copy link
Contributor

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


virtual ~Connector() = default;

const std::string& connectorId() const {
return id_;
}

std::shared_ptr<const Config> connectorProperties() const {
Copy link
Contributor

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

@@ -186,6 +193,7 @@ class Connector {

private:
const std::string id_;
std::shared_ptr<const Config> properties_;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const

@@ -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) {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::move

std::unique_ptr<FileHandle> operator()(const std::string& filename);

private:
std::shared_ptr<const Config> properties_;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const

@majetideepak
Copy link
Collaborator Author

all review comments are addressed. Thanks.

@facebook-github-bot
Copy link
Contributor

@mbasmanova has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

facebook-github-bot pushed a commit that referenced this pull request Sep 21, 2021
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
rui-mo pushed a commit to rui-mo/velox that referenced this pull request Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants