/** * 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)); }
/** * Test API only -- NOT THREAD-SAFE. */ public final EmbedStatement getStatementForTEST(long statementID) { if (this.stmntMap != null) { final Object sr = this.stmntMap.get(statementID); if (sr != null) { return ((StmntWeakReference)sr).get(); } } return null; }
/** * Test API only -- NOT THREAD-SAFE. */ public final EmbedStatement getStatementForTEST(long statementID) { if (this.stmntMap != null) { final Object sr = this.stmntMap.get(statementID); if (sr != null) { return ((StmntWeakReference)sr).get(); } } return null; }
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); } } }
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 StreamContainerHandle openStreamContainer(long segmentId, long containerId, boolean hold) throws StandardException { if (SanityManager.DEBUG) { SanityManager.ASSERT( segmentId == StreamContainerHandle.TEMPORARY_SEGMENT, "GemFireTransaction: Must be only used for temporary file creations"); } assert this.tempCongloms != null; final FileStreamInputOutput fc = (FileStreamInputOutput)this.tempCongloms .get(containerId); fc.flipToRead(); return fc; }
public StreamContainerHandle openStreamContainer(long segmentId, long containerId, boolean hold) throws StandardException { if (SanityManager.DEBUG) { SanityManager.ASSERT( segmentId == StreamContainerHandle.TEMPORARY_SEGMENT, "GemFireTransaction: Must be only used for temporary file creations"); } assert this.tempCongloms != null; final FileStreamInputOutput fc = (FileStreamInputOutput)this.tempCongloms .get(containerId); fc.flipToRead(); return fc; }
public final boolean execute(long key, Object value) { int index = _otherMap.index(key); if (index >= 0 && eq(value, _otherMap.get(key))) { return true; } return false; }
@Override public boolean execute(final long ddlId) { final GfxdDDLMessage pendingMessage = (GfxdDDLMessage)pendingDDLMessages.get(ddlId); if (member.equals(pendingMessage.getSender())) { memberPendingMessages.add(pendingMessage); pendingDDLMessages.remove(ddlId); } return true; } });
@Override public boolean execute(final long ddlId) { final GfxdDDLMessage pendingMessage = (GfxdDDLMessage)pendingDDLMessages.get(ddlId); if (member.equals(pendingMessage.getSender())) { memberPendingMessages.add(pendingMessage); pendingDDLMessages.remove(ddlId); } return true; } });
long k = unwrapKey(key); Object v = unwrapValue(val); if (_map.containsKey(k) && v == _map.get(k)) {
public static MemConglomerate findConglomerate(final long conglomId, final LanguageConnectionContext lcc, final GemFireTransaction tran) throws StandardException { if (conglomId >= 0) { return Misc.getMemStore().findConglomerate( ContainerKey.valueOf(ContainerHandle.TABLE_SEGMENT, conglomId)); } MemConglomerate tempconglom = null; if (tran.tempCongloms != null) { tempconglom = (MemConglomerate)tran.tempCongloms.get(conglomId); } if (tempconglom == null) { tempconglom = lcc.getConglomerateForDeclaredGlobalTempTable(conglomId); } return tempconglom; }
public static MemConglomerate findConglomerate(final long conglomId, final LanguageConnectionContext lcc, final GemFireTransaction tran) throws StandardException { if (conglomId >= 0) { return Misc.getMemStore().findConglomerate( ContainerKey.valueOf(ContainerHandle.TABLE_SEGMENT, conglomId)); } MemConglomerate tempconglom = null; if (tran.tempCongloms != null) { tempconglom = (MemConglomerate)tran.tempCongloms.get(conglomId); } if (tempconglom == null) { tempconglom = lcc.getConglomerateForDeclaredGlobalTempTable(conglomId); } return tempconglom; }
public EmbedStatement getStatementForCancellation(long stmtId, long executionId) { EmbedStatement stmnt = null; if (this.stmntMap != null) { synchronized (this.stmntMap) { // cleanup statement map first cleanUpStmntMap(); Object sr = this.stmntMap.get(stmtId); if (sr != null) { stmnt = ((StmntWeakReference)sr).get(); } // return null if the stmt is not active or the passed in executionId // does not match if (stmnt != null ) { if (!stmnt.isActive()) { return null; } // if executionId passed is non-zero then // match the executionId as well if (executionId != 0) { if (stmnt.getExecutionID() != executionId) { return null; } } } } } return stmnt; }
public EmbedStatement getStatementForCancellation(long stmtId, long executionId) { EmbedStatement stmnt = null; if (this.stmntMap != null) { synchronized (this.stmntMap) { // cleanup statement map first cleanUpStmntMap(); Object sr = this.stmntMap.get(stmtId); if (sr != null) { stmnt = ((StmntWeakReference)sr).get(); } // return null if the stmt is not active or the passed in executionId // does not match if (stmnt != null ) { if (!stmnt.isActive()) { return null; } // if executionId passed is non-zero then // match the executionId as well if (executionId != 0) { if (stmnt.getExecutionID() != executionId) { return null; } } } } } return stmnt; }