@@ -101,19 +101,22 @@ public void testSimplePatternAggregationMode() throws IOException {
101101 result ,
102102 schema ("pattern_count" , "bigint" ),
103103 schema ("patterns_field" , "string" ),
104- schema ("tokens" , "struct" ));
104+ schema ("tokens" , "struct" ),
105+ schema ("sample_logs" , "array" ));
105106 verifyDataRows (
106107 result ,
107108 rows (
108- 7 ,
109109 "<token1>@<token2>.<token3>" ,
110+ 7 ,
110111 ImmutableMap .of (
111112 "<token1>" ,
112113 ImmutableList .of ("amberduke" , "hattiebond" , "nanettebates" ),
113114 "<token2>" ,
114115 ImmutableList .of ("pyrami" , "netagy" , "quility" ),
115116 "<token3>" ,
116- ImmutableList .of ("com" , "com" , "com" ))));
117+ ImmutableList .of ("com" , "com" , "com" )),
118+ ImmutableList .of (
119+ 117120 }
118121
119122 @ Test
@@ -181,7 +184,8 @@ public void testBrainAggregationMode() throws IOException {
181184 result ,
182185 schema ("patterns_field" , "string" ),
183186 schema ("pattern_count" , "bigint" ),
184- schema ("tokens" , "struct" ));
187+ schema ("tokens" , "struct" ),
188+ schema ("sample_logs" , "array" ));
185189 verifyDataRows (
186190 result ,
187191 rows (
@@ -191,7 +195,10 @@ public void testBrainAggregationMode() throws IOException {
191195 "<token1>" ,
192196 ImmutableList .of ("for" , "for" ),
193197 "<token2>" ,
194- ImmutableList .of ("-1547954353065580372" , "6996194389878584395" ))),
198+ ImmutableList .of ("-1547954353065580372" , "6996194389878584395" )),
199+ ImmutableList .of (
200+ "Verification succeeded for blk_-1547954353065580372" ,
201+ "Verification succeeded for blk_6996194389878584395" )),
195202 rows (
196203 "BLOCK* NameSystem.addStoredBlock: blockMap updated: <token1> is added to blk_<token2>"
197204 + " size <token3>" ,
@@ -202,7 +209,12 @@ public void testBrainAggregationMode() throws IOException {
202209 "<token3>" ,
203210 ImmutableList .of ("67108864" , "67108864" ),
204211 "<token2>" ,
205- ImmutableList .of ("-7017553867379051457" , "-3249711809227781266" ))),
212+ ImmutableList .of ("-7017553867379051457" , "-3249711809227781266" )),
213+ ImmutableList .of (
214+ "BLOCK* NameSystem.addStoredBlock: blockMap updated: 10.251.31.85:50010 is added to"
215+ + " blk_-7017553867379051457 size 67108864" ,
216+ "BLOCK* NameSystem.addStoredBlock: blockMap updated: 10.251.107.19:50010 is added"
217+ + " to blk_-3249711809227781266 size 67108864" )),
206218 rows (
207219 "<token1> NameSystem.allocateBlock:"
208220 + " /user/root/sortrand/_temporary/_task_<token2>_<token3>_r_<token4>_<token5>/part<token6>"
@@ -222,15 +234,25 @@ public void testBrainAggregationMode() throws IOException {
222234 "<token3>" ,
223235 ImmutableList .of ("0002" , "0002" ),
224236 "<token2>" ,
225- ImmutableList .of ("200811092030" , "200811092030" ))),
237+ ImmutableList .of ("200811092030" , "200811092030" )),
238+ ImmutableList .of (
239+ "BLOCK* NameSystem.allocateBlock:"
240+ + " /user/root/sortrand/_temporary/_task_200811092030_0002_r_000296_0/part-00296."
241+ + " blk_-6620182933895093708" ,
242+ "BLOCK* NameSystem.allocateBlock:"
243+ + " /user/root/sortrand/_temporary/_task_200811092030_0002_r_000318_0/part-00318."
244+ + " blk_2096692261399680562" )),
226245 rows (
227246 "PacketResponder failed <token1> blk_<token2>" ,
228247 2 ,
229248 ImmutableMap .of (
230249 "<token1>" ,
231250 ImmutableList .of ("for" , "for" ),
232251 "<token2>" ,
233- ImmutableList .of ("6996194389878584395" , "-1547954353065580372" ))));
252+ ImmutableList .of ("6996194389878584395" , "-1547954353065580372" )),
253+ ImmutableList .of (
254+ "PacketResponder failed for blk_6996194389878584395" ,
255+ "PacketResponder failed for blk_-1547954353065580372" )));
234256 }
235257
236258 @ Test
@@ -242,20 +264,25 @@ public void testBrainAggregationModeWithGroupByClause() throws IOException {
242264 + " mode=aggregation max_sample_count=5"
243265 + " variable_count_threshold=2 frequency_threshold_percentage=0.2" ,
244266 TEST_INDEX_HDFS_LOGS ));
267+ System .out .println (result );
245268 verifySchema (
246269 result ,
247270 schema ("level" , "string" ),
248271 schema ("patterns_field" , "string" ),
249272 schema ("pattern_count" , "bigint" ),
250- schema ("tokens" , "struct" ));
273+ schema ("tokens" , "struct" ),
274+ schema ("sample_logs" , "array" ));
251275 verifyDataRows (
252276 result ,
253277 rows (
254278 "INFO" ,
255279 "Verification succeeded for blk_<token1>" ,
256280 2 ,
257281 ImmutableMap .of (
258- "<token1>" , ImmutableList .of ("-1547954353065580372" , "6996194389878584395" ))),
282+ "<token1>" , ImmutableList .of ("-1547954353065580372" , "6996194389878584395" )),
283+ ImmutableList .of (
284+ "Verification succeeded for blk_-1547954353065580372" ,
285+ "Verification succeeded for blk_6996194389878584395" )),
259286 rows (
260287 "INFO" ,
261288 "BLOCK* NameSystem.addStoredBlock: blockMap updated: <token1> is added to blk_<token2>"
@@ -267,7 +294,12 @@ public void testBrainAggregationModeWithGroupByClause() throws IOException {
267294 "<token3>" ,
268295 ImmutableList .of ("67108864" , "67108864" ),
269296 "<token2>" ,
270- ImmutableList .of ("-7017553867379051457" , "-3249711809227781266" ))),
297+ ImmutableList .of ("-7017553867379051457" , "-3249711809227781266" )),
298+ ImmutableList .of (
299+ "BLOCK* NameSystem.addStoredBlock: blockMap updated: 10.251.31.85:50010 is added to"
300+ + " blk_-7017553867379051457 size 67108864" ,
301+ "BLOCK* NameSystem.addStoredBlock: blockMap updated: 10.251.107.19:50010 is added"
302+ + " to blk_-3249711809227781266 size 67108864" )),
271303 rows (
272304 "INFO" ,
273305 "BLOCK* NameSystem.allocateBlock:"
@@ -286,13 +318,23 @@ public void testBrainAggregationModeWithGroupByClause() throws IOException {
286318 "<token3>" ,
287319 ImmutableList .of ("000296" , "000318" ),
288320 "<token2>" ,
289- ImmutableList .of ("0002" , "0002" ))),
321+ ImmutableList .of ("0002" , "0002" )),
322+ ImmutableList .of (
323+ "BLOCK* NameSystem.allocateBlock:"
324+ + " /user/root/sortrand/_temporary/_task_200811092030_0002_r_000296_0/part-00296."
325+ + " blk_-6620182933895093708" ,
326+ "BLOCK* NameSystem.allocateBlock:"
327+ + " /user/root/sortrand/_temporary/_task_200811092030_0002_r_000318_0/part-00318."
328+ + " blk_2096692261399680562" )),
290329 rows (
291330 "WARN" ,
292331 "PacketResponder failed for blk_<token1>" ,
293332 2 ,
294333 ImmutableMap .of (
295- "<token1>" , ImmutableList .of ("6996194389878584395" , "-1547954353065580372" ))));
334+ "<token1>" , ImmutableList .of ("6996194389878584395" , "-1547954353065580372" )),
335+ ImmutableList .of (
336+ "PacketResponder failed for blk_6996194389878584395" ,
337+ "PacketResponder failed for blk_-1547954353065580372" )));
296338 }
297339
298340 @ Test
0 commit comments