_tableInfo = new AtomicReference<TableInfo>(initTableInfo(sz));
_tableInfo = new AtomicReference<TableInfo>(initTableInfo(sz));
_tableInfo = new AtomicReference<TableInfo>(initTableInfo(hashSize));
private void mergeChild(TableInfo childState) { final int childCount = childState.count; TableInfo currState = _tableInfo.get(); // Only makes sense if child actually has more entries if (childCount <= currState.count) { return; } /* One caveat: let's try to avoid problems with * degenerate cases of documents with generated "random" * names: for these, symbol tables would bloat indefinitely. * One way to do this is to just purge tables if they grow * too large, and that's what we'll do here. */ if (childCount > MAX_ENTRIES_FOR_REUSE || childState.longestCollisionList > MAX_COLL_CHAIN_FOR_REUSE) { /* Should there be a way to get notified about this * event, to log it or such? (as it's somewhat abnormal * thing to happen) */ // At any rate, need to clean up the tables childState = initTableInfo(DEFAULT_TABLE_SIZE); } _tableInfo.compareAndSet(currState, childState); }
private void mergeChild(TableInfo childState) { final int childCount = childState.count; TableInfo currState = _tableInfo.get(); /* Should usually grow; but occasionally could also shrink if * (but only if) collision list overflow ends up clearing * some collision lists. */ if (childCount == currState.count) { return; } /* One caveat: let's try to avoid problems with * degenerate cases of documents with generated "random" * names: for these, symbol tables would bloat indefinitely. * One way to do this is to just purge tables if they grow * too large, and that's what we'll do here. */ if (childCount > MAX_ENTRIES_FOR_REUSE) { /* Should there be a way to get notified about this * event, to log it or such? (as it's somewhat abnormal * thing to happen) */ // At any rate, need to clean up the tables childState = initTableInfo(DEFAULT_T_SIZE); } _tableInfo.compareAndSet(currState, childState); }
private void mergeChild(TableInfo childState) { final int childCount = childState.count; TableInfo currState = _tableInfo.get(); /* Should usually grow; but occasionally could also shrink if * (but only if) collision list overflow ends up clearing * some collision lists. */ if (childCount == currState.count) { return; } /* One caveat: let's try to avoid problems with * degenerate cases of documents with generated "random" * names: for these, symbol tables would bloat indefinitely. * One way to do this is to just purge tables if they grow * too large, and that's what we'll do here. */ if (childCount > MAX_ENTRIES_FOR_REUSE) { /* Should there be a way to get notified about this * event, to log it or such? (as it's somewhat abnormal * thing to happen) */ // At any rate, need to clean up the tables childState = initTableInfo(DEFAULT_T_SIZE); } _tableInfo.compareAndSet(currState, childState); }