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

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


    } catch (IOException e) {
      throw new TasteException("Failed to retrieve user preferences from HBase", e);
    }

    if (result.isEmpty()) {
      throw new NoSuchUserException(userID);
    }

    if (result.containsColumn(ITEMS_CF, Bytes.toBytes(itemID))) {
      KeyValue kv = result.getColumnLatest(ITEMS_CF, Bytes.toBytes(itemID));
      return kv.getTimestamp();
View Full Code Here


 
  @Override
  public PreferenceArray getPreferencesFromUser(long userID) throws TasteException {
    if (userID == TEMP_USER_ID) {
      if (tempPrefs == null) {
        throw new NoSuchUserException(TEMP_USER_ID);
      }
      return tempPrefs;
    }
    return delegate.getPreferencesFromUser(userID);
  }
View Full Code Here

 
  @Override
  public FastIDSet getItemIDsFromUser(long userID) throws TasteException {
    if (userID == TEMP_USER_ID) {
      if (tempPrefs == null) {
        throw new NoSuchUserException(TEMP_USER_ID);
      }
      return prefItemIDs;
    }
    return delegate.getItemIDsFromUser(userID);
  }
View Full Code Here

 
  @Override
  public Float getPreferenceValue(long userID, long itemID) throws TasteException {
    if (userID == TEMP_USER_ID) {
      if (tempPrefs == null) {
        throw new NoSuchUserException(TEMP_USER_ID);
      }
      for (int i = 0; i < tempPrefs.length(); i++) {
        if (tempPrefs.getItemID(i) == itemID) {
          return tempPrefs.getValue(i);
        }
View Full Code Here

  @Override
  public Long getPreferenceTime(long userID, long itemID) throws TasteException {
    if (userID == TEMP_USER_ID) {
      if (tempPrefs == null) {
        throw new NoSuchUserException(TEMP_USER_ID);
      }
      return null;
    }
    return delegate.getPreferenceTime(userID, itemID);
  }
View Full Code Here

 
  @Override
  public void setPreference(long userID, long itemID, float value) throws TasteException {
    if (userID == TEMP_USER_ID) {
      if (tempPrefs == null) {
        throw new NoSuchUserException(TEMP_USER_ID);
      }
      throw new UnsupportedOperationException();
    }
    delegate.setPreference(userID, itemID, value);
  }
View Full Code Here

 
  @Override
  public void removePreference(long userID, long itemID) throws TasteException {
    if (userID == TEMP_USER_ID) {
      if (tempPrefs == null) {
        throw new NoSuchUserException(TEMP_USER_ID);
      }
      throw new UnsupportedOperationException();
    }
    delegate.removePreference(userID, itemID);
  }
View Full Code Here

   */
  @Override
  public PreferenceArray getPreferencesFromUser(long userID) throws NoSuchUserException {
    FastIDSet itemIDs = preferenceFromUsers.get(userID);
    if (itemIDs == null) {
      throw new NoSuchUserException(userID);
    }
    PreferenceArray prefArray = new BooleanUserPreferenceArray(itemIDs.size());
    int i = 0;
    LongPrimitiveIterator it = itemIDs.iterator();
    while (it.hasNext()) {
View Full Code Here

 
  @Override
  public FastIDSet getItemIDsFromUser(long userID) throws TasteException {
    FastIDSet itemIDs = preferenceFromUsers.get(userID);
    if (itemIDs == null) {
      throw new NoSuchUserException(userID);
    }
    return itemIDs;
  }
View Full Code Here

 
  @Override
  public Float getPreferenceValue(long userID, long itemID) throws NoSuchUserException {
    FastIDSet itemIDs = preferenceFromUsers.get(userID);
    if (itemIDs == null) {
      throw new NoSuchUserException(userID);
    }
    if (itemIDs.contains(itemID)) {
      return 1.0f;
    }
    return null;
View Full Code Here

TOP

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

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.