public final int[] getAutoGeneratedColumns() { if (this.autoGenColumns != null) { final int[] keys = new int[this.autoGenColumns.size()]; this.autoGenColumns.forEachWhile(new IntObjPredicate<ColumnDescriptor>() { private int index; @Override public boolean test(int k, ColumnDescriptor cd) { keys[index++] = k; return true; } }); return keys; } return null; }
public final boolean isAutoGeneratedColumn(final int position) { return this.autoGenColumns != null && this.autoGenColumns.contains(position); }
/** * Get the object for a given id. */ public Object getObject(int id) { return idToObject.get(id); }
IntObjectHashMap<Message> messages = IntObjectHashMap.withExpectedSize(2); long startSer = theStats.startMsgSerialization(); boolean firstMessage = true; JGroupMember mbr = (JGroupMember)it.next(); short version = mbr.getAddress().getVersionOrdinal(); if (!messages.contains(version)) { Message jmsg = createJGMessage(msg, local, version); messages.justPut(version, jmsg); if (firstMessage) { theStats.incSentBytes(jmsg.getLength()); IpAddress to = mbr.getAddress(); short version = to.getVersionOrdinal(); Message jmsg = messages.get(version); if (DistributionManager.VERBOSE || logger.fineEnabled()) logger.info(
IntObjectHashMap.withExpectedSize(8); int numCols = this.refColUpdtd2DependentCols.size(); refColSameAfterUpdt = new byte[FormatableBitSet .numBytesFromBits(numCols)]; this.refColSameAfterModBitsMapping.justPut(rowNum, refColSameAfterUpdt); TIntHashSet dependentCols = this.refColUpdtd2DependentCols.get(colNum); TIntIterator ti = dependentCols.iterator(); while (ti.hasNext()) {
private IntObjectHashMap<String> readDataFile(InputStream is) { IntObjectHashMap<String> map = IntObjectHashMap.withExpectedSize(128); boolean complete = false; BufferedReader input = null; try { int id = Integer.parseInt(idAsString); map.justPut(id, message); } catch(NumberFormatException nfe) {
private void saveCanonicalIds() { IntObjectHashMap<Object> mappings = canonicalIdHolder.getAllMappings(); mappings.forEachWhile((id, v) -> { writeCanonicalId(id, v); return true; }); }
static void registerDSFID(int dsfid, Supplier<?> creator) { if (dsfid >= Byte.MIN_VALUE && dsfid <= Byte.MAX_VALUE) { dsfidMap[dsfid + Byte.MAX_VALUE + 1] = creator; } else { dsfidMap2.justPut(dsfid, creator); } }
if (!this.container.isTemporaryContainer()) { IntObjectHashMap<TIntHashSet> tempRefColUpdtd2DependentCols = IntObjectHashMap.withExpectedSize(4);
public final boolean hasAutoGeneratedColumns() { return this.autoGenColumns != null && this.autoGenColumns.size() > 0; }
private final void refreshAutoGenColumnInfo() { this.autoGenColumns = null; this.autoGenColumnNames = null; // loop over the table columns for getting auto-gen column information ColumnDescriptor cd; final ColumnDescriptorList cdl = this.td.getColumnDescriptorList(); for (int index = 0; index < cdl.size(); ++index) { cd = cdl.elementAt(index); if (cd.isAutoincrement()) { if (this.autoGenColumns == null) { // user provided column indexes this.autoGenColumns = IntObjectHashMap.withExpectedSize(4); this.autoGenColumnNames = new HashMap<>(); } this.autoGenColumns.justPut(cd.getPosition(), cd); this.autoGenColumnNames.put(cd.getColumnName(), cd); } } }
DSFIDFactory.getDsfidmap2().forEachWhile((id, cons) -> { if (cons != null) { DataSerializableFixedID ds = (DataSerializableFixedID)cons.get();
/** * Add a mapping that we have recovered from disk */ public void addMapping(int id, Object object) { //Store the mapping idToObject.justPut(id, object); objectToID.put(object, id); //increase the next canonical id the recovered id is higher than it. highestID = highestID < id ? id : highestID; }
if (refColSameAfterModFlag) { int numElements = in.readInt(); this.refColSameAfterModBitsMapping = IntObjectHashMap.withExpectedSize( numElements); int byteArraySize = FormatableBitSet bytes[j] = in.readByte(); this.refColSameAfterModBitsMapping.justPut(rowNum,bytes);
out.writeInt(this.refColSameAfterModBitsMapping.size()); this.refColSameAfterModBitsMapping.forEachWhile((rowNum, refColSameAfterUpdt) -> { try { out.writeInt(rowNum);
public final ColumnDescriptor getAutoGeneratedColumn(final int position) { if (this.autoGenColumns != null) { return (ColumnDescriptor)this.autoGenColumns.get(position); } return null; }
/** * Create an id of the given object. * @return the id generated for this object. */ public int createId(Object object) { assert !objectToID.containsKey(object); int id = ++highestID; objectToID.put(object, id); idToObject.justPut(id, object); return id; }
/** * @param key * StringId passed to {@link #getString java.util.ResourceBundle} * for translation. * @return a String translated to the current {@link java.util.Locale} */ public String getString(StringId key) { if (usingRawMode()) return key.getRawText(); String txt = data.get(((StringIdImpl)key).id); if( txt != null ) { return txt; } else { //found an untranslated message, use the English as a fall back return key.getRawText(); } }
private Map<Integer, Boolean> getReferencedUpdateCols( IntObjectHashMap<TIntHashSet> tempRefColUpdtd2DependentCols) { int[] refKeyCols = this.container.getExtraTableInfo() .getReferencedKeyColumns(); // check if any of the modified cols is a ref key column of a // reference // integrity constraint // refKeyCols = fkInfo.colArray; if (refKeyCols != null) { SortedMap<Integer, Boolean> referencedImpactedColsMap = new TreeMap<Integer, Boolean>(); // SortedSet<Integer> onlyRefUpadtedCols = new TreeSet(); for (int i = 0; i < constants.changedColumnIds.length; ++i) { int modColID = constants.changedColumnIds[i]; for (int refKeyColID : refKeyCols) { if (refKeyColID == modColID) { // onlyRefUpadtedCols.add(refKeyColID); TIntHashSet dependentCols = new TIntHashSet(refKeyCols.length); tempRefColUpdtd2DependentCols.justPut(refKeyColID, dependentCols); referencedImpactedColsMap.put(refKeyColID, Boolean.TRUE); addCompanionRefColsToMap(refKeyColID, referencedImpactedColsMap, dependentCols); } } } return referencedImpactedColsMap; } else { return null; } }
? (byte[])this.refColSameAfterModBitsMapping.get(rowNum) : null; if (refColsSameAfterUpdtBit == null) { foundChangedKey = true;