com.carrotsearch.hppc.LongObjectMap Java Examples

The following examples show how to use com.carrotsearch.hppc.LongObjectMap. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ExpandComponent.java    From lucene-solr with Apache License 2.0 5 votes vote down vote up
@Override
default ScoreMode scoreMode() {
  final LongObjectMap<Collector> groups = getGroups();
  if (groups.isEmpty()) {
    return ScoreMode.COMPLETE; // doesn't matter?
  } else {
    return groups.iterator().next().value.scoreMode(); // we assume all the collectors should have the same nature
  }
}
 
Example #2
Source File: TestByteBuffer.java    From titan1withtp3.1 with Apache License 2.0 5 votes vote down vote up
private static long testByte() {
    LongObjectMap<ConcurrentSkipListSet<ByteEntry>> tx = new LongObjectHashMap<ConcurrentSkipListSet<ByteEntry>>(NUM);
    for (int i = 0; i < NUM; i++) {
        tx.put(i, new ConcurrentSkipListSet<ByteEntry>());
    }
    for (int i = 0; i < NUM; i++) {
        for (int j = 0; j < NUM; j++) {
            if (i == j) continue;
            if (Math.random() < FRACTION) {
                ByteBuffer key = ByteBuffer.allocate(16);
                key.putLong(5).putLong(j).flip();
                ByteBuffer value = ByteBuffer.allocate(4);
                value.putInt(random.nextInt(ROUNDSIZE)).flip();
                tx.get(i).add(new ByteEntry(key, value));
            }
        }
    }
    long time = System.currentTimeMillis();
    long sum = 0;
    for (int t = 0; t < TRIALS; t++) {
        for (int i = 0; i < NUM; i++) {
            for (Vertex v : (new ByteVertex(i, tx)).getNeighbors(0)) {
                sum += v.getId();
            }
        }
    }
    time = System.currentTimeMillis() - time;
    return time;
}
 
Example #3
Source File: ExpandComponent.java    From lucene-solr with Apache License 2.0 4 votes vote down vote up
public LongObjectMap<Collector> getGroups() {
  return groups;
}
 
Example #4
Source File: TestByteBuffer.java    From titan1withtp3.1 with Apache License 2.0 4 votes vote down vote up
ByteVertex(long id, LongObjectMap<ConcurrentSkipListSet<ByteEntry>> tx) {
    super(id);
    this.tx = tx;
    this.set = (SortedSet<ByteEntry>) tx.get(id);
}
 
Example #5
Source File: ExpandComponent.java    From lucene-solr with Apache License 2.0 votes vote down vote up
public LongObjectMap<Collector> getGroups();