@@ -61,12 +61,9 @@ void PixelsConsumer::run()
6161 regex = " " ;
6262 }
6363
64- // int pixelsStride = std::stoi(ConfigFactory::Instance().getProperty("pixel.stride"));
65- // int rowGroupSize = std::stoi(ConfigFactory::Instance().getProperty("row.group.size"));
66- // int64_t blockSize = std::stoll(ConfigFactory::Instance().getProperty("block.size"));
67- int pixelsStride = 2 ;
68- int rowGroupSize = 100 ;
69- int64_t blockSize = 1024 ;
64+ int pixelsStride = std::stoi (ConfigFactory::Instance ().getProperty (" pixel.stride" ));
65+ int rowGroupSize = std::stoi (ConfigFactory::Instance ().getProperty (" row.group.size" ));
66+ int64_t blockSize = std::stoll (ConfigFactory::Instance ().getProperty (" block.size" ));
7067
7168 short replication = static_cast <short >(std::stoi (ConfigFactory::Instance ().getProperty (" block.replication" )));
7269
@@ -109,16 +106,14 @@ void PixelsConsumer::run()
109106 if (initPixelsFile)
110107 {
111108 LocalFS targetStorage;
112- targetFileName =
113- std::to_string (std::chrono::system_clock::to_time_t (std::chrono::system_clock::now ())) +
114- " .pxl" ;
109+ targetFileName = std::to_string (std::chrono::system_clock::to_time_t (std::chrono::system_clock::now ())) + \
110+ " _" + std::to_string (this ->loadedFiles .size ()) + " .pxl" ;
115111 targetFilePath = targetPath + targetFileName;
116112 pixelsWriter = std::make_shared<PixelsWriterImpl>(schema, pixelsStride, rowGroupSize,
117113 targetFilePath, blockSize,
118114 true , encodingLevel, nullPadding, false , 1 );
119115 }
120116 initPixelsFile = false ;
121-
122117 ++rowBatch->rowCount ;
123118 ++rowCounter;
124119
@@ -149,7 +144,7 @@ void PixelsConsumer::run()
149144 rowBatch->reset ();
150145 }
151146
152- // 创建一个新的文件
147+ // create a new file
153148 if (rowCounter >= maxRowNum)
154149 {
155150 if (rowBatch->rowCount != 0 )
@@ -159,13 +154,14 @@ void PixelsConsumer::run()
159154 }
160155 pixelsWriter->close ();
161156 this ->loadedFiles .push_back (targetFilePath);
157+ std::cout << " Generate file: " << targetFilePath << std::endl;
162158 rowCounter = 0 ;
163159 initPixelsFile = true ;
164160 }
165161 }
166162 }
167163 }
168- // 剩余line写入文件
164+ // write the remaining lines
169165 if (rowCounter > 0 )
170166 {
171167 if (rowBatch->rowCount != 0 )
0 commit comments