Tabnine Logo
it.unimi.dsi.fastutil.longs
Code IndexAdd Tabnine to your IDE (free)

How to use it.unimi.dsi.fastutil.longs

Best Java code snippets using it.unimi.dsi.fastutil.longs (Showing top 20 results out of 486)

origin: apache/incubator-druid

AllocationMetricCollector(Method method, ThreadMXBean threadMXBean)
{
 this.getThreadAllocatedBytes = method;
 this.threadMXBean = threadMXBean;
 previousResults = new Long2LongOpenHashMap();
 previousResults.defaultReturnValue(NO_DATA);
}
origin: prestodb/presto

private void addHash(long hash)
{
  short value = minhash.get(hash);
  if (value < Short.MAX_VALUE) {
    minhash.put(hash, (short) (value + 1));
  }
  while (minhash.size() > maxHashes) {
    minhash.remove(minhash.lastLongKey());
  }
}
origin: prestodb/presto

@Override
public void swap(int a, int b)
{
  long[] elements = valueAddresses.elements();
  long temp = elements[a];
  elements[a] = elements[b];
  elements[b] = temp;
}
origin: apache/incubator-pinot

private static long[] filterLongs(LongSet longSet, long[] source) {
 LongList longList = new LongArrayList();
 for (long value : source) {
  if (longSet.contains(value)) {
   longList.add(value);
  }
 }
 if (longList.size() == source.length) {
  return source;
 } else {
  return longList.toLongArray();
 }
}
origin: apache/incubator-pinot

public LongToIdMap() {
 _valueToIdMap = new Long2IntOpenHashMap();
 _valueToIdMap.defaultReturnValue(INVALID_KEY);
 _idToValueMap = new LongArrayList();
}
origin: apache/incubator-pinot

@Override
public int put(long value) {
 int id = _valueToIdMap.get(value);
 if (id == INVALID_KEY) {
  id = _idToValueMap.size();
  _valueToIdMap.put(value, id);
  _idToValueMap.add(value);
 }
 return id;
}
origin: ben-manes/caffeine

private LongList getTimers(Node<?, ?> sentinel) {
 LongList timers = new LongArrayList();
 for (Node<?, ?> node = sentinel.getNextInVariableOrder();
   node != sentinel; node = node.getNextInVariableOrder()) {
  timers.add(node.getVariableTime());
 }
 return timers;
}
origin: apache/incubator-druid

@Override
public void open()
{
 tempOut = new LongArrayList();
}
origin: apache/incubator-druid

@Override
public Long2ObjectMap<Aggregator[]> makeDimExtractionAggregateStore()
{
 return new Long2ObjectOpenHashMap<>();
}
origin: prestodb/presto

public void mergeWith(SetDigest other)
{
  hll.mergeWith(other.hll);
  LongBidirectionalIterator iterator = other.minhash.keySet().iterator();
  while (iterator.hasNext()) {
    long key = iterator.nextLong();
    int count = minhash.get(key) + other.minhash.get(key);
    minhash.put(key, Shorts.saturatedCast(count));
  }
  while (minhash.size() > maxHashes) {
    minhash.remove(minhash.lastLongKey());
  }
}
origin: prestodb/presto

public int getPositionCount()
{
  return addresses.size();
}
origin: ben-manes/caffeine

 private void reset() {
  for (Long2IntMap.Entry entry : counts.long2IntEntrySet()) {
   entry.setValue(entry.getIntValue() / 2);
  }
  size = (size / 2);
 }
}
origin: ben-manes/caffeine

/** Removes the node from the table and adds the index to the free list. */
private void removeFromTable(Node node) {
 int last = data.size() - 1;
 table[node.index] = table[last];
 table[node.index].index = node.index;
 table[last] = null;
}
origin: ben-manes/caffeine

@Override
public int frequency(long e) {
 return counts.get(e);
}
origin: prestodb/presto

public static double jaccardIndex(SetDigest a, SetDigest b)
{
  int sizeOfSmallerSet = Math.min(a.minhash.size(), b.minhash.size());
  LongSortedSet minUnion = new LongRBTreeSet(a.minhash.keySet());
  minUnion.addAll(b.minhash.keySet());
  int intersection = 0;
  int i = 0;
  for (long key : minUnion) {
    if (a.minhash.containsKey(key) && b.minhash.containsKey(key)) {
      intersection++;
    }
    i++;
    if (i >= sizeOfSmallerSet) {
      break;
    }
  }
  return intersection / (double) sizeOfSmallerSet;
}
origin: apache/incubator-druid

@Override
public int metaSize()
{
 return 1 + 1 + 1 + Integer.BYTES + (table.size() * Long.BYTES);
}
origin: prestodb/presto

private long toAbsolutePosition(short blockId, int position)
{
  return sumPositions.get(blockId) + position;
}
origin: prestodb/presto

public static boolean in(long longValue, LongOpenCustomHashSet set)
{
  return set.contains(longValue);
}
origin: prestodb/presto

public boolean isExact()
{
  // There's an ambiguity when minhash.size() == maxHashes, since this could either
  // be an exact set with maxHashes elements, or an inexact one. Which is why strict
  // inequality is used here.
  return minhash.size() < maxHashes;
}
origin: apache/incubator-druid

@Override
public Long2ObjectMap<Aggregator[]> makeDimExtractionAggregateStore()
{
 return new Long2ObjectOpenHashMap<>();
}
it.unimi.dsi.fastutil.longs

Most used classes

  • LongArrayList
    A type-specific array-based list; provides some additional methods that use polymorphism to avoid (u
  • LongSet
    A type-specific Set; provides some additional methods that use polymorphism to avoid (un)boxing. Add
  • LongOpenHashSet
    A type-specific hash set with with a fast, small-footprint implementation. Instances of this class
  • Long2ObjectOpenHashMap
    A type-specific hash map with a fast, small-footprint implementation. Instances of this class use a
  • Long2ObjectMap
    A type-specific Map; provides some additional methods that use polymorphism to avoid (un)boxing, and
  • LongList,
  • Long2DoubleOpenHashMap,
  • Long2IntOpenHashMap,
  • Long2DoubleMap,
  • Long2IntMap,
  • Long2ObjectMap$Entry,
  • LongArrays,
  • LongIterators,
  • LongSortedSet,
  • LongCollection,
  • Long2LongOpenHashMap,
  • Long2DoubleMap$Entry,
  • Long2LongMap,
  • Long2ObjectRBTreeMap
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now