Package it.unimi.dsi.fastutil.longs

Examples of it.unimi.dsi.fastutil.longs.LongIterator


        long fpOnlyAdds = 0;
        Long currFp = null;
        PendingItem currPend = null;
       
        Iterator<PendingItem> pendIter = pendingSet.iterator();
        LongIterator fpIter = beginFpMerge();

        currPend = (PendingItem) (pendIter.hasNext() ? pendIter.next() : null);
        currFp = (Long) (fpIter.hasNext() ? fpIter.next() : null);

        while(true) {
            while(currFp!=null && (currPend==null||(currFp.longValue() <= currPend.fp))) {
                addNewFp(currFp.longValue());
                if(currPend!=null && currFp.longValue() == currPend.fp) {
                    mergeDuplicateCount++;
                }
                if(fpIter.hasNext()) {
                    currFp = (Long) fpIter.next();
                } else {
                    currFp = null;
                    break;
                }
            }
View Full Code Here


    @Override
    public DictionaryPage createDictionaryPage() {
      if (lastUsedDictionarySize > 0) {
        // return a dictionary only if we actually used it
        PlainValuesWriter dictionaryEncoder = new PlainValuesWriter(lastUsedDictionaryByteSize);
        LongIterator longIterator = longDictionaryContent.keySet().iterator();
        // write only the part of the dict that we used
        for (int i = 0; i < lastUsedDictionarySize; i++) {
          dictionaryEncoder.writeLong(longIterator.nextLong());
        }
        return new DictionaryPage(dictionaryEncoder.getBytes(), lastUsedDictionarySize, PLAIN_DICTIONARY);
      }
      return plainValuesWriter.createDictionaryPage();
    }
View Full Code Here

  public Iterable<LongWritable> getPartitionDestinationVertices(
      int partitionId) {
    Long2DoubleOpenHashMap partitionMap = map.get(partitionId);
    List<LongWritable> vertices =
        Lists.newArrayListWithCapacity(partitionMap.size());
    LongIterator iterator = partitionMap.keySet().iterator();
    while (iterator.hasNext()) {
      vertices.add(new LongWritable(iterator.nextLong()));
    }
    return vertices;
  }
View Full Code Here

  }

  @Override
  public void write(DataOutput out) throws IOException {
    out.writeInt(neighbors.size());
    LongIterator neighborsIt = neighbors.iterator();
    DoubleIterator edgeValuesIt = edgeValues.iterator();
    while (neighborsIt.hasNext()) {
      out.writeLong(neighborsIt.nextLong());
      out.writeDouble(edgeValuesIt.nextDouble());
    }
  }
View Full Code Here

    }

    @Override
    public void write(DataOutput out) throws IOException {
      out.writeInt(set.size());
      LongIterator iter = set.iterator();
      while (iter.hasNext()) {
        out.writeLong(iter.nextLong());
      }
    }
View Full Code Here

  }

  @Override
  public void write(DataOutput out) throws IOException {
    out.writeInt(neighbors.size());
    LongIterator neighborsIt = neighbors.iterator();
    while (neighborsIt.hasNext()) {
      out.writeLong(neighborsIt.nextLong());
    }
  }
View Full Code Here

  }

  @Override
  public void write(DataOutput out) throws IOException {
    out.writeInt(neighbors.size());
    LongIterator neighborsIt = neighbors.iterator();
    while (neighborsIt.hasNext()) {
      out.writeLong(neighborsIt.nextLong());
    }
  }
View Full Code Here

      int partitionId) {
    Long2ObjectOpenHashMap<T> partitionMap =
        map.get(partitionId);
    List<LongWritable> vertices =
        Lists.newArrayListWithCapacity(partitionMap.size());
    LongIterator iterator = partitionMap.keySet().iterator();
    while (iterator.hasNext()) {
      vertices.add(new LongWritable(iterator.nextLong()));
    }
    return vertices;
  }
View Full Code Here

        ZoieSegmentReader<?> zoieReader = (ZoieSegmentReader<?>)(reader.getInnerReader());
        DocIDMapper<?> docidMapper = zoieReader.getDocIDMaper();
       
        final IntArrayList docidList = new IntArrayList(valSet.size());
       
        LongIterator iter = valSet.iterator();
       
        while(iter.hasNext()){
          int docid = docidMapper.getDocID(iter.nextLong());
          if (docid!=DocIDMapper.NOT_FOUND){
            docidList.add(docid);
          }
        }
       
View Full Code Here

    logger.info("Starting the purgeUnusedActivitiesJob");
    long[] keys;
    try {
      compositeActivityValues.globalLock.readLock().lock();
      keys = new long[compositeActivityValues.uidToArrayIndex.size()];
      LongIterator iterator = compositeActivityValues.uidToArrayIndex.keySet().iterator();
      int i = 0;
      while (iterator.hasNext()) {
        keys[i++] = iterator.nextLong();
      }
    }  finally {
        compositeActivityValues.globalLock.readLock().unlock();
    }    
    int bitSetLength = keys.length;
View Full Code Here

TOP

Related Classes of it.unimi.dsi.fastutil.longs.LongIterator

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.