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){
if(task->stop == 1) return 1;
char * query = (char*)(task->arg1);
(void)query;
// printf("id=%lu %s\n",id,query);
return 0;
}
int
main(){
userFunction = work;
//create threads, and each thread is waitting for the jobs, each thread has one queue.
bioInit();
std::vector<std::string> input{
"a",
......@@ -35,16 +35,20 @@ main(){
"i",
"j"
};
int type = 0;
int type = 0;
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);
type+=1;
type+=REDIS_BIO_NUM_OPS;
type%=10;
}
//Send 1 to stop the threads
for(int i=0;i<10;i++) {
bioCreateBackgroundJob(type,NULL,NULL,1);
type+=1;
type%=10;
type%=REDIS_BIO_NUM_OPS;
}
printf("tobe joined\n");
bioKillThreads();
......
This diff is collapsed.
......@@ -72,12 +72,22 @@ struct FieldMeta_Wrapper{
/*Transformed version of FieldMeta*/
class FieldMetaTrans{
public://??
enum class FILEFORMAT{
ESP_STRING,
NUM_STRING,
NUM_BINARY
};
private:
FieldMeta *originalFm;
bool hasSalt;
std::string saltName;
int saltType;
int saltLength;
FILEFORMAT fieldStoreFormat;
std::vector<OnionMeta*> onionsOm;
std::vector<onion> onionsO;
std::vector<std::string> onionsName;
......@@ -89,6 +99,8 @@ class FieldMetaTrans{
std::vector<int> choosenFieldTypes;
std::vector<int> choosenFieldLengths;
public:
FILEFORMAT getFeidlStoreFormat(){return fieldStoreFormat;}
bool setFieldStoreFormat(FILEFORMAT f){fieldStoreFormat = f;return true;}
FieldMeta *getOriginalFieldMeta(){return originalFm;}
void showChoosenOnionO(){std::cout<<"for field "<<originalFm->getFieldName()<<std::endl;
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