----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/71689/#review218425 -----------------------------------------------------------
repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasEntityStore.java Lines 241 (patched) <https://reviews.apache.org/r/71689/#comment306133> To delete all labels associated with an entity, callers can use setLabels(guid, null); a separate method, deleteLabels(), doesn't add much value. However, it will be useful if this method can take specific labels to remove: void deleteLabels(String guid, Set<String> labels); repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java Lines 810 (patched) <https://reviews.apache.org/r/71689/#comment306135> validate the labels here, with a call to: validateLabels(labels); repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java Lines 346 (patched) <https://reviews.apache.org/r/71689/#comment306134> Consider avoiding updates to 'labels' parameter. Instead: public void addLabels(AtlasVertex vertex, Set<String> labels) { if (CollectionUtils.isNotEmpty(labels)) { final List<String> existingLabels = AtlasGraphUtilsV2.getLabels(vertex); final List<String> updatedLabels; if (CollectionUtils.isEmpty(existingLabels)) { updatedLabels = labels; } else { updatedLabels = existingLabels; updatedLabels.addAll(labels); } this.setLabels(vertex, updatedLabels); } } - Madhan Neethiraj On Oct. 28, 2019, 5:41 p.m., Le Ma wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/71689/ > ----------------------------------------------------------- > > (Updated Oct. 28, 2019, 5:41 p.m.) > > > Review request for atlas, Ashutosh Mestry, Aadarsh Jajodia, Sridhar K, Madhan > Neethiraj, and Sarath Subramanian. > > > Bugs: ATLAS-3483 > https://issues.apache.org/jira/browse/ATLAS-3483 > > > Repository: atlas > > > Description > ------- > > The current implementation of label only exposes setLabel endpoint to users. > setLabel will replace the existing labels with labels passed in with > function. It would be nice to have the enhancement to support add labels to > existing label and, delete label. > > > Diffs > ----- > > > repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasEntityStore.java > a986520a9 > > repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java > 17b4a5b9d > > repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasGraphUtilsV2.java > f07cff1a8 > > repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java > 19d4cef3d > > repository/src/test/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2Test.java > d95c12762 > webapp/src/main/java/org/apache/atlas/web/rest/EntityREST.java e5f7d3339 > > > Diff: https://reviews.apache.org/r/71689/diff/1/ > > > Testing > ------- > > - Added tests, passed. > - will run pre-commit job. > > > Thanks, > > Le Ma > >