/** * Get a map of date when comments were added to each issue * * In the case that sys:comments_added is not set null is inserted into the map. * * @param reponame the name of the repository to mine * @return a Map that maps issue_ids to the date that the comments were downloaded */ public Map<Integer, Date> getIssueCommentsAddedAt(final String reponame) { final Vertex node = getOrCreateRepository(reponame); final HashMap<Integer, Date> map = new HashMap<Integer, Date>(); final GremlinPipeline<Vertex, Vertex> pipe = new GremlinPipeline<Vertex, Vertex>(); pipe.start(node).out(EdgeType.ISSUE); addValuesFromIterable(pipe, map, PropertyName.NUMBER, PropertyName.SYS_COMMENTS_ADDED); log.warn("number of issues: {}", map.size()); return map; }
/** * Return a mapping between pull requests and the date they were augmented * with discussions. * * @param reponame * @return */ public Map<Integer, Date> getPullRequestDiscussionsAddedAt(final String reponame) { Vertex node = getOrCreateRepository(reponame); HashMap<Integer, Date> map = new HashMap<Integer, Date>(); GremlinPipeline<Vertex, Vertex> pipe = new GremlinPipeline<Vertex, Vertex>(); pipe.start(node).out(EdgeType.PULLREQUEST.toString()); addValuesFromIterable(pipe, map, PropertyName.NUMBER, PropertyName.SYS_DISCUSSIONS_ADDED); return map; }
/** * Get a map of date when events were added to each issue * * In the case that sys_events_added is not set null is inserted into the map. * * @param reponame the name of the repository to mine * @return a Map that maps issue_ids to the date that the events were downloaded */ public Map<Integer, Date> getIssueEventsAddedAt(final IRepositoryIdProvider repo) { final Vertex node = getOrCreateRepository(repo.generateId()); final HashMap<Integer, Date> map = new HashMap<Integer, Date>(); GremlinPipeline<Vertex, Vertex> pipe = new GremlinPipeline<Vertex, Vertex>(); pipe.start(node).out(EdgeType.ISSUE.toString()); addValuesFromIterable(pipe, map, PropertyName.NUMBER, PropertyName.SYS_EVENTS_ADDED); return map; }
userList = pipe.start(repo).in(EdgeType.REPOCOLLABORATOR).toList(); log.info("Collaboators: {}", userList.size()); users.addAll(userList); userList = pipe.start(repo).in(EdgeType.REPOWATCHED).toList(); log.info("Watchers: {}", userList.size()); users.addAll(userList); userList = pipe.start(repo).out(EdgeType.ISSUE).in(EdgeType.ISSUEOWNER).dedup().toList(); log.info("Issue owners: {}", userList.size()); users.addAll(userList); userList = pipe.start(repo).out(EdgeType.ISSUE).out(EdgeType.ISSUECOMMENT).in(EdgeType.ISSUECOMMENTOWNER).dedup().toList(); log.info("Issue Comment owners: {}", userList.size()); users.addAll(userList); userList = pipe.start(repo).out(EdgeType.PULLREQUEST).in(EdgeType.PULLREQUESTOWNER).dedup().toList(); log.info("Pull Request owners: {}", userList.size()); users.addAll(userList); userList = pipe.start(repo).out(EdgeType.PULLREQUEST). out(EdgeType.PULLREQUESTDISCUSSION).in(). has(PropertyName.TYPE, VertexType.USER).dedup().toList();