-
Notifications
You must be signed in to change notification settings - Fork 479
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
Create metadata db interface #298
Conversation
Review is pending. We do NOT want to pull this in until after the California release. |
@feclare nice work!
It's a big PR and I didn't check everything. If it's fine, I will continue after you fix some of the points I commented. |
@jduranf Thanks for the review:
|
|
@tsconn23 |
recheck |
core/db/mongo/device_profile.go
Outdated
// DeviceResources []models.DeviceObject `bson:"deviceResources"` | ||
// Resources []models.ProfileResource `bson:"resources"` | ||
// Commands []mgo.DBRef `bson:"commands"` // List of commands to Get/Put information for devices associated with this profile | ||
// } |
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.
Why not remove this structure?
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.
Done
return err | ||
} | ||
s := m.session.Copy() | ||
defer s.Close() |
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.
In event.go isn't used m.session.Copy() and the other related stuff.
Which is the best way to get the values? Maybe the criteria should be unified in another PR
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.
LGTM
6ebf641
to
4af6f69
Compare
@feclare Alright, we're getting closer to the time when we want to bring this in. If you don't mind, rebase the branch to get rid of the "out of date" message below. Then I'd like to do one last review. |
Signed-off-by: Federico Claramonte <fede.claramonte@caviumnetworks.com>
Signed-off-by: Federico Claramonte <fede.claramonte@caviumnetworks.com>
Moved the core-data db functions to core/db Signed-off-by: Federico Claramonte <fede.claramonte@caviumnetworks.com>
Signed-off-by: Federico Claramonte <fede.claramonte@caviumnetworks.com>
Also adding tests for metadata db backends (mongo and memory at the moment) Signed-off-by: Federico Claramonte <fede.claramonte@caviumnetworks.com>
Also made some types privates Signed-off-by: Federico Claramonte <fede.claramonte@caviumnetworks.com>
Signed-off-by: Federico Claramonte <fede.claramonte@caviumnetworks.com>
Also made all databases to use this functions when obtaining a timestamp Signed-off-by: Federico Claramonte <fede.claramonte@caviumnetworks.com>
Signed-off-by: Federico Claramonte <fede.claramonte@caviumnetworks.com>
Signed-off-by: Federico Claramonte <fede.claramonte@caviumnetworks.com>
@tsconn23 Done. |
@feclare I've tested this PR using the device-virtual service as well as via running the blackbox tests locally. Everything passes. @tonyespy @SteveOss I also reviewed the latest Go device service SDK to see if it imported any of the refactored database logic directly and it does not, so I don't expect any adverse effects there. I'm going to pull this in. There are a couple of issues I'm going to create and associate to this PR for subsequent work. They're just minor things based on final code review. Nice work! |
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.
LGTM
It also adds:
Fixes #290