----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/69707/#review211944 -----------------------------------------------------------
intg/src/main/java/org/apache/atlas/model/instance/BulkHeadersResponse.java Lines 40 (patched) <https://reviews.apache.org/r/69707/#comment297512> Please review if BulkHeadersResponse class is necessary; perhaps the return value can simply be Map<String, AtlasEntityHeader>? The interpretation of 'fromTimestamp' and 'toTimestamp' attributes here is not clear; also, more criterion can be added in the REST API, and we can avoid having to update BulkHeadersResponse to be in sync. repository/src/main/java/org/apache/atlas/repository/audit/BulkEntityRetrieveAndUpdate.java Lines 82 (patched) <https://reviews.apache.org/r/69707/#comment297513> Consider replacing this method with the following: Map<String, AtlasEntityHeader> ret = new HashMap(); Set<String> guids = auditRepository.getEntitiesWithTagChanges(fromTimestamp, toTimestamp); for (String guid : guids) { AtlasEntityHeader header = entityRetriever.toAtlasEntityHeaderWithClassifications(entityId); ret.put(guid, header); } return ret; repository/src/main/java/org/apache/atlas/repository/audit/BulkEntityRetrieveAndUpdate.java Lines 142 (patched) <https://reviews.apache.org/r/69707/#comment297506> 'Updater' class is not related to 'audit' module; hence consider moving this to EntityStore, with the following signature: - setClassifications(Map<String, AtlasEntityHeader> entities) repository/src/main/java/org/apache/atlas/repository/audit/EntityAuditRepository.java Lines 87 (patched) <https://reviews.apache.org/r/69707/#comment297511> Instead of returning List<EntityAuditEventV2>, returning Set<String> i.e. guids might be more efficient; contents of EntityAuditEventV2 is not useful for the current use of this method. Please reveiew. webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java Lines 729 (patched) <https://reviews.apache.org/r/69707/#comment297507> timeRange => tagUpdateTimeRange getEntitiesWithModifiedClassifications() ==> getEntityHeaders() webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java Lines 751 (patched) <https://reviews.apache.org/r/69707/#comment297509> Following private methods don't seem to be used; please review and remove: - getClassificationName() - #751 - incrementToTimestamp() - #755 - getEntityById() - #777 - getClassification() - #786 webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java Lines 760 (patched) <https://reviews.apache.org/r/69707/#comment297508> "bulk/headers" ==> "bulk/setClassifications" webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java Lines 763 (patched) <https://reviews.apache.org/r/69707/#comment297510> updateEntitiesWithModifiedClassifications() ==> setClassifications() - Madhan Neethiraj On Jan. 14, 2019, 5:23 a.m., Ashutosh Mestry wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/69707/ > ----------------------------------------------------------- > > (Updated Jan. 14, 2019, 5:23 a.m.) > > > Review request for atlas, Madhan Neethiraj, Nikhil Bonte, Nixon Rodrigues, > and Sarath Subramanian. > > > Bugs: ATLAS-3029 > https://issues.apache.org/jira/browse/ATLAS-3029 > > > Repository: atlas > > > Description > ------- > > **Approach** > - Scan HBase 'ATLAS_ENTITY_AUDIT_EVENTS' table with approprite paramters. > - Package the output into _AtlasEntityHeader_. > - Provide _REST APIs_ to _EntityREST_. > > **CURL** > > _Fetch_ > curl -X GET -u admin:passWord -H 'Content-Type: application/json' > > 'http://localhost:21000/api/atlas/v2/entity/audit/classifications?timeRange=1546992000000:1547157600000' > \ > > _Udpate_ > curl -X POST -u admin:passWord -H 'Content-Type: application/json' > 'http://localhost:21000/api/atlas/v2/entity/audit/classifications' > -d @fetched-classifications.json > > > **Not supported** > - Cassandra based Audits. > - For testing: In-memory audits. > > > Diffs > ----- > > client/client-v2/src/main/java/org/apache/atlas/AtlasClientV2.java > 7c8caee89 > intg/src/main/java/org/apache/atlas/model/instance/BulkHeadersResponse.java > PRE-CREATION > > repository/src/main/java/org/apache/atlas/repository/audit/BulkEntityRetrieveAndUpdate.java > PRE-CREATION > > repository/src/main/java/org/apache/atlas/repository/audit/CassandraBasedAuditRepository.java > eb78f8f70 > > repository/src/main/java/org/apache/atlas/repository/audit/EntityAuditRepository.java > aab2d5b6c > > repository/src/main/java/org/apache/atlas/repository/audit/HBaseBasedAuditRepository.java > 6f4415fa8 > > repository/src/main/java/org/apache/atlas/repository/audit/InMemoryEntityAuditRepository.java > dca3b853e > > repository/src/main/java/org/apache/atlas/repository/audit/NoopEntityAuditRepository.java > e3a607809 > > repository/src/test/java/org/apache/atlas/repository/audit/BulkEntityRetrieveAndUpdateTest.java > PRE-CREATION > repository/src/test/resources/json/audit-event-1.json PRE-CREATION > repository/src/test/resources/json/audit-event-2.json PRE-CREATION > repository/src/test/resources/json/entity-headers.json PRE-CREATION > webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java 68c132c37 > > > Diff: https://reviews.apache.org/r/69707/diff/2/ > > > Testing > ------- > > **Unit tests** > New tests added. > > **Functional tests** > Via CURL calls. > > **Volume tests** > Loads of over 2000 entities. > > > File Attachments > ---------------- > > entity-headers.json > > https://reviews.apache.org/media/uploaded/files/2019/01/14/a23bead7-6990-4d5b-b3b8-f46f990f5d99__entity-headers.json > > > Thanks, > > Ashutosh Mestry > >
