/** * Empties the map. */ @Override // GemStoneAddition public void clear() { this._map.clear(); }
/** * Executes <tt>procedure</tt> for each key in the map. * * @param procedure a <code>TLongProcedure</code> value * @return false if the loop over the keys terminated because * the procedure returned false for some key. */ public boolean forEachKey(TLongProcedure procedure) { return forEach(procedure); }
/** * Compares this map with another map for equality of their stored * entries. * * @param other an <code>Object</code> value * @return a <code>boolean</code> value */ @Override // GemStoneAddition public boolean equals(Object other) { if (! (other instanceof TLongObjectHashMap)) { return false; } TLongObjectHashMap that = (TLongObjectHashMap)other; if (that.size() != this.size()) { return false; } return forEachEntry(new EqProcedure(that)); }
if (this.stmntMap.size() > 0) { CollectStmts collectStmts = new CollectStmts(); this.stmntMap.forEachEntry(collectStmts); stmts = collectStmts.stmts; this.stmntMap.clear();
private void removeWeakReferenceFromStmntMap(long stmntId, StmntWeakReference sRef) { assert Thread.holdsLock(this.stmntMap); if (this.stmntMap.get(stmntId) == sRef) { if (GemFireXDUtils.TraceQuery | GemFireXDUtils.TraceNCJ) { SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_QUERYDISTRIB, "GfxdConnectionWrapper#removeWeakReferenceFromStmntMap: " + "removing statement with id: " + stmntId); this.stmntMap.remove(stmntId); } } }
public long addAndLoadStreamContainer(final long segmentId, final Properties tableProperties, final RowSource rowSource, final ByteBuffer rwBuffer) throws StandardException { if (SanityManager.DEBUG) { SanityManager.ASSERT( segmentId == StreamContainerHandle.TEMPORARY_SEGMENT, "GemFireTransaction: Must be only used for temporary file creations"); } final long conglomId = getNextTempConglomId(); if (this.tempCongloms == null) { this.tempCongloms = new TLongObjectHashMap(); } this.tempCongloms.put(conglomId, new FileStreamInputOutput(conglomId, this, rowSource, rwBuffer)); return conglomId; }
static GfxdDDLMessage removePendingDDLMessage(final long ddlId) { synchronized (pendingDDLMessages) { return (GfxdDDLMessage)pendingDDLMessages.remove(ddlId); } }
if (_map.equals(other)) { return true; // comparing two trove maps } else if (other instanceof Map) { Map that = (Map)other; if (that.size() != _map.size()) { return false; // different sizes, no need to compare } else { // now we have to do it the hard way long k = unwrapKey(key); Object v = unwrapValue(val); if (_map.containsKey(k) && v == _map.get(k)) {
/** * Retrieves the value for <tt>key</tt> * * @param key an <code>Object</code> value * @return the value of <tt>key</tt> or null if no such mapping exists. */ @Override // GemStoneAddition public Object get(Object key) { return _map.get(unwrapKey(key)); }
Object sr = this.stmntMap.get(stmtId); if (sr != null) { stmnt = ((StmntWeakReference)sr).get(); if (sql == null) { sql = (String)this.sqlMap.get(stmtId); if (sql == null) { throw new GemFireXDRuntimeException( stmnt = (EmbedStatement)getConnection().prepareCall(sql, stmtId); this.stmntMap.put(stmtId, new StmntWeakReference(stmnt, stmtId, this.refQueue)); this.sqlMap.put(stmtId, sql); if (GemFireXDUtils.TraceQuery | GemFireXDUtils.TraceNCJ) { SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_QUERYDISTRIB, this.stmntMap.put(stmtId, new StmntWeakReference(stmnt, stmtId, this.refQueue)); if (GemFireXDUtils.TraceQuery) {
/** * Returns the number of entries in the map. * @return the map's size. */ @Override // GemStoneAddition public int size() { return this._map.size(); }
/** * Inserts a key/value pair into the map. * * @param key an <code>Object</code> value * @param value an <code>Object</code> value * @return the previous value associated with <tt>key</tt>, * or Integer(0) if none was found. */ @Override // GemStoneAddition public Object put(Object key, Object value) { return wrapValue(_map.put(unwrapKey(key), unwrapValue(value))); }
private void writeObject(ObjectOutputStream stream) throws IOException { stream.defaultWriteObject(); // number of entries stream.writeInt(_size); SerializationProcedure writeProcedure = new SerializationProcedure(stream); if (! forEachEntry(writeProcedure)) { throw writeProcedure.exception; } }
isRemoteDDL, props); this.embedConn = conn; this.stmntMap = new TLongObjectHashMap(); this.sqlMap = new TLongObjectHashMap(); this.refQueue = new ReferenceQueue<EmbedStatement>();
TLongObjectIterator iter = this.tempCongloms.iterator(); while (iter.hasNext()) { iter.advance();
if (this.stmntMap.size() > 0) { CollectStmts collectStmts = new CollectStmts(); this.stmntMap.forEachEntry(collectStmts); stmts = collectStmts.stmts; this.stmntMap.clear();
private void removeWeakReferenceFromStmntMap(long stmntId, StmntWeakReference sRef) { assert Thread.holdsLock(this.stmntMap); if (this.stmntMap.get(stmntId) == sRef) { if (GemFireXDUtils.TraceQuery | GemFireXDUtils.TraceNCJ) { SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_QUERYDISTRIB, "GfxdConnectionWrapper#removeWeakReferenceFromStmntMap: " + "removing statement with id: " + stmntId); this.stmntMap.remove(stmntId); } } }
public long addAndLoadStreamContainer(final long segmentId, final Properties tableProperties, final RowSource rowSource, final ByteBuffer rwBuffer) throws StandardException { if (SanityManager.DEBUG) { SanityManager.ASSERT( segmentId == StreamContainerHandle.TEMPORARY_SEGMENT, "GemFireTransaction: Must be only used for temporary file creations"); } final long conglomId = getNextTempConglomId(); if (this.tempCongloms == null) { this.tempCongloms = new TLongObjectHashMap(); } this.tempCongloms.put(conglomId, new FileStreamInputOutput(conglomId, this, rowSource, rwBuffer)); return conglomId; }