-
Notifications
You must be signed in to change notification settings - Fork 505
METRON-2176 Upgrade REST for HBase 2.0.2 #1457
METRON-2176 Upgrade REST for HBase 2.0.2 #1457
Conversation
| boolean success = false; | ||
| try { | ||
| userSettingsClient.delete(user, ALERT_USER_SETTING_TYPE); | ||
| if(userSettingsClient.findOne(user, ALERT_USER_SETTING_TYPE).isPresent()) { |
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.
This was needed to maintain the behavior of returning false if you attempt to delete settings that don't exist. When issuing the delete you don't get any indication of whether something was deleted or not.
| expected.setTableColumns(Collections.singletonList("user1_field")); | ||
|
|
||
| // save a profile for current user | ||
| userSettingsClient.save(user1, ALERT_USER_SETTING_TYPE, toJSON(expected)); |
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.
Being able to use a real HBaseSettingsClient instead of a mock made these tests much easier to grok and maintain in my opinion. Previously we had to use a lot of mockito-magic to test this.
|
I ran through the test instructions and everything works as expected. I also tested the admin user settings endpoints and those also work as expected. After seeing the |
|
Thanks for the review. This has been merged into |
…pache#1457" This reverts commit 87e2a4d.
This change updates the REST service to work with HBase 2.0.2
feature/METRON-2088-support-HDP-3.1feature branch.Changes
UserSettingsClientto use theHBaseClientabstraction.HBaseClientin METRON-2175 Introduce HBase Connection Abstractions for HBase 2.0.2 #1456.IndexDaoextendCloseableso that when the DAOs are instantiated via Spring, there is a way to clean-up resources, like HBase connections.HBaseDaoand related tests to work with HBase 2.0.2.FakeHBaseClientwhich makes testing anything that interacts with HBase, likeHBaseSettingsClientpossible.Acceptance Testing
This should not impact the deployment and functioning of the system. As a sanity check, spin-up Full Dev and ensure alerts are visible.
In addition, you can follow these steps to save and retrieve a user setting.
Go to the Swagger UI.
Retrieve the current user's settings using
GET /api/v1/alerts/ui/settings. This should return 404 initially indicating there are no settings for the current user.Save a user setting. Pass the following as the
alertsUIUserSettingsbody toPOST /api/v1/alerts/ui/settings.Retrieve the setting again using
GET /api/v1/alerts/ui/settings. This should return 200 with the following response bodyPull Request Checklist