Skip to content

Commit

Permalink
wip: group endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
valasatava committed Nov 6, 2024
1 parent 1649029 commit 9fa8af9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
import com.google.common.collect.Multimap;
import org.rcsb.idmapper.input.Input;

import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;

/**
Expand Down Expand Up @@ -49,7 +46,7 @@ public Collection<String> getMemberToGroup(Input.AggregationMethod method, Integ
if (cutoff != null)
return similarity.get(method).get(cutoff).get(mId);
else
return identity.get(method).get(mId);
return identity.get(method).asMap().getOrDefault(mId, new ArrayList<>());
}

public Long countGroups(Input.AggregationMethod method) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public Flux<Runnable> findDocuments(final MongoDatabase db) {
return Flux.from(publisher)
.doOnSubscribe(s -> logger.info("Subscribed document task to collection [ {} ]", collectionName))
//TODO replace with async debug or remove entirely before prod
//.doOnNext(d -> logger.info("Processing document from [ {} ]", collectionName))
// .doOnNext(d -> logger.info("Processing document from [ {} ]", collectionName))
.doOnError(t -> logger.error(t.getMessage()))
.doOnComplete(() -> logger.info("Processed documents from [ {} ] collection ", collectionName))
.map(this::createDocumentRunnable);
Expand Down

0 comments on commit 9fa8af9

Please sign in to comment.