Author: schor Date: Tue Jan 2 20:32:56 2018 New Revision: 1819893 URL: http://svn.apache.org/viewvc?rev=1819893&view=rev Log: no Jira - add trace for PositiveIntSet for debugging.
Modified: uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/Common_hash_support.java uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/IntBitSet.java uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/IntHashSet.java uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/IntSet.java uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/ObjHashSet.java uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/PositiveIntSet.java Modified: uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/Common_hash_support.java URL: http://svn.apache.org/viewvc/uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/Common_hash_support.java?rev=1819893&r1=1819892&r2=1819893&view=diff ============================================================================== --- uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/Common_hash_support.java (original) +++ uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/Common_hash_support.java Tue Jan 2 20:32:56 2018 @@ -95,12 +95,19 @@ public abstract class Common_hash_suppor size = 0; removed = 0; resetHistogram(); + if (PositiveIntSet.IS_TRACE_MODE_SWITCH) { + System.out.println("TRAcE_MODE Common_hash clear 2nd time shrinkable, newCapacity=" + newCapacity + ", keys_length: " + keys_length()); + } return; } else { // don't shrink below minimum clearExisting(); + if (PositiveIntSet.IS_TRACE_MODE_SWITCH) { + System.out.println("TRAcE_MODE Common_hash clear 2nd time shrinkable but nothing done, below minimum: newCapacity=" + newCapacity + ", keys_length: " + keys_length()); + } return; } } else { + if (PositiveIntSet.IS_TRACE_MODE_SWITCH) System.out.println("TRACE_MODE Common_hash clear setting 2nd time shrinkable"); secondTimeShrinkable = true; } } else { Modified: uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/IntBitSet.java URL: http://svn.apache.org/viewvc/uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/IntBitSet.java?rev=1819893&r1=1819892&r2=1819893&view=diff ============================================================================== --- uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/IntBitSet.java (original) +++ uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/IntBitSet.java Tue Jan 2 20:32:56 2018 @@ -88,6 +88,9 @@ public class IntBitSet implements Positi public IntBitSet(int maxAdjKey, int offset) { set = new BitSet(Math.max(1, maxAdjKey)); this.offset = offset; + if (IS_TRACE_MODE_SWITCH) { + System.out.println("TRACE_MODE new IntBitSet, maxAdjKey = " + maxAdjKey + ", offset= " + offset); + } } /** Modified: uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/IntHashSet.java URL: http://svn.apache.org/viewvc/uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/IntHashSet.java?rev=1819893&r1=1819892&r2=1819893&view=diff ============================================================================== --- uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/IntHashSet.java (original) +++ uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/IntHashSet.java Tue Jan 2 20:32:56 2018 @@ -106,6 +106,9 @@ public class IntHashSet extends Common_h this.offset = isMake4 ? 0 : offset; newTable(this.initialCapacity); resetTable(); + if (IS_TRACE_MODE_SWITCH) { + System.out.println("TRACE_MODE new IntHashSet, sizeBeforeExpanding = " + initialSizeBeforeExpanding + ", offset= " + offset); + } } // /** Modified: uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/IntSet.java URL: http://svn.apache.org/viewvc/uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/IntSet.java?rev=1819893&r1=1819892&r2=1819893&view=diff ============================================================================== --- uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/IntSet.java (original) +++ uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/IntSet.java Tue Jan 2 20:32:56 2018 @@ -46,6 +46,9 @@ public class IntSet implements PositiveI */ public IntSet(int capacity) { this.iVec = new IntVector(capacity); + if (IS_TRACE_MODE_SWITCH) { + System.out.println("TRACE_MODE new IntSet with capacity: " + capacity); + } } /** Modified: uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/ObjHashSet.java URL: http://svn.apache.org/viewvc/uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/ObjHashSet.java?rev=1819893&r1=1819892&r2=1819893&view=diff ============================================================================== --- uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/ObjHashSet.java (original) +++ uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/ObjHashSet.java Tue Jan 2 20:32:56 2018 @@ -337,10 +337,10 @@ public class ObjHashSet<T> extends Commo */ private void addInner(T obj) { final int i = findPosition(obj); - //debug - if (keys[i] != null) { - System.out.println("debug"); - } +// //debug +// if (keys[i] != null) { +// System.out.println("debug"); +// } assert(keys[i] == null); keys[i] = obj; // val259(); Modified: uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/PositiveIntSet.java URL: http://svn.apache.org/viewvc/uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/PositiveIntSet.java?rev=1819893&r1=1819892&r2=1819893&view=diff ============================================================================== --- uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/PositiveIntSet.java (original) +++ uima/uv3/uimaj-v3/trunk/uimaj-core/src/main/java/org/apache/uima/internal/util/PositiveIntSet.java Tue Jan 2 20:32:56 2018 @@ -26,6 +26,8 @@ import java.util.function.IntConsumer; */ public interface PositiveIntSet { + static final boolean IS_TRACE_MODE_SWITCH = false; // for debugging + /** * remove all members of the set */