Package org.apache.mahout.cf.taste.common

Examples of org.apache.mahout.cf.taste.common.TasteException


        doPartialUpdate(updateDiffSQLs[0], itemID, prefDelta, conn);
        doPartialUpdate(updateDiffSQLs[1], itemID, prefDelta, conn);
      }
    } catch (SQLException sqle) {
      log.warn("Exception while updating item diff", sqle);
      throw new TasteException(sqle);
    } finally {
      IOUtils.quietClose(conn);
    }
  }
View Full Code Here


        items.add(dataModel.getItem(rs.getObject(1), true));
      }
      return items;
    } catch (SQLException sqle) {
      log.warn("Exception while retrieving recommendable items", sqle);
      throw new TasteException(sqle);
    } finally {
      IOUtils.quietClose(rs, stmt, conn);
    }
  }
View Full Code Here

      } finally {
        IOUtils.quietClose(stmt);
      }
    } catch (SQLException sqle) {
      log.warn("Exception while updating/deleting diffs", sqle);
      throw new TasteException(sqle);
    } finally {
      IOUtils.quietClose(conn);
    }
  }
View Full Code Here

      rs = stmt.executeQuery();
      rs.next();
      return rs.getInt(1) > 0;
    } catch (SQLException sqle) {
      log.warn("Exception while deleting diffs", sqle);
      throw new TasteException(sqle);
    } finally {
      IOUtils.quietClose(rs, stmt, conn);
    }
  }
View Full Code Here

      log.debug("Executing SQL update: {}", removePreferenceSQL);
      stmt.executeUpdate();

    } catch (SQLException sqle) {
      log.warn("Exception while removing preference", sqle);
      throw new TasteException(sqle);
    } finally {
      IOUtils.quietClose(null, stmt, conn);
    }
  }
View Full Code Here

      log.debug("Executing SQL update: {}", setPreferenceSQL);
      stmt.executeUpdate();
     
    } catch (SQLException sqle) {
      log.warn("Exception while setting preference", sqle);
      throw new TasteException(sqle);
    } finally {
      IOUtils.quietClose(null, stmt, conn);
    }
  }
View Full Code Here

 
  private static Properties getPropertiesFromFile(File file) throws TasteException {
    try {
      return getPropertiesFromStream(new FileInputStream(file));
    } catch (FileNotFoundException fnfe) {
      throw new TasteException(fnfe);
    }
  }
View Full Code Here

    // Change this to whatever you like!
    ItemSimilarity similarity;
    try {
      similarity = new HybridSimilarity(dataModel, dataFileDirectory);
    } catch (IOException ioe) {
      throw new TasteException(ioe);
    }
    recommender = new GenericBooleanPrefItemBasedRecommender(dataModel, similarity);
  }
View Full Code Here

        return props;
      } finally {
        Closeables.close(is, true);
      }
    } catch (IOException ioe) {
      throw new TasteException(ioe);
    }
  }
View Full Code Here

      log.debug("Executing SQL update: {}", getUpdatePreferenceSQL());
      stmt2.executeUpdate();

    } catch (SQLException sqle) {
      log.warn("Exception while setting preference", sqle);
      throw new TasteException(sqle);
    } finally {
      IOUtils.quietClose(null, stmt1, null);
      IOUtils.quietClose(null, stmt2, null);
      IOUtils.quietClose(null, null, conn);
    }
View Full Code Here

TOP

Related Classes of org.apache.mahout.cf.taste.common.TasteException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.