Package org.apache.commons.lang.mutable

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


    FPTreeDepthCache treeCache = new FPTreeDepthCache();
    for (int i = tree.getHeaderTableCount() - 1; i >= 0; i--) {
      int attribute = tree.getAttributeAtIndex(i);
      if (requiredFeatures.contains(attribute)) {
        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={}",
View Full Code Here


      Pair<List<Integer>,Long> p = it.next();
      //items += p.getFirst().size();
      //count++;
      for (Integer i : p.getFirst()) {
        if (!frequencyList.containsKey(i)) {
          frequencyList.put(i, new MutableLong(0));
        }
        frequencyList.get(i).add(p.getSecond());
      }
    }
    return frequencyList;
View Full Code Here

   
    @SuppressWarnings("unchecked")
    Map<ByteSequence,MutableLong>[] groups = new Map[2];
   
    groups[0] = new HashMap<ByteSequence,MutableLong>();
    groups[0].put(new ArrayByteSequence("cf1"), new MutableLong(1));
    groups[0].put(new ArrayByteSequence("cf2"), new MutableLong(1));
   
    groups[1] = new HashMap<ByteSequence,MutableLong>();
    groups[1].put(new ArrayByteSequence("cf3"), new MutableLong(1));
   
    Partitioner p1 = new Partitioner(groups);
   
    Mutation m1 = new Mutation("r1");
    m1.put("cf1", "cq1", "v1");
View Full Code Here

    TabletClientService.Iface client = null;
   
    TInfo tinfo = Tracer.traceInfo();
   
    Map<Long,CMK> cmidToCm = new HashMap<Long,CMK>();
    MutableLong cmid = new MutableLong(0);
   
    SessionID sessionId = null;
   
    try {       
      Map<TKeyExtent,List<TConditionalMutation>> tmutations = new HashMap<TKeyExtent,List<TConditionalMutation>>();
View Full Code Here

      this.startBlock = nextBlock;
      this.name = name;
      isDefaultLG = false;
      columnFamilies = new HashMap<ByteSequence,MutableLong>();
      for (ByteSequence cf : cfset) {
        columnFamilies.put(cf, new MutableLong(0));
      }
     
      indexWriter = new MultiLevelIndex.BufferedWriter(new MultiLevelIndex.Writer(bfw, indexBlockSize));
    }
View Full Code Here

        // no longer keeping track of column families, so return
        return;
      }
     
      ByteSequence cf = key.getColumnFamilyData();
      MutableLong count = columnFamilies.get(cf);
     
      if (count == null) {
        if (!isDefaultLG) {
          throw new IllegalArgumentException("invalid column family : " + cf);
        }
       
        if (previousColumnFamilies.contains(cf)) {
          throw new IllegalArgumentException("Added column family \"" + cf + "\" to default locality group that was in previous locality group");
        }
       
        if (columnFamilies.size() > Writer.MAX_CF_IN_DLG) {
          // stop keeping track, there are too many
          columnFamilies = null;
          return;
        }
        count = new MutableLong(0);
        columnFamilies.put(new ArrayByteSequence(cf.getBackingArray(), cf.offset(), cf.length()), count);
       
      }
     
      count.increment();
     
    }
View Full Code Here

          int len = in.readInt();
          byte cf[] = new byte[len];
          in.readFully(cf);
          long count = in.readLong();
         
          columnFamilies.put(new ArrayByteSequence(cf), new MutableLong(count));
        }
      }
     
      if (in.readBoolean()) {
        firstKey = new Key();
View Full Code Here

      int count = 0;
      for (Set<ByteSequence> cfset : groups.values()) {
        HashMap<ByteSequence,MutableLong> map = new HashMap<ByteSequence,MutableLong>();
        for (ByteSequence bs : cfset)
          map.put(bs, new MutableLong(1));
        this.groupFams[count++] = map;
        nonDefaultColumnFamilies.addAll(cfset);
      }
     
      partitioner = new LocalityGroupUtil.Partitioner(this.groupFams);
View Full Code Here

    Map<Integer,FrequentPatternMaxHeap> patterns = Maps.newHashMap();
    requiredFeatures.sort();
    for (int attribute : tree.attrIterableRev()) {
      if (requiredFeatures.binarySearch(attribute) >= 0) {
        log.info("Mining FTree Tree for all patterns with {}", attribute);
        MutableLong minSupport = new MutableLong(minSupportValue);
        FrequentPatternMaxHeap frequentPatterns = growth(tree, minSupport, k,
                                                         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());
      }
    }
    return patterns;
View Full Code Here

      Pair<List<A>,Long> transaction = transactions.next();
      for (A attribute : transaction.getFirst()) {
        if (attributeSupport.containsKey(attribute)) {
          attributeSupport.get(attribute).add(transaction.getSecond().longValue());
        } else {
          attributeSupport.put(attribute, new MutableLong(transaction.getSecond()));
        }
      }
    }
    List<Pair<A,Long>> fList = Lists.newArrayList();
    for (Entry<A,MutableLong> e : attributeSupport.entrySet()) {
View Full Code Here

TOP

Related Classes of org.apache.commons.lang.mutable.MutableLong

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.