Commit 4b849d18 authored by yiwenshao's avatar yiwenshao

able to process multiple table in tools/final_load&store,to be tested

parent cacaa34f
...@@ -15,13 +15,13 @@ work(unsigned long id, void *input){ ...@@ -15,13 +15,13 @@ work(unsigned long id, void *input){
if(task->stop == 1) return 1; if(task->stop == 1) return 1;
char * query = (char*)(task->arg1); char * query = (char*)(task->arg1);
(void)query; (void)query;
// printf("id=%lu %s\n",id,query);
return 0; return 0;
} }
int int
main(){ main(){
userFunction = work; userFunction = work;
//create threads, and each thread is waitting for the jobs, each thread has one queue.
bioInit(); bioInit();
std::vector<std::string> input{ std::vector<std::string> input{
"a", "a",
...@@ -35,16 +35,20 @@ main(){ ...@@ -35,16 +35,20 @@ main(){
"i", "i",
"j" "j"
}; };
int type = 0; int type = 0;
for(int i=0;i<10000;i++) { for(int i=0;i<10000;i++) {
//send to thread, whose number is type; arg1 is (input[i%10].c_str()) and arg2 is NULL
//the thread can extract the two arguments from JOB
bioCreateBackgroundJob(type,(input[i%10].c_str()),NULL,0); bioCreateBackgroundJob(type,(input[i%10].c_str()),NULL,0);
type+=1; type+=REDIS_BIO_NUM_OPS;
type%=10; type%=10;
} }
//Send 1 to stop the threads
for(int i=0;i<10;i++) { for(int i=0;i<10;i++) {
bioCreateBackgroundJob(type,NULL,NULL,1); bioCreateBackgroundJob(type,NULL,NULL,1);
type+=1; type+=1;
type%=10; type%=REDIS_BIO_NUM_OPS;
} }
printf("tobe joined\n"); printf("tobe joined\n");
bioKillThreads(); bioKillThreads();
......
This diff is collapsed.
...@@ -72,12 +72,22 @@ struct FieldMeta_Wrapper{ ...@@ -72,12 +72,22 @@ struct FieldMeta_Wrapper{
/*Transformed version of FieldMeta*/ /*Transformed version of FieldMeta*/
class FieldMetaTrans{ class FieldMetaTrans{
public://??
enum class FILEFORMAT{
ESP_STRING,
NUM_STRING,
NUM_BINARY
};
private:
FieldMeta *originalFm; FieldMeta *originalFm;
bool hasSalt; bool hasSalt;
std::string saltName; std::string saltName;
int saltType; int saltType;
int saltLength; int saltLength;
FILEFORMAT fieldStoreFormat;
std::vector<OnionMeta*> onionsOm; std::vector<OnionMeta*> onionsOm;
std::vector<onion> onionsO; std::vector<onion> onionsO;
std::vector<std::string> onionsName; std::vector<std::string> onionsName;
...@@ -89,6 +99,8 @@ class FieldMetaTrans{ ...@@ -89,6 +99,8 @@ class FieldMetaTrans{
std::vector<int> choosenFieldTypes; std::vector<int> choosenFieldTypes;
std::vector<int> choosenFieldLengths; std::vector<int> choosenFieldLengths;
public: public:
FILEFORMAT getFeidlStoreFormat(){return fieldStoreFormat;}
bool setFieldStoreFormat(FILEFORMAT f){fieldStoreFormat = f;return true;}
FieldMeta *getOriginalFieldMeta(){return originalFm;} FieldMeta *getOriginalFieldMeta(){return originalFm;}
void showChoosenOnionO(){std::cout<<"for field "<<originalFm->getFieldName()<<std::endl; void showChoosenOnionO(){std::cout<<"for field "<<originalFm->getFieldName()<<std::endl;
for(auto item:choosenOnionO){ for(auto item:choosenOnionO){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment