本文整理汇总了C++中ExExeStmtGlobals::castToExMasterStmtGlobals方法的典型用法代码示例。如果您正苦于以下问题:C++ ExExeStmtGlobals::castToExMasterStmtGlobals方法的具体用法?C++ ExExeStmtGlobals::castToExMasterStmtGlobals怎么用?C++ ExExeStmtGlobals::castToExMasterStmtGlobals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExExeStmtGlobals
的用法示例。
在下文中一共展示了ExExeStmtGlobals::castToExMasterStmtGlobals方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: alterAuditFlag
short ExExeUtilTcb::alterAuditFlag(NABoolean audited, char * tableName,
NABoolean isIndex)
{
char buf[4000];
Lng32 cliRC = 0;
// Get the globals stucture of the master executor.
ExExeStmtGlobals *exeGlob = getGlobals()->castToExExeStmtGlobals();
ExMasterStmtGlobals *masterGlob = exeGlob->castToExMasterStmtGlobals();
// change the corrupt bit in the label
if (isIndex)
str_sprintf(buf, "LABEL_ALTER INDEX_TABLE %s PARALLEL EXECUTION ON OPCODE %s ''",
tableName, (audited ? "65" : "66"));
else
str_sprintf(buf, "LABEL_ALTER TABLE %s PARALLEL EXECUTION ON OPCODE %s ''",
tableName, (audited ? "65" : "66"));
// set sqlparserflags to allow 'label_alter' syntax
masterGlob->getStatement()->getContext()->setSqlParserFlags(0x1);
cliRC = cliInterface()->executeImmediate(buf);
masterGlob->getStatement()->getContext()->resetSqlParserFlags(0x1);
if (cliRC < 0)
{
return -1;
}
return 0;
}
示例2: alterObjectState
short ExExeUtilTcb::alterObjectState(NABoolean online,
char * tableName,
char * failReason,
NABoolean forPurgedata)
{
char buf[4000];
Lng32 cliRC = 0;
// Get the globals stucture of the master executor.
ExExeStmtGlobals *exeGlob = getGlobals()->castToExExeStmtGlobals();
ExMasterStmtGlobals *masterGlob = exeGlob->castToExMasterStmtGlobals();
// make object online
str_sprintf(buf, "ALTER TABLE %s %s %s",
tableName,
(online ? "ONLINE" : "OFFLINE"),
(forPurgedata ? "FOR PURGEDATA" : " "));
// set sqlparserflags to allow 'FOR PURGEDATA' syntax
masterGlob->getStatement()->getContext()->setSqlParserFlags(0x1);
cliRC = cliInterface()->executeImmediate(buf);
masterGlob->getStatement()->getContext()->resetSqlParserFlags(0x1);
if (cliRC < 0)
{
str_sprintf(failReason, "Could not alter the state of table %s to %s.",
tableName, (online ? "online" : "offline"));
return -1;
}
return 0;
}
示例3: alterCorruptBit
short ExExeUtilTcb::alterCorruptBit(short val, char * tableName,
char * failReason, Queue* indexList)
{
char buf[4000];
Lng32 cliRC = 0;
// Get the globals stucture of the master executor.
ExExeStmtGlobals *exeGlob = getGlobals()->castToExExeStmtGlobals();
ExMasterStmtGlobals *masterGlob = exeGlob->castToExMasterStmtGlobals();
// change the corrupt bit in the label
str_sprintf(buf, "LABEL_ALTER TABLE %s PARALLEL EXECUTION ON OPCODE 9 '%s'",
tableName, (val == 1 ? "1" : "0"));
// set sqlparserflags to allow 'label_alter' syntax
masterGlob->getStatement()->getContext()->setSqlParserFlags(0x1);
cliRC = cliInterface()->executeImmediate(buf);
masterGlob->getStatement()->getContext()->resetSqlParserFlags(0x1);
if (cliRC < 0)
{
str_sprintf(failReason, "Could not %s the corrupt bit on table %s.",
(val == 1 ? "set" : "reset"), tableName);
return -1;
}
if (indexList)
{
indexList->position();
while (NOT indexList->atEnd())
{
char * indexName = (char*)indexList->getNext();
str_sprintf(buf, "LABEL_ALTER INDEX_TABLE %s PARALLEL EXECUTION ON OPCODE 9 '%s'",
indexName, (val == 1 ? "1" : "0"));
// set sqlparserflags to allow 'label_alter' syntax
masterGlob->getStatement()->getContext()->setSqlParserFlags(0x1);
cliRC = cliInterface()->executeImmediate(buf);
masterGlob->getStatement()->getContext()->resetSqlParserFlags(0x1);
if (cliRC < 0)
{
str_sprintf(failReason, "Could not %s the corrupt bit on index %s.",
(val == 1 ? "set" : "reset"), indexName);
return -1;
}
} // while
} // index present
return 0;
}
示例4: getObjectUid
short ExExeUtilTcb::getObjectUid(char * catName, char * schName,
char * objName,
NABoolean isIndex, NABoolean isMv,
char* uid)
{
Lng32 cliRC = 0;
ex_queue_entry * pentry_down = qparent_.down->getHeadEntry();
ExExeUtilPrivateState & pstate =
*((ExExeUtilPrivateState*) pentry_down->pstate);
ExExeStmtGlobals *exeGlob = getGlobals()->castToExExeStmtGlobals();
ExMasterStmtGlobals *masterGlob = exeGlob->castToExMasterStmtGlobals();
const QueryString * qs;
Int32 sizeOfqs = 0;
versionStrLen_ = 0;
qs = getObjectUidQuery;
sizeOfqs = sizeof(getObjectUidQuery);
Int32 qryArraySize = sizeOfqs / sizeof(QueryString);
char * gluedQuery;
Lng32 gluedQuerySize;
glueQueryFragments(qryArraySize, qs,
gluedQuery, gluedQuerySize);
Lng32 extraSpace = 10 /*segment name*/+ ComMAX_3_PART_EXTERNAL_UTF8_NAME_LEN_IN_BYTES/*cat/sch/obj name in UTF8*/ + 100;
char * infoQuery =
new(getHeap()) char[gluedQuerySize + extraSpace + 1];
str_sprintf(infoQuery, gluedQuery,
catName, schName, objName,
(isIndex ? "IX" : "TA"),
(isMv ? "MV" : (isIndex ? "IX" : "BT")));
NADELETEBASIC(gluedQuery, getMyHeap());
Lng32 uidLen;
cliRC =
cliInterface()->executeImmediate(infoQuery,
uid, &uidLen);
if (cliRC < 0)
{
cliInterface()->retrieveSQLDiagnostics(getDiagsArea());
return -1;
}
uid[uidLen] = 0;
return 0;
}
示例5: lockUnlockObject
short ExExeUtilTcb::lockUnlockObject(char * tableName,
NABoolean lock,
NABoolean parallel,
char * failReason)
{
char buf[4000];
Lng32 cliRC = 0;
// Get the globals stucture of the master executor.
ExExeStmtGlobals *exeGlob = getGlobals()->castToExExeStmtGlobals();
ExMasterStmtGlobals *masterGlob = exeGlob->castToExMasterStmtGlobals();
// lock or unlock the table.
if (parallel)
{
if (lock)
str_sprintf(buf, "LOCK TABLE %s IN PROTECTED MODE NO INDEX LOCK PARALLEL EXECUTION ON",
tableName);
else
str_sprintf(buf, "UNLOCK TABLE %s PARALLEL EXECUTION ON",
tableName);
}
else
{
if (lock)
str_sprintf(buf, "LOCK TABLE %s IN PROTECTED MODE",
tableName);
else
str_sprintf(buf, "UNLOCK TABLE %s",
tableName);
}
masterGlob->getStatement()->getContext()->setSqlParserFlags(0x100001);
cliRC = cliInterface()->executeImmediate(buf);
masterGlob->getStatement()->getContext()->resetSqlParserFlags(0x100001);
if (cliRC < 0)
{
if (lock)
str_sprintf(failReason, "Could not lock table %s in protected mode using parallel execution.",
tableName);
else
str_sprintf(failReason, "Could not unlock table %s using parallel execution.",
tableName);
return -1;
}
return 0;
}
示例6: changeAuditAttribute
Lng32 ExExeUtilTcb::changeAuditAttribute(char * tableName,
NABoolean makeAudited,
NABoolean isVolatile,
NABoolean isIndex,
NABoolean parallelAlter)
{
Lng32 retcode = 0;
// Get the globals stucture of the master executor.
ExExeStmtGlobals *exeGlob = getGlobals()->castToExExeStmtGlobals();
ExMasterStmtGlobals *masterGlob = exeGlob->castToExMasterStmtGlobals();
// set sqlparserflags to allow change of audit attribute
masterGlob->getStatement()->getContext()->setSqlParserFlags(0x400); // ALLOW_AUDIT_CHANGE
// make table unaudited
char stmt[500];
strcpy(stmt, "alter ");
if (isVolatile)
strcat(stmt, "volatile ");
strcat(stmt, "table ");
strcat(stmt, tableName);
if (makeAudited)
strcat(stmt, " attribute audit");
else
strcat(stmt, " attribute no audit");
if (parallelAlter)
strcat(stmt, " no label update");
strcat(stmt, ";");
retcode = cliInterface()->executeImmediate
(stmt, NULL, NULL, TRUE, NULL, 0,
&(masterGlob->getStatement()->getContext()->diags()));
masterGlob->getStatement()->getContext()->resetSqlParserFlags(0x400); // ALLOW_AUDIT_CHANGE
if (retcode < 0)
return retcode;
if (parallelAlter)
{
retcode = alterAuditFlag(makeAudited, tableName, isIndex);
if (retcode < 0)
return retcode;
}
return 0;
}
示例7: createServer
short ExExeUtilTcb::createServer(char *serverName,
const char * inPName,
IpcServerTypeEnum serverType,
IpcServerAllocationMethod servAllocMethod,
char *nodeName,
short cpu,
const char *partnName,
Lng32 priority,
IpcServer* &ipcServer,
NABoolean logError,
const char * operation)
{
short error = 0;
// Get the globals stucture of the master executor.
ExExeStmtGlobals *exeGlob = getGlobals()->castToExExeStmtGlobals();
ExMasterStmtGlobals *masterGlob = exeGlob->castToExMasterStmtGlobals();
IpcEnvironment * env = masterGlob->getCliGlobals()->getEnvironment();
NAHeap *ipcHeap = masterGlob->getCliGlobals()->getIpcHeap();
IpcServerClass * sc =
new (ipcHeap) IpcServerClass(env, serverType,
servAllocMethod, //IPC_LAUNCH_GUARDIAN_PROCESS,
COM_VERS_MXV, nodeName);
if (!sc)
{
if (logError)
{
char emsText[400+ComMAX_3_PART_EXTERNAL_UTF8_NAME_LEN_IN_BYTES];
str_sprintf(emsText, "Failure creating IpcServerClass on \\%s cpu %d to %s %s for %s.",
nodeName, cpu, operation, partnName,
(char *)exeUtilTdb().getTableName());
SQLMXLoggingArea::logExecRtInfo(NULL, 0, emsText, 0);
}
return -1;
}
const char * pName = NULL;
char pNameBuf[20];
short pNameLen = 0;
if (inPName)
pName = inPName;
else
{
pName = pNameBuf;
pNameBuf[pNameLen] = 0;
}
ipcServer =
sc->allocateServerProcess(&diagsArea_,
ipcHeap,
nodeName,
cpu,
priority,
1, // espLevel (not relevent)
FALSE, // no Xn
TRUE, // waited creation
0, // maxNowaitRequests
serverName,
pName
);
if (!ipcServer)
{
if (logError && diagsArea_)
{
char emsText[400+ComMAX_3_PART_EXTERNAL_UTF8_NAME_LEN_IN_BYTES];
str_sprintf(emsText, "allocateServerProcess() failed with error %d on \\%s cpu %d to %s %s for %s.",
diagsArea_->mainSQLCODE(), nodeName, cpu, operation,
partnName, (char *)exeUtilTdb().getTableName());
SQLMXLoggingArea::logExecRtInfo(NULL, 0, emsText, 0);
}
NADELETE(sc, IpcServerClass, ipcHeap);
return -3;
}
return 0;
}
示例8: alterDDLLock
// lockType: COM_UTIL_PURGEDATA (= 9), COM_UTIL_REPLICATE (= 19).
// (definition in common/ComSmallDefs.h).
short ExExeUtilTcb::alterDDLLock(NABoolean add, char * tableName,
char * failReason, NABoolean isMV,
Int32 lockType,
const char * lockSuffix,
NABoolean skipDDLLockCheck)
{
char buf[4000];
Lng32 cliRC = 0;
// Get the globals stucture of the master executor.
ExExeStmtGlobals *exeGlob = getGlobals()->castToExExeStmtGlobals();
ExMasterStmtGlobals *masterGlob = exeGlob->castToExMasterStmtGlobals();
AnsiOrNskName aonn(tableName);
aonn.convertAnsiOrNskName(FALSE);
char * parts[4];
Lng32 numParts;
aonn.extractParts(numParts, parts);
char * quotedParts0 = NULL;
char * quotedParts1 = NULL;
if (numParts == 3)
{
quotedParts0 =
new(getGlobals()->getDefaultHeap()) char[strlen(parts[0]) * 2 + 1];
quotedParts1 =
new(getGlobals()->getDefaultHeap()) char[strlen(parts[1]) * 2 + 1];
doubleQuoteStr(parts[0], quotedParts0, FALSE);
doubleQuoteStr(parts[1], quotedParts1, FALSE);
}
////////////////////////////////////////////////////////////////
// see sqlshare/catapirequest.h for details on CAT API params.
// CatApi has the form:
// CREATE TANDEM_CAT_REQUEST&1 <request-type> <num-params>
// <lock-name> <object-name> <object-type> <operation-type>
// request-type: 1 (create lock) or 2 (drop lock)
// num-params: 5
// lock-name: getTableName() appended with _DDL_LOCK
// object-name: getTableName()
// object-type: 0 (table) or 2 (MV)
// operation-type: 9 (purgedata)
// lockStatus: 9 (parallel purgedata)
////////////////////////////////////////////////////////////////
char sdlc[200];
if (skipDDLLockCheck)
{
str_sprintf(sdlc, "<> <0> <1>");
}
// alter(add or drop) DDL lock
if (numParts == 3)
{
char lockNameSuffix[200];
str_sprintf(lockNameSuffix, "_DDL_LOCK%s", (lockSuffix ? lockSuffix : ""));
generateLockName(parts[2], lockNameSuffix, buf, sizeof buf - 20);
char quotedLockName[ComMAX_3_PART_EXTERNAL_UTF8_NAME_LEN_IN_BYTES+200]; // a big buffer
doubleQuoteStr(buf, quotedLockName, FALSE);
str_sprintf(buf, "CREATE TANDEM_CAT_REQUEST&1 %s %d <\"%s\".\"%s\".\"%s\"> <%s%s> <%s> <%d> %s %s",
(add ? "1" : "2"),
(skipDDLLockCheck ? 8 : 5), //(lockType == COM_UTIL_PURGEDATA ? 5 : 4),
quotedParts0, quotedParts1, quotedLockName,
tableName, "",
(isMV ? "2" : "0"),
lockType,
(lockType == COM_UTIL_PURGEDATA ? "<9>" : "<0>"),
skipDDLLockCheck ? sdlc : "");
}
else
str_sprintf(buf, "CREATE TANDEM_CAT_REQUEST&1 %s %d <%s_DDL_LOCK%s> <%s%s> <%s> <%d> %s %s",
(add ? "1" : "2"),
// (lockType == COM_UTIL_PURGEDATA ? 5 : 4),
(skipDDLLockCheck ? 8 : 5), //(lockType == COM_UTIL_PURGEDATA ? 5 : 4),
tableName,
(lockSuffix ? lockSuffix : ""),
tableName, "",
(isMV ? "2" : "0"),
lockType,
(lockType == COM_UTIL_PURGEDATA ? "<9>" : "<0>"),
skipDDLLockCheck ? sdlc : "");
// set sqlparserflags to allow CAT_API_REQUEST
masterGlob->getStatement()->getContext()->setSqlParserFlags(0x1);
cliRC = cliInterface()->executeImmediate(buf);
masterGlob->getStatement()->getContext()->resetSqlParserFlags(0x1);
NADELETEBASIC(quotedParts0, getGlobals()->getDefaultHeap());
NADELETEBASIC(quotedParts1, getGlobals()->getDefaultHeap());
if (cliRC < 0)
{
str_sprintf(failReason, "Could not %s ddl lock for object %s.",
(add ? "add" : "drop"), tableName);
//.........这里部分代码省略.........
示例9: work
short ExExeUtilPopulateInMemStatsTcb::work()
{
// short rc = 0;
Lng32 cliRC = 0;
// if no parent request, return
if (qparent_.down->isEmpty())
return WORK_OK;
// if no room in up queue, won't be able to return data/status.
// Come back later.
if (qparent_.up->isFull())
return WORK_OK;
ex_queue_entry * pentry_down = qparent_.down->getHeadEntry();
ExExeUtilPrivateState & pstate =
*((ExExeUtilPrivateState*) pentry_down->pstate);
// Get the globals stucture of the master executor.
ExExeStmtGlobals *exeGlob = getGlobals()->castToExExeStmtGlobals();
ExMasterStmtGlobals *masterGlob = exeGlob->castToExMasterStmtGlobals();
ContextCli * currContext = masterGlob->getStatement()->getContext();
while (1)
{
switch (step_)
{
case INITIAL_:
{
if (getDiagsArea())
{
getDiagsArea()->clear();
getDiagsArea()->deAllocate();
}
setDiagsArea(ComDiagsArea::allocate(getHeap()));
step_ = PROLOGUE_;
}
break;
case PROLOGUE_:
{
if (disableCQS())
{
step_ = ERROR_;
break;
}
if (setSchemaVersion(pimsTdb().sourceTableCatName_))
{
step_ = ERROR_;
break;
}
// set sqlparserflags to allow use of volatile schema in queries.
masterGlob->getStatement()->getContext()->
setSqlParserFlags(0x10000);//ALLOW_VOLATILE_SCHEMA_IN_TABLE_NAME
step_ = DELETE_STATS_;
}
break;
case DELETE_STATS_:
{
Int32 qry_array_size = sizeof(deleteStatsQuery)
/ sizeof(QueryString);
const QueryString * queryString = deleteStatsQuery;;
char * gluedQuery;
Lng32 gluedQuerySize;
glueQueryFragments(qry_array_size, queryString,
gluedQuery, gluedQuerySize);
Lng32 extraSpace =
ComMAX_3_PART_EXTERNAL_UTF8_NAME_LEN_IN_BYTES /* fullyQualTableName */
+ 20 /* UID */
+ 200 /* overhead */;
char * query = new(getHeap()) char[gluedQuerySize + extraSpace];
str_sprintf(query, gluedQuery,
(char*)pimsTdb().inMemHistogramsTableName_,
pimsTdb().uid_);
cliRC =
cliInterface()->executeImmediate(query);
if (cliRC >= 0)
{
str_sprintf(query, gluedQuery,
(char*)pimsTdb().inMemHistintsTableName_,
pimsTdb().uid_);
cliRC =
cliInterface()->executeImmediate(query);
}
// Delete new'd string
NADELETEBASIC(gluedQuery, getHeap());
//.........这里部分代码省略.........
示例10: processInitial
short ExExeUtilLongRunningTcb::processInitial(Lng32 &rc)
{
Int64 rowsAffected = 0;
setInitialOutputVarPtrList(new(getHeap()) Queue(getHeap()));
setContinuingOutputVarPtrList(new(getHeap()) Queue(getHeap()));
lruStmtAndPartInfo_ = new(getHeap()) char[(UInt32)(lrTdb().getLruStmtLen() + lrTdb().getPredicateLen() + 10)];
ExExeStmtGlobals *exeGlob = getGlobals()->castToExExeStmtGlobals();
ExEspStmtGlobals *espGlob = exeGlob->castToExEspStmtGlobals();
ContextCli *currContext = NULL;
CliGlobals *cliGlobals = NULL;
if (espGlob)
{
cliGlobals = GetCliGlobals();
currContext = cliGlobals->currContext();
}
else
{
currContext = exeGlob->castToExMasterStmtGlobals()->getStatement()->getContext();
}
Int32 espNum = 1;
// we are executing inside an ESP go ahead and set the partition number to the
// ESP instance number. The added one is because ESP instances are 0 based
if (espGlob)
{
espNum = (Int32) espGlob->getMyInstanceNumber() + 1;
}
if (lrTdb().getPredicate() != NULL)
str_sprintf(lruStmtAndPartInfo_,
lrTdb().getLruStmt(),
espNum,
lrTdb().getPredicate());
else
str_sprintf(lruStmtAndPartInfo_,
lrTdb().getLruStmt(),
espNum);
lruStmtWithCKAndPartInfo_ = new(getHeap()) char[(UInt32)(lrTdb().getLruStmtWithCKLen() + lrTdb().getPredicateLen() + 10)];
if (lrTdb().getPredicate() != NULL)
str_sprintf(lruStmtWithCKAndPartInfo_,
lrTdb().getLruStmtWithCK(),
espNum,
lrTdb().getPredicate());
else
str_sprintf(lruStmtWithCKAndPartInfo_,
lrTdb().getLruStmtWithCK(),
espNum);
// All internal queries issued from CliInterface assume that
// they are in ISO_MAPPING.
// For LongRunning we need to send the actual ISO_MAPPING.
// Save it and restore after the prepare
Int32 savedIsoMapping =
cliInterface()->getIsoMapping();
cliInterface()->setIsoMapping
(currContext->getSessionDefaults()->getIsoMappingEnum());
// If the table we are deleting from is an IUD log table,
// we need to set the parserflags to accept the special
// table type and the quoted column names
if (lrTdb().useParserflags())
currContext->setSqlParserFlags(0x3);
rc = cliInterface()->prepareAndExecRowsPrologue(lruStmtAndPartInfo_,
lruStmtWithCKAndPartInfo_,
getInitialOutputVarPtrList(),
getContinuingOutputVarPtrList(),
rowsAffected);
cliInterface()->setIsoMapping(savedIsoMapping);
if (rc < 0)
{
return -1;
}
if (rc >= 0 && rowsAffected > 0)
addRowsDeleted(rowsAffected);
return 0;
}
示例11: doLongRunning
short ExExeUtilLongRunningTcb::doLongRunning()
{
Lng32 cliRC =0;
short retcode = 0;
NABoolean xnAlreadyStarted = FALSE;
// Get the globals stucture of the master executor.
ExExeStmtGlobals *exeGlob = getGlobals()->castToExExeStmtGlobals();
ExMasterStmtGlobals *masterGlob = exeGlob->castToExMasterStmtGlobals();
ex_queue_entry * pentry_down = qparent_.down->getHeadEntry();
ExExeUtilPrivateState & pstate =
*((ExExeUtilPrivateState*) pentry_down->pstate);
CliGlobals *cliGlobals = 0;
cliGlobals = GetCliGlobals();
ex_assert(cliGlobals != NULL, "Cli globals is NULL - should have been allocated already");
if (cliGlobals->isESPProcess())
{
if (!currTransaction_)
currTransaction_ = new (getHeap()) ExTransaction (cliGlobals, getHeap());
}
else // in master executor
{
currTransaction_ = masterGlob->getStatement()->getContext()->getTransaction();
}
if (currTransaction_->xnInProgress())
{
xnAlreadyStarted = TRUE;
}
// cannot run LRU when a user transaction is in progress
if (xnAlreadyStarted)
{
ExHandleErrors(qparent_,
pentry_down,
0,
getGlobals(),
NULL,
(ExeErrorCode)(-8603),
NULL,
exeUtilTdb().getTableName()
);
return (-8603);
}
SQL_EXEC_ClearDiagnostics(NULL);
// no Xn in progress. Start one.
cliRC = currTransaction_->beginTransaction ();
if (cliRC < 0)
{
ExHandleErrors(qparent_,
pentry_down,
0,
getGlobals(),
NULL,
(ExeErrorCode)(cliRC),
NULL,
exeUtilTdb().getTableName()
);
return (short) cliRC;
}
retcode = executeLongRunningQuery();
// Rollback the transaction, if there is an error.
if (retcode < 0)
{
// rollback the transaction
cliRC = currTransaction_->rollbackTransaction ();
return retcode;
}
else
{
// commit the transaction
cliRC = currTransaction_->commitTransaction ();
if (cliRC < 0)
{
ExHandleErrors(qparent_,
pentry_down,
0,
getGlobals(),
NULL,
(ExeErrorCode)(cliRC),
NULL,
exeUtilTdb().getTableName()
);
return short(cliRC);
}
//.........这里部分代码省略.........
示例12: work
ExWorkProcRetcode ExHbaseAccessInitMDTcb::work()
{
short retcode = 0;
short rc = 0;
Lng32 cliRC = 0;
ExExeStmtGlobals *exeGlob = getGlobals()->castToExExeStmtGlobals();
ExMasterStmtGlobals *masterGlob = exeGlob->castToExMasterStmtGlobals();
ComDiagsArea *da = exeGlob->getDiagsArea();
// if no parent request, return
if (qparent_.down->isEmpty())
return WORK_OK;
ex_queue_entry *pentry_down = qparent_.down->getHeadEntry();
while (1)
{
switch (step_)
{
case NOT_STARTED:
{
if (! masterGlob)
{
step_ = HANDLE_ERROR;
break;
}
matches_ = 0;
if (hbaseAccessTdb().accessType_ == ComTdbHbaseAccess::INIT_MD_)
step_ = INIT_MD;
else if (hbaseAccessTdb().accessType_ == ComTdbHbaseAccess::DROP_MD_)
step_ = DROP_MD;
else
step_ = HANDLE_ERROR;
}
break;
case INIT_MD:
{
step_ = UPDATE_MD;
}
break;
case UPDATE_MD:
{
step_ = DONE;
}
break;
case DROP_MD:
{
step_ = DONE;
}
break;
case HANDLE_ERROR:
{
if (handleError(rc))
return rc;
step_ = DONE;
}
break;
case DONE:
{
if (handleDone(rc))
return rc;
step_ = NOT_STARTED;
return WORK_OK;
}
break;
}// switch
} // while
}