亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? flexhammer.cpp

?? mysql-5.0.22.tar.gz源碼包
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/* Copyright (C) 2003 MySQL AB   This program is free software; you can redistribute it and/or modify   it under the terms of the GNU General Public License as published by   the Free Software Foundation; either version 2 of the License, or   (at your option) any later version.   This program is distributed in the hope that it will be useful,   but WITHOUT ANY WARRANTY; without even the implied warranty of   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   GNU General Public License for more details.   You should have received a copy of the GNU General Public License   along with this program; if not, write to the Free Software   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA *//* ***************************************************       FLEXHAMMER       Hammer ndb with read, insert, update and delete transactions.        Arguments:        -t Number of threads to start, default 1        -o Number of operations per hammering-round, default 500	-l Number of loops to run, default 1, 0=infinite        -a Number of attributes, default 25        -c Number of tables, default 1	-s Size of each attribute, default 1	-simple Use simple read to read from database        -dirty Use dirty read to read from database	-write Use writeTuple to write to db	-r Number of records to Hammer        -no_table_create Don't create tables in db        -regulate To be able to regulate the load flexHammer produces.        -stdtables Use standard table names	-sleep Sleep a number of seconds before running the test, this 	       can be used so that another flexProgram have tome to create tables       Returns:        0 - Test passed       -1 - Test failed        1 - Invalid argumentsRevision history:  1.7  020208 epesson: Adapted to use NDBT  1.10 020222 epesson: Finalised handling of thread results  1.11 020222 epesson: Bug in checking results during delete fixed * *************************************************** */#include <ndb_global.h>#include <NdbApi.hpp>#include <NdbMain.h>#include <NdbThread.h>#include <NdbSleep.h>#include <NdbTick.h>#include <NdbOut.hpp>#include <NdbTimer.hpp>#include <NdbTick.h>#include <NdbTest.hpp>#include <NDBT_Error.hpp>#include <NdbSchemaCon.hpp>ErrorData * flexHammerErrorData;#if defined NDB_OSE || defined NDB_SOFTOSE#include <outfmt.h> #endif#define MAXSTRLEN 16 #define MAXATTR 64#define MAXTABLES 64#define MAXTHREADS 256#define MAXATTRSIZE 100// Max number of retries if something fails#define MaxNoOfAttemptsC 10 enum StartType {  stIdle,  stHammer,  stStop,  stLast};enum MyOpType {  otInsert,  otRead,  otDelete,  otUpdate,  otLast};struct ThreadNdb {  int threadNo;  NdbThread* threadLife;  int threadReady;  StartType threadStart;  int threadResult;};extern "C" void* flexHammerThread(void*);static int setAttrNames(void);static int setTableNames(void);static int readArguments(int, const char**);static int createTables(Ndb*);static void sleepBeforeStartingTest(int seconds);static int checkThreadResults(ThreadNdb *threadArrayP, char* phase);//enum OperationType {//  otInsert,//  otRead,//  otUpdate,//  otDelete,//  otVerifyDelete,//  otLast };enum ReadyType {	stReady, 	stRunning} ;static int			tNoOfThreads;static int			tNoOfAttributes;static int			tNoOfTables;static int			tNoOfBackups;static int			tAttributeSize;static int			tNoOfOperations;static int			tNoOfRecords;static int			tNoOfLoops;static				ReadyType ThreadReady[MAXTHREADS];static				StartType ThreadStart[MAXTHREADS];static char			tableName[MAXTABLES][MAXSTRLEN];static char			attrName[MAXATTR][MAXSTRLEN];static int			theSimpleFlag = 0;static int			theWriteFlag = 0;static int			theDirtyFlag = 0;static int			theTableCreateFlag = 0;static int			theStandardTableNameFlag = 0;static unsigned int tSleepTime = 0;#define START_TIMER { NdbTimer timer; timer.doStart();#define STOP_TIMER timer.doStop();#define PRINT_TIMER(text, trans, opertrans) timer.printTransactionStatistics(text, trans, opertrans); }; // Initialise thread datavoid resetThreads(ThreadNdb *threadArrayP) {  for (int i = 0; i < tNoOfThreads ; i++)    {      threadArrayP[i].threadReady = 0;      threadArrayP[i].threadResult = 0;      threadArrayP[i].threadStart = stIdle;    }} // resetThreadsvoid waitForThreads(ThreadNdb *threadArrayP){  int cont = 1;  while (cont) {    NdbSleep_MilliSleep(100);    cont = 0;    for (int i = 0; i < tNoOfThreads ; i++) {      if (threadArrayP[i].threadReady == 0) {	cont = 1;      } // if    } // for  } // while} // waitForThreadsvoid tellThreads(ThreadNdb* threadArrayP, const StartType what){  for (int i = 0; i < tNoOfThreads ; i++)     {    threadArrayP[i].threadStart = what;    } // for} // tellThreadsstatic Ndb_cluster_connection *g_cluster_connection= 0; NDB_COMMAND(flexHammer, "flexHammer", "flexHammer", "flexHammer", 65535)//main(int argc, const char** argv){  ndb_init();  ThreadNdb* pThreads = NULL; // Pointer to thread data array  Ndb* pMyNdb = NULL;	      // Pointer to Ndb object  int tLoops = 0;  int returnValue = 0;  int check = 0;    flexHammerErrorData = new ErrorData;  flexHammerErrorData->resetErrorCounters();  if (readArguments(argc, argv) != 0) {    ndbout << "Wrong arguments to flexHammer" << endl;    return NDBT_ProgramExit(NDBT_WRONGARGS);  } // if  /* print Setting */  flexHammerErrorData->printSettings(ndbout);  check = setAttrNames();  if (check == -1) {    ndbout << "Couldn't set attribute names" << endl;    return NDBT_ProgramExit(NDBT_FAILED);  } // if  check = setTableNames();  if (check == -1) {    ndbout << "Couldn't set table names" << endl;    return NDBT_ProgramExit(NDBT_FAILED);  } // if  // Create thread data array  pThreads = new ThreadNdb[tNoOfThreads];  // NdbThread_SetConcurrencyLevel(tNoOfThreads + 2);  // Create and init Ndb object  Ndb_cluster_connection con;  if(con.connect(12, 5, 1) != 0)  {    return NDBT_ProgramExit(NDBT_FAILED);  }  g_cluster_connection= &con;  pMyNdb = new Ndb(g_cluster_connection, "TEST_DB");  pMyNdb->init();  // Wait for Ndb to become ready  if (pMyNdb->waitUntilReady(10000) != 0) {    ndbout << "NDB is not ready" << endl << "Benchmark failed" << endl;    returnValue = NDBT_FAILED;  }  else {    check = createTables(pMyNdb);    if (check != 0) {      returnValue = NDBT_FAILED;    } // if    else {      sleepBeforeStartingTest(tSleepTime);            // Create threads.                                           *      resetThreads(pThreads);      for (int i = 0; i < tNoOfThreads ; i++) {  	pThreads[i].threadNo = i;	pThreads[i].threadLife = NdbThread_Create(flexHammerThread,						  (void**)&pThreads[i],						  65535,						  "flexHammerThread",                                                  NDB_THREAD_PRIO_LOW);      } // for            // And wait until they are ready      waitForThreads(pThreads);      if (checkThreadResults(pThreads, "init") != 0) {        returnValue = NDBT_FAILED;      } // if                  if (returnValue == NDBT_OK) {	ndbout << endl <<  "All threads started" << endl << endl;		for(;;) {	  	  // Check if it's time to exit program	  if((tNoOfLoops != 0) && (tNoOfLoops <= tLoops))	    break;	  	  // Tell all threads to start hammer	  ndbout << "Hammering..." << endl;	  	  resetThreads(pThreads);	  	  START_TIMER;	  tellThreads(pThreads, stHammer);	  	  waitForThreads(pThreads);	  ndbout << "Threads ready to continue..." << endl;	  STOP_TIMER;	  	  // Check here if anything went wrong	  if (checkThreadResults(pThreads, "hammer") != 0) {	    ndbout << "Thread(s) failed." << endl;	    returnValue = NDBT_FAILED;	  } // if	  	  PRINT_TIMER("hammer", tNoOfOperations*tNoOfThreads, tNoOfTables*6);	  	  ndbout << endl;	  	  tLoops++;	  	} // for      } // if      // Signaling threads to stop       resetThreads(pThreads);      tellThreads(pThreads, stStop);            // Wait for threads to stop      waitForThreads(pThreads);            ndbout << "----------------------------------------------" << endl << endl;      ndbout << "Benchmark completed" << endl;    } // else  } // else  // Clean up   flexHammerErrorData->printErrorCounters(ndbout);  // Kill them all!   void* tmp;  for(int i = 0; i < tNoOfThreads; i++){    NdbThread_WaitFor(pThreads[i].threadLife, &tmp);    NdbThread_Destroy(&pThreads[i].threadLife);  }  delete flexHammerErrorData;  delete [] pThreads;  delete pMyNdb;  // Exit via NDBT  return NDBT_ProgramExit(returnValue);  } //mainextern "C"void*flexHammerThread(void* pArg){  ThreadNdb* pThreadData = (ThreadNdb*)pArg;  unsigned int threadNo = pThreadData->threadNo;  Ndb* pMyNdb = NULL ;  NdbConnection *pMyTransaction = NULL ;  //  NdbOperation*	pMyOperation[MAXTABLES] = {NULL};  NdbOperation*	pMyOperation[MAXTABLES];  int check = 0;  int loop_count_ops = 0;  int loop_count_tables = 0;  int loop_count_attributes = 0;  int count_round = 0;  int count = 0;  int count_tables = 0;  int count_attributes = 0;  int i = 0;  int j = 0;  int tThreadResult = 0;  MyOpType tMyOpType = otLast;  int pkValue = 0;  int readValue[MAXATTR][MAXATTRSIZE] = {0};  int attrValue[MAXATTRSIZE];  NdbRecAttr* tTmp = NULL;  int tNoOfAttempts = 0;   for (i = 0; i < MAXATTRSIZE; i++)    attrValue[i] = 0;   // Ndb object for each thread  pMyNdb = new Ndb(g_cluster_connection, "TEST_DB" );  pMyNdb->init();  if (pMyNdb->waitUntilReady(10000) != 0) {    // Error, NDB is not ready    tThreadResult = 99;    // Go to idle directly    pThreadData->threadStart = stIdle;  } // if    for(;;) {    pThreadData->threadResult = tThreadResult;    pThreadData->threadReady = 1; // Signalling ready to main        // If Idle just wait to be stopped from main    while (pThreadData->threadStart == stIdle) {      NdbSleep_MilliSleep(100);       } // while        // Check if signal to exit is received    if (pThreadData->threadStart == stStop) {      pThreadData->threadReady = 1;      // break out of eternal loop      break;    } // if        // Set to Idle to prepare for possible error break    pThreadData->threadStart = stIdle;        // Prepare transaction    loop_count_ops = tNoOfOperations;    loop_count_tables = tNoOfTables;    loop_count_attributes = tNoOfAttributes;        for (count=0 ; count < loop_count_ops ; count++) {            //pkValue = (int)(count + thread_base);      // This limits the number of records used in this test      pkValue = count % tNoOfRecords;             for (count_round = 0; count_round < 5; ) {	switch (count_round) {	case 0:       // Insert	  tMyOpType = otInsert;	  // Increase attrValues	  for (i=0; i < MAXATTRSIZE; i ++) {	    attrValue[i]++;	  }	  break;	case 1: 	case 3:       // Read and verify	  tMyOpType = otRead;	  break;	case 2:       // Update	  // Increase attrValues	  for(i=0; i < MAXATTRSIZE; i ++) {	    attrValue[i]++;	  }	  tMyOpType = otUpdate;	  break;	case 4:       // Delete	  tMyOpType = otDelete;	  break;	default:	  assert(false);	  break;	} // switch	    	// Get transaction object	pMyTransaction = pMyNdb->startTransaction();	if (pMyTransaction == NULL) {	  // Fatal error	  tThreadResult = 1;	  // break out of for count_round loop waiting to be stopped by main	  break;	} // if	for (count_tables = 0; count_tables < loop_count_tables; 	     count_tables++) {	  pMyOperation[count_tables] = 	    pMyTransaction->getNdbOperation(tableName[count_tables]);		  if (pMyOperation[count_tables] == NULL) {	    //Fatal error	    tThreadResult = 2;	    // break out of inner for count_tables loop	    break;	  } // if			  switch (tMyOpType) {	  case otInsert:			// Insert case	    if (theWriteFlag == 1 && theDirtyFlag == 1) {	      check = pMyOperation[count_tables]->dirtyWrite();	    } else if (theWriteFlag == 1) {	      check = pMyOperation[count_tables]->writeTuple();

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品成人免费在线| 国产精品性做久久久久久| 国产精品人妖ts系列视频| 精品久久久久久久久久久久包黑料 | 精品久久人人做人人爽| 制服视频三区第一页精品| 欧美亚洲自拍偷拍| 欧美唯美清纯偷拍| 欧美日韩中文一区| 91精品国模一区二区三区| 正在播放亚洲一区| 欧美一区二区三区四区五区| 91精品蜜臀在线一区尤物| 在线91免费看| 日韩一级视频免费观看在线| 精品国产精品网麻豆系列| 久久久久成人黄色影片| 国产精品天美传媒| 亚洲视频在线一区观看| 一区二区在线电影| 亚洲成a人片在线不卡一二三区| 香蕉久久夜色精品国产使用方法 | 久久久久久久久久久久久女国产乱| 欧美成人精品高清在线播放 | 亚洲bt欧美bt精品777| 日韩成人午夜电影| 久久国产精品99久久久久久老狼| 激情国产一区二区 | 精品国产123| 国产三级一区二区| 亚洲精品国产成人久久av盗摄| 亚洲主播在线观看| 激情图区综合网| 成人一道本在线| 欧美无乱码久久久免费午夜一区| 日韩欧美你懂的| 久久久久9999亚洲精品| 亚洲激情男女视频| 日本在线不卡视频一二三区| 国产成人亚洲精品狼色在线 | 欧美一区三区二区| 国产日本欧美一区二区| 亚洲人妖av一区二区| 午夜久久久久久久久久一区二区| 精品综合久久久久久8888| 丁香一区二区三区| 欧美猛男男办公室激情| 久久综合九色综合久久久精品综合| 国产精品乱人伦| 亚洲福利一区二区三区| 国产成人免费av在线| 欧美在线色视频| 久久网站热最新地址| 亚洲一级二级在线| 国产另类ts人妖一区二区| 欧洲亚洲国产日韩| 26uuu精品一区二区| 亚洲愉拍自拍另类高清精品| 国产精品一区久久久久| 欧美午夜精品久久久久久孕妇 | 日本中文字幕一区| av成人免费在线| 欧美一级免费观看| 亚洲欧美激情在线| 国产一区二区三区久久悠悠色av| 欧美在线免费观看视频| 欧美韩日一区二区三区四区| 美日韩一区二区三区| 欧美在线一区二区三区| 中文字幕欧美激情一区| 免费观看在线综合| 欧美伊人久久久久久午夜久久久久| 久久久美女毛片| 天天影视涩香欲综合网 | 国产人成亚洲第一网站在线播放 | 99精品久久99久久久久| 精品国产免费久久 | 91亚洲男人天堂| 国产色一区二区| 韩国精品久久久| 6080yy午夜一二三区久久| 亚洲男人的天堂av| 成人国产精品免费观看动漫| 日韩欧美激情一区| 天堂蜜桃一区二区三区| 色噜噜久久综合| 中文字幕一区日韩精品欧美| 国产毛片精品一区| 精品区一区二区| 久久精品国产秦先生| 欧美精品乱人伦久久久久久| 一区二区高清在线| 91麻豆国产精品久久| 国产精品狼人久久影院观看方式| 国产精品 欧美精品| 26uuu亚洲| 精品午夜一区二区三区在线观看| 4438x亚洲最大成人网| 日日夜夜免费精品| 欧美群妇大交群的观看方式| 亚洲国产精品久久人人爱| 欧美婷婷六月丁香综合色| 伊人婷婷欧美激情| 欧美系列日韩一区| 亚洲va欧美va人人爽午夜| 欧美日精品一区视频| 亚洲在线免费播放| 欧美福利视频一区| 日韩av一级片| 欧美大胆人体bbbb| 国产一区二区美女| 日本一区二区视频在线| 成人av动漫网站| 亚洲欧美综合另类在线卡通| 99精品久久只有精品| 亚洲欧美综合网| 欧美在线三级电影| 日韩成人精品在线观看| 日韩免费看的电影| 国产一区二区三区精品视频| 久久精品亚洲精品国产欧美kt∨| 国产jizzjizz一区二区| 国产精品蜜臀av| 一本久久综合亚洲鲁鲁五月天| 一区二区三区不卡视频| 91精品国产欧美一区二区 | 欧美精品久久99久久在免费线 | 成人午夜免费av| ...中文天堂在线一区| 在线观看区一区二| 久久电影国产免费久久电影| 国产亚洲va综合人人澡精品| av在线播放不卡| 亚洲午夜久久久久久久久久久| 3751色影院一区二区三区| 国产在线精品一区二区不卡了| 亚洲国产精品黑人久久久| 日本韩国欧美一区| 日本不卡一二三| 国产午夜精品在线观看| 91国偷自产一区二区三区成为亚洲经典 | 综合电影一区二区三区 | 国产成人免费网站| 亚洲综合偷拍欧美一区色| 欧美一区二区大片| www.亚洲精品| 日韩国产精品久久久| 日本一区二区三区在线观看| 欧美日韩中文国产| 国产成人免费在线观看不卡| 亚洲一区二区三区不卡国产欧美| 精品国产百合女同互慰| 91国在线观看| 国产综合久久久久久鬼色| 亚洲免费观看高清在线观看| 日韩一二三区视频| 97超碰欧美中文字幕| 天堂成人国产精品一区| 亚洲国产精品传媒在线观看| 5566中文字幕一区二区电影| av动漫一区二区| 狠狠色丁香婷婷综合| 亚洲在线免费播放| 国产精品全国免费观看高清| 欧美一区二区三区四区高清| av在线不卡电影| 韩国av一区二区三区| 亚洲一级不卡视频| 亚洲国产精品99久久久久久久久| 欧美一三区三区四区免费在线看| 91女神在线视频| 国产一区二区三区四| 日韩国产一区二| 一级女性全黄久久生活片免费| 久久精品在线免费观看| 91精品国产aⅴ一区二区| 在线观看一区日韩| av在线不卡免费看| 国产精品自拍毛片| 免费在线一区观看| 亚洲高清视频在线| 综合精品久久久| 国产女同互慰高潮91漫画| 日韩亚洲欧美综合| 欧美日韩成人综合| 欧美亚洲综合色| 色综合视频在线观看| 成人黄页毛片网站| 国产真实乱对白精彩久久| 五月婷婷欧美视频| 亚洲与欧洲av电影| 亚洲免费观看高清在线观看| 国产精品久久久一本精品| 久久综合久久99| 久久综合色一综合色88| 91精品国产麻豆国产自产在线| 欧美视频一区二区| 欧美在线视频不卡| 欧美午夜片在线观看| 欧美在线一区二区三区|