コード例 #1
0
 private List<String> findIdOfChangedDocs(ChangesResult changes1) {
   List<String> changedDocIds = new ArrayList<String>();
   for (ChangesResult.Row row : changes1.getResults()) {
     changedDocIds.add(row.getId());
   }
   return changedDocIds;
 }
コード例 #2
0
  public Multimap<String, String> openRevisions(int start, int end) {
    Preconditions.checkArgument(start >= 0, "Start position must be greater or equal to zero.");
    Preconditions.checkArgument(end > start, "End position must be greater than start.");
    Preconditions.checkArgument(
        end <= this.size(), "End position must be smaller than changes feed size.");

    Multimap<String, String> openRevisions = HashMultimap.create();
    for (int i = start; i < end; i++) {
      ChangesResult.Row row = this.getResults().get(i);
      List<ChangesResult.Row.Rev> revisions = row.getChanges();
      Set<String> openRevs = new HashSet<String>(revisions.size());
      for (ChangesResult.Row.Rev rev : revisions) {
        openRevs.add(rev.getRev());
      }
      openRevisions.putAll(row.getId(), openRevs);
    }
    return openRevisions;
  }