Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Commit

Permalink
Add extra debug logging for issue OryxProject#304
Browse files Browse the repository at this point in the history
  • Loading branch information
srowen committed Sep 22, 2016
1 parent 6bfa7d9 commit 23ddb32
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ public void compute() {
if (solverUpdating.compareAndSet(false, true)) {
executor.submit(LoggingCallable.log(() -> {
try {
log.info("Computing cached solver");
Solver newYTYSolver = LinearSystemSolver.getSolver(vectorPartitions.getVTV());
if (newYTYSolver != null) {
log.info("Computed new solver {}", solver);
solver.set(newYTYSolver);
}
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
import com.koloboke.collect.set.ObjSet;
import com.koloboke.collect.set.hash.HashObjSets;
import com.koloboke.function.ObjDoubleToDoubleFunction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.cloudera.oryx.api.serving.ServingModel;
import com.cloudera.oryx.app.als.FeatureVectorsPartition;
Expand All @@ -53,6 +55,8 @@
*/
public final class ALSServingModel implements ServingModel {

private static final Logger log = LoggerFactory.getLogger(ALSServingModel.class);

private static final ExecutorService executor = Executors.newFixedThreadPool(
Runtime.getRuntime().availableProcessors(),
new ThreadFactoryBuilder().setDaemon(true).setNameFormat("ALSServingModel-%d").build());
Expand Down Expand Up @@ -358,7 +362,17 @@ void retainRecentAndKnownItems(Collection<String> users, Collection<String> item
try (AutoLock al = knownItemsLock.autoReadLock()) {
knownItems.values().forEach(knownItemsForUser -> {
synchronized (knownItemsForUser) {
knownItemsForUser.removeIf(notKeptOrRecent);
try {
knownItemsForUser.removeIf(notKeptOrRecent);
} catch (ClassCastException cce) {
// TODO remove this temporary debugging catch block!
// see https://github.com/OryxProject/oryx/issues/304
log.warn("Caught unexpected error updating knownItemsForUser", cce);
for (Object o : knownItemsForUser) {
log.info("{} {}", o.getClass(), o);
}
throw cce;
}
}
});
}
Expand Down

0 comments on commit 23ddb32

Please sign in to comment.