@Test public void testWithinRange() { assertTrue(TasteHadoopUtils.idToIndex(0) >= 0); assertTrue(TasteHadoopUtils.idToIndex(0) < Integer.MAX_VALUE); assertTrue(TasteHadoopUtils.idToIndex(1) >= 0); assertTrue(TasteHadoopUtils.idToIndex(1) < Integer.MAX_VALUE); assertTrue(TasteHadoopUtils.idToIndex(Long.MAX_VALUE) >= 0); assertTrue(TasteHadoopUtils.idToIndex(Long.MAX_VALUE) < Integer.MAX_VALUE); assertTrue(TasteHadoopUtils.idToIndex(Integer.MAX_VALUE) >= 0); assertTrue(TasteHadoopUtils.idToIndex(Integer.MAX_VALUE) < Integer.MAX_VALUE); }
public static int idToIndex(long id) { return 0x7FFFFFFF & Longs.hashCode(id) % 0x7FFFFFFE; }
TasteHadoopUtils { public static int idToIndex(long id) { return 0x7FFFFFFF & Longs.hashCode(id) % 0x7FFFFFFE; } }
TasteHadoopUtils { public static int idToIndex(long id) { return 0x7FFFFFFF & Longs.hashCode(id) % 0x7FFFFFFE; } private  TasteHadoopUtils(); }
TasteHadoopUtils { public static int idToIndex(long id) { return 0x7FFFFFFF & Longs.hashCode(id) % 0x7FFFFFFE; } private  TasteHadoopUtils(); static String[] splitPrefTokens(CharSequence line); static int idToIndex(long id); static int readID(String token, boolean usesLongIDs); static OpenIntLongHashMap readIDIndexMap(String idIndexPathStr, Configuration conf); }
TasteHadoopUtils { public static int idToIndex(long id) { return 0x7FFFFFFF & Longs.hashCode(id) % 0x7FFFFFFE; } private  TasteHadoopUtils(); static String[] splitPrefTokens(CharSequence line); static int idToIndex(long id); static int readID(String token, boolean usesLongIDs); static OpenIntLongHashMap readIDIndexMap(String idIndexPathStr, Configuration conf); static final int USER_ID_POS; static final int ITEM_ID_POS; }