Examples of MutableLong


Examples of com.lmax.disruptor.util.MutableLong

    }

    @Override
    protected long runDisruptorPass() throws InterruptedException
    {
        MutableLong value = this.value;

        final CountDownLatch latch = new CountDownLatch(1);
        long expectedCount = ringBuffer.getMinimumGatingSequence() + ITERATIONS;

        handler.reset(latch, expectedCount);
        long start = System.currentTimeMillis();

        final RingBuffer<ValueEvent> rb = ringBuffer;

        for (long l = 0; l < ITERATIONS; l++)
        {
            value.set(l);
            rb.publishEvent(Translator.INSTANCE, value);
        }

        latch.await();
        long opsPerSecond = (ITERATIONS * 1000L) / (System.currentTimeMillis() - start);
View Full Code Here

Examples of de.sciss.util.MutableLong

    this.fs        = fs;
    this.fileSpans    = fileSpans;
    this.maxFileSpans  = maxFileSpans;
    if( framesWritten == null ) {
      this.framesWritten = new MutableLong[ fs.length ];
      for( int i = 0; i < fs.length; i++ ) this.framesWritten[ i ] = new MutableLong( 0L );
    } else {
      this.framesWritten  = framesWritten;
    }
    this.biasedSpans  = biasedSpans;
    this.decimations  = decimations;
View Full Code Here

Examples of de.sciss.util.MutableLong

    this.fs        = fs;
    this.fileSpans    = fileSpans;
    this.maxFileSpans  = maxFileSpans;
    if( framesWritten == null ) {
      this.framesWritten = new MutableLong[ fs.length ];
      for( int i = 0; i < fs.length; i++ ) this.framesWritten[ i ] = new MutableLong( 0L );
    } else {
      this.framesWritten  = framesWritten;
    }
    this.biasedSpans  = biasedSpans;
    this.decimations  = decimations;
View Full Code Here

Examples of jodd.mutable.MutableLong

   * Returns next ID for given entity type.
   * On the first call, it finds the max value of all IDs and stores it.
   * On later calls, stored id is incremented and returned.
   */
  public synchronized long nextId(Class entityType) {
    MutableLong lastId = entityIdsMap.get(entityType);
    if (lastId == null) {
      DbOomManager dbOomManager = DbOomManager.getInstance();

      DbEntityDescriptor ded = dbOomManager.lookupType(entityType);
      String tableName = ded.getTableName();
      String idColumn = ded.getIdColumnName();

      DbOomQuery dbOomQuery = query("select max(" + idColumn + ") from " + tableName);

      long lastLong = dbOomQuery.autoClose().executeCount();

      if (log.isDebugEnabled()) {
        log.debug("Last id for " + entityType.getName() + " is " + lastLong);
      }

      lastId = new MutableLong(lastLong);

      entityIdsMap.put(entityType, lastId);
    }

    lastId.value++;
View Full Code Here

Examples of org.apache.commons.lang.mutable.MutableLong

    public void addValue(T val) {
        addValue(val,1);
    }

    private void updateValueCount(T actualValue, int sampleCount) {
        MutableLong count = valuesMap.get(actualValue);
        if (count != null) {
            count.add(sampleCount);
        } else {
            // insert new value
            valuesMap.put(actualValue, new MutableLong(sampleCount));
        }
    }
View Full Code Here

Examples of org.apache.commons.lang.mutable.MutableLong

    // int count = 0;
    while (transactions.hasNext()) {
      Pair<List<A>,Long> transaction = transactions.next();
      for (A attribute : transaction.getFirst()) {
        if (attributeSupport.containsKey(attribute) == false) {
          attributeSupport.put(attribute, new MutableLong(transaction
            .getSecond()));
        } else {
          attributeSupport.get(attribute).add(
            transaction.getSecond().longValue());
          // count++;
View Full Code Here

Examples of org.apache.commons.lang.mutable.MutableLong

      int attribute = tree.getAttributeAtIndex(i);
      if (requiredFeatures.contains(attribute) == false) {
        continue;
      }
      log.info("Mining FTree Tree for all patterns with {}", attribute);
      MutableLong minSupport = new MutableLong(minSupportValue);
      FrequentPatternMaxHeap frequentPatterns = growth(tree, minSupport, k,
        treeCache, 0, attribute, updater);
      patterns.put(attribute, frequentPatterns);
      outputCollector.collect(attribute, frequentPatterns);
     
      minSupportValue = Math.max(minSupportValue, minSupport.longValue() / 2);
      log.info("Found {} Patterns with Least Support {}", patterns.get(
        attribute).count(), patterns.get(attribute).leastSupport());
    }
    log.info("Tree Cache: First Level: Cache hits={} Cache Misses={}",
      treeCache.getHits(), treeCache.getMisses());
View Full Code Here

Examples of org.apache.commons.lang.mutable.MutableLong

    for (int i = 0; i < featureSetSize; i++) {
      tree.addHeaderCount(i, attributeFrequency[i]);
    }
   
    // Constructing initial FPTree from the list of transactions
    MutableLong minSupportMutable = new MutableLong(minSupport);
    int nodecount = 0;
    // int attribcount = 0;
    int i = 0;
    while (transactions.hasNext()) {
      Pair<int[],Long> transaction = transactions.next();
View Full Code Here

Examples of org.apache.commons.lang.mutable.MutableLong

  }
 
  @Override
  public void incrCounter(Enum<?> key, long amount) {
    if (count1.containsKey(key) == false) {
      count1.put(key, new MutableLong(0));
    }
    count1.get(key).add(amount);
  }
View Full Code Here

Examples of org.apache.commons.lang.mutable.MutableLong

      Pair<List<Integer>,Long> p = it.next();
      items += p.getFirst().size();
      count++;
      for (Integer i : p.getFirst()) {
        if (frequencyList.containsKey(i) == false) {
          frequencyList.put(i, new MutableLong(0));
        }
        frequencyList.get(i).add(p.getSecond());
      }
    }
    return frequencyList;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.