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

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


      rs = stmt.executeQuery();
      rs.next();
      return rs.getInt(1);
    } catch (SQLException sqle) {
      log.warn("Exception while retrieving number of {}", name, sqle);
      throw new TasteException(sqle);
    } finally {
      IOUtils.quietClose(rs, 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

      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

        if (!anyResults) {
          close();
        }
      } catch (SQLException sqle) {
        close();
        throw new TasteException(sqle);
      }
    }
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

      throw new IllegalArgumentException("Recommender class name is null");
    }
    try {
      recommender = Class.forName(recommenderClassName).asSubclass(Recommender.class).newInstance();
    } catch (ClassNotFoundException cnfe) {
      throw new TasteException(cnfe);
    } catch (InstantiationException ie) {
      throw new TasteException(ie);
    } catch (IllegalAccessException iae) {
      throw new TasteException(iae);
    }
  }
View Full Code Here

    Context context = null;
    try {
      context = new InitialContext();
      return (DataSource) context.lookup("java:comp/env/" + dataSourceName);
    } catch (NamingException ne) {
      throw new TasteException(ne);
    } finally {
      if (context != null) {
        try {
          context.close();
        } catch (NamingException ne) {
View Full Code Here

      return buildUser(idString, prefs);

    } catch (SQLException sqle) {
      log.warn("Exception while retrieving user", sqle);
      throw new TasteException(sqle);
    } finally {
      IOUtils.quietClose(rs, stmt, conn);
    }

  }
View Full Code Here

      } else {
        throw new NoSuchElementException();
      }
    } catch (SQLException sqle) {
      log.warn("Exception while retrieving item", sqle);
      throw new TasteException(sqle);
    } finally {
      IOUtils.quietClose(rs, stmt, conn);
    }
  }
View Full Code Here

        prefs.add(pref);
      }
      return prefs;
    } catch (SQLException sqle) {
      log.warn("Exception while retrieving prefs for item", sqle);
      throw new TasteException(sqle);
    } finally {
      IOUtils.quietClose(rs, stmt, 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.