本文整理汇总了C++中GetCurrentCommandId函数的典型用法代码示例。如果您正苦于以下问题:C++ GetCurrentCommandId函数的具体用法?C++ GetCurrentCommandId怎么用?C++ GetCurrentCommandId使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetCurrentCommandId函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Cancel
void CControlSocket::Cancel()
{
if (GetCurrentCommandId() != Command::none)
{
if (GetCurrentCommandId() == Command::connect)
DoClose(FZ_REPLY_CANCELED);
else
ResetOperation(FZ_REPLY_CANCELED);
}
}
开发者ID:RanesJan,项目名称:it340midterm,代码行数:10,代码来源:ControlSocket.cpp
示例2: CopyCurrentSnapshot
/*
* CopyCurrentSnapshot
* Make a snapshot that is up-to-date as of the current instant,
* and return a copy.
*
* The copy is palloc'd in the current memory context.
*/
Snapshot
CopyCurrentSnapshot(void)
{
Snapshot currentSnapshot;
Snapshot snapshot;
if (QuerySnapshot == NULL) /* should not be first call in xact */
elog(ERROR, "no snapshot has been set");
/* Update the static struct */
currentSnapshot = GetSnapshotData(&CurrentSnapshotData, false);
currentSnapshot->curcid = GetCurrentCommandId();
/* Make a copy */
snapshot = (Snapshot) palloc(sizeof(SnapshotData));
memcpy(snapshot, currentSnapshot, sizeof(SnapshotData));
if (snapshot->xcnt > 0)
{
snapshot->xip = (TransactionId *)
palloc(snapshot->xcnt * sizeof(TransactionId));
memcpy(snapshot->xip, currentSnapshot->xip,
snapshot->xcnt * sizeof(TransactionId));
}
else
snapshot->xip = NULL;
return snapshot;
}
开发者ID:sunyangkobe,项目名称:cscd43,代码行数:35,代码来源:tqual.c
示例3: LogMessage
int CRealControlSocket::ContinueConnect(const wxIPV4address *address)
{
LogMessage(__TFILE__, __LINE__, this, Debug_Verbose, _T("CRealControlSocket::ContinueConnect(%p) m_pEngine=%p"), address, m_pEngine);
if (GetCurrentCommandId() != cmd_connect ||
!m_pCurrentServer)
{
LogMessage(Debug_Warning, _T("Invalid context for call to ContinueConnect(), cmd=%d, m_pCurrentServer=%p"), GetCurrentCommandId(), m_pCurrentServer);
return DoClose(FZ_REPLY_INTERNALERROR);
}
if (!address)
{
LogMessage(::Error, _("Invalid hostname or host not found"));
return DoClose(FZ_REPLY_ERROR | FZ_REPLY_CRITICALERROR);
}
CConnectOpData* pData;
if (!m_pCurOpData || m_pCurOpData->opId != cmd_connect)
pData = 0;
else
pData = static_cast<CConnectOpData *>(m_pCurOpData);
const unsigned int port = pData ? pData->port : m_pCurrentServer->GetPort();
LogMessage(Status, _("Connecting to %s:%d..."), address->IPAddress().c_str(), port);
wxIPV4address addr = *address;
addr.Service(port);
bool res = wxSocketClient::Connect(addr, false);
if (!res && LastError() != wxSOCKET_WOULDBLOCK)
return DoClose();
return FZ_REPLY_WOULDBLOCK;
}
开发者ID:idgaf,项目名称:FileZilla3,代码行数:35,代码来源:ControlSocket.cpp
示例4: DtmGetSnapshot
static Snapshot DtmGetSnapshot(Snapshot snapshot)
{
if (TransactionIdIsValid(DtmNextXid) && snapshot != &CatalogSnapshotData)
{
if (!DtmHasGlobalSnapshot && (snapshot != DtmLastSnapshot || DtmCurcid != GetCurrentCommandId(false))) {
ArbiterGetSnapshot(DtmNextXid, &DtmSnapshot, &dtm->minXid);
}
DtmLastSnapshot = snapshot;
DtmMergeWithGlobalSnapshot(snapshot);
DtmCurcid = snapshot->curcid;
if (!IsolationUsesXactSnapshot())
{
/* Use single global snapshot during all transaction for repeatable read isolation level,
* but obtain new global snapshot each time it is requested for read committed isolation level
*/
DtmHasGlobalSnapshot = false;
}
}
else
{
/* For local transactions and catalog snapshots use default GetSnapshotData implementation */
snapshot = PgGetSnapshotData(snapshot);
}
DtmUpdateRecentXmin(snapshot);
return snapshot;
}
开发者ID:gavioto,项目名称:postgres_cluster,代码行数:26,代码来源:multimaster.c
示例5: create_estate_for_relation
/*
* Executor state preparation for evaluation of constraint expressions,
* indexes and triggers.
*
* This is based on similar code in copy.c
*/
static EState *
create_estate_for_relation(LogicalRepRelMapEntry *rel)
{
EState *estate;
ResultRelInfo *resultRelInfo;
RangeTblEntry *rte;
estate = CreateExecutorState();
rte = makeNode(RangeTblEntry);
rte->rtekind = RTE_RELATION;
rte->relid = RelationGetRelid(rel->localrel);
rte->relkind = rel->localrel->rd_rel->relkind;
estate->es_range_table = list_make1(rte);
resultRelInfo = makeNode(ResultRelInfo);
InitResultRelInfo(resultRelInfo, rel->localrel, 1, NULL, 0);
estate->es_result_relations = resultRelInfo;
estate->es_num_result_relations = 1;
estate->es_result_relation_info = resultRelInfo;
estate->es_output_cid = GetCurrentCommandId(true);
/* Triggers might need a slot */
if (resultRelInfo->ri_TrigDesc)
estate->es_trig_tuple_slot = ExecInitExtraTupleSlot(estate, NULL);
/* Prepare to catch AFTER triggers. */
AfterTriggerBeginQuery();
return estate;
}
开发者ID:RingsC,项目名称:postgres,代码行数:39,代码来源:worker.c
示例6: transientrel_startup
/*
* transientrel_startup --- executor startup
*/
static void
transientrel_startup(DestReceiver *self, int operation, TupleDesc typeinfo)
{
DR_transientrel *myState = (DR_transientrel *) self;
Relation transientrel;
transientrel = heap_open(myState->transientoid, NoLock);
/*
* Fill private fields of myState for use by later routines
*/
myState->transientrel = transientrel;
myState->output_cid = GetCurrentCommandId(true);
/*
* We can skip WAL-logging the insertions, unless PITR or streaming
* replication is in use. We can skip the FSM in any case.
*/
myState->hi_options = HEAP_INSERT_SKIP_FSM | HEAP_INSERT_FROZEN;
if (!XLogIsNeeded())
myState->hi_options |= HEAP_INSERT_SKIP_WAL;
myState->bistate = GetBulkInsertState();
/* Not using WAL requires smgr_targblock be initially invalid */
Assert(RelationGetTargetBlock(transientrel) == InvalidBlockNumber);
}
开发者ID:qowldi,项目名称:pg,代码行数:29,代码来源:matview.c
示例7: ExecCQMatRelInsert
/*
* ExecCQMatViewInsert
*
* Insert a new row into a CV materialization table
*/
void
ExecCQMatRelInsert(ResultRelInfo *ri, TupleTableSlot *slot, EState *estate)
{
HeapTuple tup = ExecMaterializeSlot(slot);
heap_insert(ri->ri_RelationDesc, tup, GetCurrentCommandId(true), 0, NULL);
ExecInsertCQMatRelIndexTuples(ri, slot, estate);
}
开发者ID:NianYue,项目名称:pipelinedb,代码行数:13,代码来源:cqmatrel.c
示例8: UpdateActiveSnapshotCommandId
/*
* UpdateActiveSnapshotCommandId
*
* Update the current CID of the active snapshot. This can only be applied
* to a snapshot that is not referenced elsewhere.
*/
void
UpdateActiveSnapshotCommandId(void)
{
Assert(ActiveSnapshot != NULL);
Assert(ActiveSnapshot->as_snap->active_count == 1);
Assert(ActiveSnapshot->as_snap->regd_count == 0);
ActiveSnapshot->as_snap->curcid = GetCurrentCommandId(false);
}
开发者ID:avontd2868,项目名称:postgres,代码行数:15,代码来源:snapmgr.c
示例9: RegisterSmgrInvalidation
/*
* RegisterSmgrInvalidation
*
* As above, but register an smgr invalidation event.
*/
static void
RegisterSmgrInvalidation(RelFileNode rnode)
{
AddSmgrInvalidationMessage(&transInvalInfo->CurrentCmdInvalidMsgs,
rnode);
/*
* As above, just in case there is not an associated catalog change.
*/
(void) GetCurrentCommandId(true);
}
开发者ID:KMU-embedded,项目名称:mosbench-ext,代码行数:16,代码来源:inval.c
示例10: LogMessage
void CRealControlSocket::OnClose(int error)
{
LogMessage(MessageType::Debug_Verbose, _T("CRealControlSocket::OnClose(%d)"), error);
if (GetCurrentCommandId() != Command::connect)
{
if (!error)
LogMessage(MessageType::Error, _("Connection closed by server"));
else
LogMessage(MessageType::Error, _("Disconnected from server: %s"), CSocket::GetErrorDescription(error));
}
DoClose();
}
开发者ID:RanesJan,项目名称:it340midterm,代码行数:13,代码来源:ControlSocket.cpp
示例11: LogMessage
int CHttpControlSocket::ContinueConnect()
{
LogMessage(__TFILE__, __LINE__, this, Debug_Verbose, _T("CHttpControlSocket::ContinueConnect() m_pEngine=%p"), m_pEngine);
if (GetCurrentCommandId() != cmd_connect ||
!m_pCurrentServer)
{
LogMessage(Debug_Warning, _T("Invalid context for call to ContinueConnect(), cmd=%d, m_pCurrentServer=%p"), GetCurrentCommandId(), m_pCurrentServer);
return DoClose(FZ_REPLY_INTERNALERROR);
}
ResetOperation(FZ_REPLY_OK);
return FZ_REPLY_OK;
}
开发者ID:Hellcenturion,项目名称:MILF,代码行数:13,代码来源:httpcontrolsocket.cpp
示例12: PushUpdatedSnapshot
/*
* PushUpdatedSnapshot
* As above, except we set the snapshot's CID to the current CID.
*/
void
PushUpdatedSnapshot(Snapshot snapshot)
{
Snapshot newsnap;
/*
* We cannot risk modifying a snapshot that's possibly already used
* elsewhere, so make a new copy to scribble on.
*/
newsnap = CopySnapshot(snapshot);
newsnap->curcid = GetCurrentCommandId(false);
PushActiveSnapshot(newsnap);
}
开发者ID:badalex,项目名称:postgresql-scratchpad,代码行数:18,代码来源:snapmgr.c
示例13: wxASSERT
void CHttpControlSocket::OnConnect()
{
wxASSERT(GetCurrentCommandId() == cmd_connect);
CHttpConnectOpData *pData = static_cast<CHttpConnectOpData *>(m_pCurOpData);
if (pData->tls)
{
if (!m_pTlsSocket)
{
LogMessage(Status, _("Connection established, initializing TLS..."));
delete m_pBackend;
m_pTlsSocket = new CTlsSocket(this, m_pSocket, this);
m_pBackend = m_pTlsSocket;
if (!m_pTlsSocket->Init())
{
LogMessage(::Error, _("Failed to initialize TLS."));
DoClose();
return;
}
const wxString trusted_rootcert = m_pEngine->GetOptions()->GetOption(OPTION_INTERNAL_ROOTCERT);
if (trusted_rootcert != _T("") && !m_pTlsSocket->AddTrustedRootCertificate(trusted_rootcert))
{
LogMessage(::Error, _("Failed to parse trusted root cert."));
DoClose();
return;
}
int res = m_pTlsSocket->Handshake();
if (res == FZ_REPLY_ERROR)
DoClose();
}
else
{
LogMessage(Status, _("TLS/SSL connection established, sending HTTP request"));
ResetOperation(FZ_REPLY_OK);
}
return;
}
else
{
LogMessage(Status, _("Connection established, sending HTTP request"));
ResetOperation(FZ_REPLY_OK);
}
}
开发者ID:Hellcenturion,项目名称:MILF,代码行数:49,代码来源:httpcontrolsocket.cpp
示例14: UpdateActiveSnapshotCommandId
/*
* UpdateActiveSnapshotCommandId
*
* Update the current CID of the active snapshot. This can only be applied
* to a snapshot that is not referenced elsewhere.
*/
void
UpdateActiveSnapshotCommandId(void)
{
Assert(ActiveSnapshot != NULL);
Assert(ActiveSnapshot->as_snap->active_count == 1);
Assert(ActiveSnapshot->as_snap->regd_count == 0);
ActiveSnapshot->as_snap->curcid = GetCurrentCommandId(false);
#ifdef XCP
/*
* Set flag so that updated command ID is sent to the datanodes before the
* next query. This ensures that the effects of previous statements are
* visible to the subsequent statements
*/
SetSendCommandId(true);
#endif
}
开发者ID:pgresql,项目名称:postgres-xl,代码行数:23,代码来源:snapmgr.c
示例15: LogMessage
void CRealControlSocket::OnSend()
{
if (m_pSendBuffer)
{
if (!m_nSendBufferLen)
{
delete [] m_pSendBuffer;
m_pSendBuffer = 0;
return;
}
int error;
int written = m_pBackend->Write(m_pSendBuffer, m_nSendBufferLen, error);
if (written < 0)
{
if (error != EAGAIN)
{
LogMessage(MessageType::Error, _("Could not write to socket: %s"), CSocket::GetErrorDescription(error));
if (GetCurrentCommandId() != Command::connect)
LogMessage(MessageType::Error, _("Disconnected from server"));
DoClose();
}
return;
}
if (written)
{
SetAlive();
m_pEngine->SetActive(CFileZillaEngine::send);
}
if (written == m_nSendBufferLen)
{
m_nSendBufferLen = 0;
delete [] m_pSendBuffer;
m_pSendBuffer = 0;
}
else
{
memmove(m_pSendBuffer, m_pSendBuffer + written, m_nSendBufferLen - written);
m_nSendBufferLen -= written;
}
}
}
开发者ID:bugiii,项目名称:filezilla3ex,代码行数:44,代码来源:ControlSocket.cpp
示例16: GetCurrentCommandId
int CHttpControlSocket::ProcessData(char* p, int len)
{
int res;
enum Command commandId = GetCurrentCommandId();
switch (commandId)
{
case cmd_transfer:
res = FileTransferParseResponse(p, len);
break;
default:
LogMessage(Debug_Warning, _T("No action for parsing data for command %d"), (int)commandId);
ResetOperation(FZ_REPLY_INTERNALERROR);
res = FZ_REPLY_ERROR;
break;
}
wxASSERT(p || !m_pCurOpData);
return res;
}
开发者ID:Hellcenturion,项目名称:MILF,代码行数:20,代码来源:httpcontrolsocket.cpp
示例17: PgPaxosExecutorStart
/*
* PgPaxosExecutorStart blocks until the table is ready to read.
*/
static void
PgPaxosExecutorStart(QueryDesc *queryDesc, int eflags)
{
PlannedStmt *plannedStmt = queryDesc->plannedstmt;
List *rangeTableList = plannedStmt->rtable;
CmdType commandType = queryDesc->operation;
if (IsPgPaxosActive() && HasPaxosTable(rangeTableList))
{
char *sqlQuery = (char *) queryDesc->sourceText;
char *groupId = NULL;
bool topLevel = true;
/* disallow transactions during paxos commands */
PreventTransactionChain(topLevel, "paxos commands");
groupId = DeterminePaxosGroup(rangeTableList);
if (commandType == CMD_INSERT || commandType == CMD_UPDATE ||
commandType == CMD_DELETE)
{
PrepareConsistentWrite(groupId, sqlQuery);
}
else
{
PrepareConsistentRead(groupId);
}
queryDesc->snapshot->curcid = GetCurrentCommandId(false);
}
/* call into the standard executor start, or hook if set */
if (PreviousExecutorStartHook != NULL)
{
PreviousExecutorStartHook(queryDesc, eflags);
}
else
{
standard_ExecutorStart(queryDesc, eflags);
}
}
开发者ID:godouxm,项目名称:pg_paxos,代码行数:44,代码来源:pg_paxos.c
示例18: simple_table_update
/*
* simple_table_update - replace a tuple
*
* This routine may be used to update a tuple when concurrent updates of
* the target tuple are not expected (for example, because we have a lock
* on the relation associated with the tuple). Any failure is reported
* via ereport().
*/
void
simple_table_update(Relation rel, ItemPointer otid,
TupleTableSlot *slot,
Snapshot snapshot,
bool *update_indexes)
{
TM_Result result;
TM_FailureData tmfd;
LockTupleMode lockmode;
result = table_update(rel, otid, slot,
GetCurrentCommandId(true),
snapshot, InvalidSnapshot,
true /* wait for commit */ ,
&tmfd, &lockmode, update_indexes);
switch (result)
{
case TM_SelfModified:
/* Tuple was already updated in current command? */
elog(ERROR, "tuple already updated by self");
break;
case TM_Ok:
/* done successfully */
break;
case TM_Updated:
elog(ERROR, "tuple concurrently updated");
break;
case TM_Deleted:
elog(ERROR, "tuple concurrently deleted");
break;
default:
elog(ERROR, "unrecognized table_update status: %u", result);
break;
}
}
开发者ID:davidfetter,项目名称:postgresql_projects,代码行数:49,代码来源:tableam.c
示例19: RegisterRelcacheInvalidation
/*
* RegisterRelcacheInvalidation
*
* As above, but register a relcache invalidation event.
*/
static void
RegisterRelcacheInvalidation(Oid dbId, Oid relId)
{
AddRelcacheInvalidationMessage(&transInvalInfo->CurrentCmdInvalidMsgs,
dbId, relId);
/*
* Most of the time, relcache invalidation is associated with system
* catalog updates, but there are a few cases where it isn't. Quick hack
* to ensure that the next CommandCounterIncrement() will think that we
* need to do CommandEndInvalidationMessages().
*/
(void) GetCurrentCommandId(true);
/*
* If the relation being invalidated is one of those cached in the
* relcache init file, mark that we need to zap that file at commit.
*/
if (RelationIdIsInInitFile(relId))
transInvalInfo->RelcacheInitFileInval = true;
}
开发者ID:AXLEproject,项目名称:postgres,代码行数:26,代码来源:inval.c
示例20: matrel_heap_update
static bool
matrel_heap_update(Relation relation, ItemPointer otid, HeapTuple tup)
{
HTSU_Result result;
HeapUpdateFailureData hufd;
LockTupleMode lockmode;
result = heap_update(relation, otid, tup,
GetCurrentCommandId(true), InvalidSnapshot,
true /* wait for commit */ ,
&hufd, &lockmode);
switch (result)
{
case HeapTupleSelfUpdated:
/* Tuple was already updated in current command? */
elog(ERROR, "tuple already updated by self");
break;
case HeapTupleMayBeUpdated:
/* done successfully */
break;
case HeapTupleUpdated:
/*
* Tuple updated by a concurrent transaction? The only legal case is if the tuple was deleted
* which can happen if the auto-vacuumer deletes the tuple while we were trying to update it.
*/
if (memcmp(&hufd.ctid, otid, sizeof(ItemPointerData)) == 0)
return false;
elog(ERROR, "tuple concurrently updated");
break;
default:
elog(ERROR, "unrecognized heap_update status: %u", result);
break;
}
return true;
}
开发者ID:myechuri,项目名称:pipelinedb,代码行数:39,代码来源:cqmatrel.c
注:本文中的GetCurrentCommandId函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论