示例#1
0
 private static String setToString(LongFloatMap map) {
   LongPrimitiveIterator it = map.keySetIterator();
   Collection<String> keyStrings = Lists.newArrayListWithCapacity(map.size());
   while (it.hasNext()) {
     keyStrings.add(Long.toString(it.nextLong()));
   }
   return DelimitedDataUtils.encode(',', keyStrings);
 }
示例#2
0
 private static void removeNotUpdated(
     LongPrimitiveIterator it, LongSet updated, LongSet recentlyActive, Lock writeLock) {
   writeLock.lock();
   try {
     while (it.hasNext()) {
       long id = it.nextLong();
       if (!updated.contains(id) && !recentlyActive.contains(id)) {
         it.remove();
       }
     }
   } finally {
     writeLock.unlock();
   }
 }