@Override protected LeadNodeExecutorMsg clone() { final LeadNodeExecutorMsg msg = new LeadNodeExecutorMsg(this.sql, this.ctx, (GfxdResultCollector<Object>)this.userCollector); msg.exec = this.exec; return msg; }
@Override protected LeadNodeExecutorMsg clone() { final LeadNodeExecutorMsg msg = new LeadNodeExecutorMsg(this.sql, this.ctx, (GfxdResultCollector<Object>)this.userCollector); msg.exec = this.exec; return msg; }
@Override protected LeadNodeExecutorMsg clone() { final LeadNodeExecutorMsg msg = new LeadNodeExecutorMsg(this.sql, this.schema, this.ctx, (GfxdResultCollector<Object>)this.userCollector, this.pvs, this.isPreparedStatement(), this.isPreparedPhase(), this.isUpdateOrDelete()); msg.exec = this.exec; return msg; }
public static void executeOnLeadNode(SnappySelectResultSet rs, GfxdResultCollector<Object> rc, String sql, boolean enableStreaming , long connId) throws StandardException { // TODO: KN probably username, statement id and connId to be sent in // execution and of course tx id when transaction will be supported. LeadNodeExecutionContext ctx = new LeadNodeExecutionContext(connId); LeadNodeExecutorMsg msg = new LeadNodeExecutorMsg(sql, ctx, rc); try { msg.executeFunction(enableStreaming, false, rs, true); } catch (SQLException se) { throw Misc.processFunctionException( "SnappyActivation::execute", se, null, null); } }
public static void executeOnLeadNode(SnappySelectResultSet rs, GfxdResultCollector<Object> rc, String sql, boolean enableStreaming , long connId) throws StandardException { // TODO: KN probably username, statement id and connId to be sent in // execution and of course tx id when transaction will be supported. LeadNodeExecutionContext ctx = new LeadNodeExecutionContext(connId); LeadNodeExecutorMsg msg = new LeadNodeExecutorMsg(sql, ctx, rc); try { msg.executeFunction(enableStreaming, false, rs, true); } catch (SQLException se) { throw Misc.processFunctionException( "SnappyActivation::execute", se, null, null); } }
private static void prepareOnLeadNode(SnappyPrepareResultSet rs, GfxdResultCollector<Object> rc, String sql, long connId, String schema, ParameterValueSet pvs, boolean isUpdateOrDelete, LanguageConnectionContext lcc) throws StandardException { // TODO: KN probably username, statement id and connId to be sent in // execution and of course tx id when transaction will be supported. LeadNodeExecutionContext ctx = new LeadNodeExecutionContext(connId); LeadNodeExecutorMsg msg = new LeadNodeExecutorMsg(sql, schema, ctx, rc, pvs, true, true, isUpdateOrDelete); if (lcc != null) { lcc.getTransactionExecute().releaseAllLocks(true, true); } try { msg.executeFunction(false, false, rs, true); } catch (RuntimeException | SQLException ex) { Exception e = LeadNodeExecutorMsg.handleLeadNodeException(ex, sql); throw Misc.processFunctionException( "SnappyActivation::prepareOnLeadNode", e, null, null); } }
private static void executeOnLeadNode(SnappySelectResultSet rs, GfxdResultCollector<Object> rc, String sql, boolean enableStreaming, long connId, String schema, ParameterValueSet pvs, boolean isPreparedStatement, boolean isUpdateOrDelete, LanguageConnectionContext lcc) throws StandardException { // TODO: KN probably username, statement id and connId to be sent in // execution and of course tx id when transaction will be supported. LeadNodeExecutionContext ctx = new LeadNodeExecutionContext(connId); LeadNodeExecutorMsg msg = new LeadNodeExecutorMsg(sql, schema, ctx, rc, pvs, isPreparedStatement, false, isUpdateOrDelete); // release all locks before sending the message else it can lead to deadlocks if (lcc != null) { lcc.getTransactionExecute().releaseAllLocks(true, true); } // wait for any pending transactions before routing new operations to lead final TXManagerImpl.TXContext txContext = TXManagerImpl .currentTXContext(); if (txContext != null) { txContext.waitForPendingCommit(); } try { msg.executeFunction(enableStreaming, false, rs, true); } catch (RuntimeException | SQLException ex) { Exception e = LeadNodeExecutorMsg.handleLeadNodeException(ex, sql); throw Misc.processFunctionException( "SnappyActivation::executeOnLeadNode", e, null, null); } }
() -> new LeadNodeExecutionContext()); DSFIDFactory.registerGemFireXDClass(LEAD_NODE_EXN_MSG, () -> new LeadNodeExecutorMsg()); DSFIDFactory.registerGemFireXDClass(SNAPPY_RESULT_HOLDER, () -> new SnappyResultHolder());