首页 > 代码库 > 调用findExtensions,null在缓存中保存null
调用findExtensions,null在缓存中保存null
privateList<Extension> findExtensions(String scope) {
String[] orders = null;
String orderlist = conf.get("urlnormalizer.order." +scope);
if (orderlist ==null)
orderlist = conf.get("urlnormalizer.order");
if (orderlist !=null&& !orderlist.trim().equals("")) {
orders = orderlist.split("\\s+");
}
String scopelist = conf.get("urlnormalizer.scope." +scope);
Set<String> impls = null;
if (scopelist !=null&& !scopelist.trim().equals("")) {
String[] names = scopelist.split("\\s+");
impls = newHashSet<String>(Arrays.asList(names));
}
Extension[] extensions = this.extensionPoint.getExtensions();
HashMap<String, Extension>normalizerExtensions =
newHashMap<String, Extension>();
for (int i =0; i < extensions.length; i++) {
Extension extension = extensions[i];
if(impls !=null &&!impls.contains(extension.getClazz()))
continue;
normalizerExtensions.put(extension.getClazz(),extension);
}
List<Extension> res = newArrayList<Extension>();
if (orders ==null) {
res.addAll(normalizerExtensions.values());
} else {
// first add those explicitlynamed in correct order
for (int i =0; i < orders.length; i++) {
Extension e =normalizerExtensions.get(orders[i]);
if (e!=null) {
res.add(e);
normalizerExtensions.remove(orders[i]);
}
}
// then add all others inrandom order
res.addAll(normalizerExtensions.values());
}
return res;
}
关于scope可以看一下注释You can define a set of contexts (orscopes) in which normalizers may be called. Each scope can have its own list ofnormalizers (defined in "urlnormalizer.scope.<scope_name>"property) and its own order (defined in "urlnormalizer.order.<scope_name>" property). If any ofthese properties are missing, default settings are used for the global scope.,大意是你可以再定义一个更小的域,处理关于这个子域的特征情况,比如在Injector中调用,可以指定urlnormalizer.order.injector。默认情况下,在injector域中,在配置中使用的是默认的urlnormalizer.order,相应的配置在nutch-default中:
http://c.tieba.baidu.com/p/3287886872
http://c.tieba.baidu.com/p/3287885401
http://c.tieba.baidu.com/p/3287891014
http://c.tieba.baidu.com/p/3287894734
http://c.tieba.baidu.com/p/3287893654
http://c.tieba.baidu.com/p/3287897373
http://c.tieba.baidu.com/p/3287902345
http://c.tieba.baidu.com/p/3287906291
http://c.tieba.baidu.com/p/3287910568
http://c.tieba.baidu.com/p/3287919167
http://c.tieba.baidu.com/p/3287947238
http://c.tieba.baidu.com/p/3287886872
http://c.tieba.baidu.com/p/3287885401
http://c.tieba.baidu.com/p/3287891014
http://c.tieba.baidu.com/p/3287894734
http://c.tieba.baidu.com/p/3287893654
http://c.tieba.baidu.com/p/3287897373
http://c.tieba.baidu.com/p/3287902345
http://c.tieba.baidu.com/p/3287906291
http://c.tieba.baidu.com/p/3287910568
http://c.tieba.baidu.com/p/3287947238
http://c.tieba.baidu.com/p/3287915442
http://c.tieba.baidu.com/p/3287908920
http://c.tieba.baidu.com/p/3287947238
http://c.tieba.baidu.com/p/3287915442
http://c.tieba.baidu.com/p/3287908920
http://c.tieba.baidu.com/p/3287902345
http://c.tieba.baidu.com/p/3287894734
http://c.tieba.baidu.com/p/3287893654
http://c.tieba.baidu.com/p/3287886872
http://c.tieba.baidu.com/p/3287835793
http://c.tieba.baidu.com/p/3287835519
http://c.tieba.baidu.com/p/3287834593
http://c.tieba.baidu.com/p/3287833984
http://c.tieba.baidu.com/p/3287833891
http://c.tieba.baidu.com/p/3287910568
http://c.tieba.baidu.com/p/3287906291
http://c.tieba.baidu.com/p/3287897373
http://c.tieba.baidu.com/p/3287891014
http://c.tieba.baidu.com/p/3287885401
http://c.tieba.baidu.com/p/3287835415
http://c.tieba.baidu.com/p/3287835273
http://c.tieba.baidu.com/p/3287834837
http://c.tieba.baidu.com/p/3287833182
http://c.tieba.baidu.com/p/3287832869
http://c.tieba.baidu.com/p/3287863639
http://c.tieba.baidu.com/p/3287865962
http://c.tieba.baidu.com/p/3287867705
http://c.tieba.baidu.com/p/3287871897
http://c.tieba.baidu.com/p/3289337737
http://c.tieba.baidu.com/p/3289480623
http://c.tieba.baidu.com/p/3289491924
http://c.tieba.baidu.com/p/3289506867
http://c.tieba.baidu.com/p/3289514153
http://c.tieba.baidu.com/p/3289524007
http://c.tieba.baidu.com/p/3289533997
http://c.tieba.baidu.com/p/3289726611
http://c.tieba.baidu.com/p/3289715665
http://c.tieba.baidu.com/p/3289719344
http://c.tieba.baidu.com/p/3289702314
http://c.tieba.baidu.com/p/3289351640
http://c.tieba.baidu.com/p/3289354239
http://c.tieba.baidu.com/p/3289357618
http://c.tieba.baidu.com/p/3289360491
http://c.tieba.baidu.com/p/3289363767
http://c.tieba.baidu.com/p/3289366190
http://c.tieba.baidu.com/p/3289368499
http://c.tieba.baidu.com/p/3289370398
http://c.tieba.baidu.com/p/3289372033
http://c.tieba.baidu.com/p/3289418341
http://c.tieba.baidu.com/p/3289420107
http://c.tieba.baidu.com/p/3289421552
http://c.tieba.baidu.com/p/3289423069
http://c.tieba.baidu.com/p/3289424924
http://c.tieba.baidu.com/p/3289426536
http://c.tieba.baidu.com/p/3289581319
http://c.tieba.baidu.com/p/3289583386
http://c.tieba.baidu.com/p/3289585263
http://c.tieba.baidu.com/p/3289587527
http://c.tieba.baidu.com/p/3289588623
http://c.tieba.baidu.com/p/3289590818
http://c.tieba.baidu.com/p/3289592094
http://c.tieba.baidu.com/p/3289593055
http://c.tieba.baidu.com/p/3295441401
http://c.tieba.baidu.com/p/3295441901
http://c.tieba.baidu.com/p/3295442895
http://c.tieba.baidu.com/p/3295444026
http://c.tieba.baidu.com/p/3295444525
绝世武神吧
http://c.tieba.baidu.com/p/3289715665
http://c.tieba.baidu.com/p/3289719344
iphone吧
http://c.tieba.baidu.com/p/3289726611
移动吧
http://c.tieba.baidu.com/p/3289702314
15号发的
http://c.tieba.baidu.com/p/3295449552
http://c.tieba.baidu.com/p/3295450382
http://c.tieba.baidu.com/p/3295451770
http://c.tieba.baidu.com/p/3295453523
http://c.tieba.baidu.com/p/3295453963
http://c.tieba.baidu.com/p/3295454601
http://c.tieba.baidu.com/p/3295455033
http://c.tieba.baidu.com/p/3295459848
http://c.tieba.baidu.com/p/3295461736
http://c.tieba.baidu.com/p/3295462149
http://c.tieba.baidu.com/p/3295462432
http://c.tieba.baidu.com/p/3295462844
http://c.tieba.baidu.com/p/3295453114
http://c.tieba.baidu.com/p/3295450816
http://c.tieba.baidu.com/p/3295452816
http://c.tieba.baidu.com/p/3295467857
http://c.tieba.baidu.com/p/3295467857
http://c.tieba.baidu.com/p/3295469396
http://c.tieba.baidu.com/p/3295469750
http://c.tieba.baidu.com/p/3295470245
http://c.tieba.baidu.com/p/3295470567
http://c.tieba.baidu.com/p/3295471013
http://c.tieba.baidu.com/p/3295471417
http://c.tieba.baidu.com/p/3295471792
http://c.tieba.baidu.com/p/3295472980
http://c.tieba.baidu.com/p/3295472154
http://c.tieba.baidu.com/p/3287912904
http://c.tieba.baidu.com/p/3289307430
http://c.tieba.baidu.com/p/3287940894
http://c.tieba.baidu.com/p/3287930966
http://c.tieba.baidu.com/p/3289313931
http://c.tieba.baidu.com/p/3298442254
http://c.tieba.baidu.com/p/3298449553
http://c.tieba.baidu.com/p/3298453984
http://c.tieba.baidu.com/p/3298459151
http://c.tieba.baidu.com/p/3298468381
http://c.tieba.baidu.com/p/3298472107
http://c.tieba.baidu.com/p/3298484352
http://c.tieba.baidu.com/p/3298493142
http://c.tieba.baidu.com/p/3298496208
http://c.tieba.baidu.com/p/3298501770
http://c.tieba.baidu.com/p/3298507265
http://c.tieba.baidu.com/p/3298513514
http://c.tieba.baidu.com/p/3298525913
http://c.tieba.baidu.com/p/3298530374
http://c.tieba.baidu.com/p/3298533554
http://c.tieba.baidu.com/p/3298541009
http://c.tieba.baidu.com/p/3298559351
http://c.tieba.baidu.com/p/3298562514
http://c.tieba.baidu.com/p/3298570348
http://c.tieba.baidu.com/p/3298576015
http://c.tieba.baidu.com/p/3298580254
http://c.tieba.baidu.com/p/3298584206
http://c.tieba.baidu.com/p/3298589689
http://c.tieba.baidu.com/p/3298597855
http://c.tieba.baidu.com/p/3298604428
http://c.tieba.baidu.com/p/3298608859
http://c.tieba.baidu.com/p/3298538849
http://c.tieba.baidu.com/p/3298650431
http://c.tieba.baidu.com/p/3298657919
http://c.tieba.baidu.com/p/3298666329
http://c.tieba.baidu.com/p/3298669665
http://c.tieba.baidu.com/p/3304892016
http://c.tieba.baidu.com/p/3304888939
http://c.tieba.baidu.com/p/3304886977
http://c.tieba.baidu.com/p/3304883511
http://c.tieba.baidu.com/p/3304865638
http://c.tieba.baidu.com/p/3304862984
http://c.tieba.baidu.com/p/3304860292
http://c.tieba.baidu.com/p/3304851576
http://c.tieba.baidu.com/p/3304922988
http://c.tieba.baidu.com/p/3304926836
http://c.tieba.baidu.com/p/3304928496
http://c.tieba.baidu.com/p/3304930842
http://c.tieba.baidu.com/p/3304933688
http://c.tieba.baidu.com/p/3304935601
http://c.tieba.baidu.com/p/3304937038
http://c.tieba.baidu.com/p/3304938839
http://c.tieba.baidu.com/p/3304940633
http://c.tieba.baidu.com/p/3304942982
http://c.tieba.baidu.com/p/3304944718
http://c.tieba.baidu.com/p/3304946122
http://c.tieba.baidu.com/p/3304947593
http://c.tieba.baidu.com/p/3304949670
http://c.tieba.baidu.com/p/3304951440
http://c.tieba.baidu.com/p/3304959760
http://c.tieba.baidu.com/p/3304960993
http://c.tieba.baidu.com/p/3304962762
http://c.tieba.baidu.com/p/3304964853
http://c.tieba.baidu.com/p/3304967420
http://c.tieba.baidu.com/p/3304968366
http://c.tieba.baidu.com/p/3305021494
http://c.tieba.baidu.com/p/3305023886
http://c.tieba.baidu.com/p/3305095344
http://c.tieba.baidu.com/p/3305097954
http://c.tieba.baidu.com/p/3305100697
http://c.tieba.baidu.com/p/3305103600
http://c.tieba.baidu.com/p/3305105795
http://c.tieba.baidu.com/p/3305110305
http://c.tieba.baidu.com/p/3305112079
http://c.tieba.baidu.com/p/3305115018
http://c.tieba.baidu.com/p/3305117117
http://c.tieba.baidu.com/p/3305118990
http://c.tieba.baidu.com/p/3305117117
http://c.tieba.baidu.com/p/3305123204
http://c.tieba.baidu.com/p/3305123924
http://c.tieba.baidu.com/p/3305124673
http://c.tieba.baidu.com/p/3305130305
http://c.tieba.baidu.com/p/3305133378
http://c.tieba.baidu.com/p/3305136460
http://c.tieba.baidu.com/p/3305140204
http://c.tieba.baidu.com/p/3305142732
http://c.tieba.baidu.com/p/3305148596
http://c.tieba.baidu.com/p/3307592959
http://c.tieba.baidu.com/p/3307598147
http://c.tieba.baidu.com/p/3307596808
http://c.tieba.baidu.com/p/3307595543
http://c.tieba.baidu.com/p/3307589911
http://c.tieba.baidu.com/p/3307575601
http://c.tieba.baidu.com/p/3307574292
http://c.tieba.baidu.com/p/3307573181
http://c.tieba.baidu.com/p/3307599600
http://c.tieba.baidu.com/p/3307572155
http://c.tieba.baidu.com/p/3307571985
http://c.tieba.baidu.com/p/3307570871
http://c.tieba.baidu.com/p/3307633551
http://c.tieba.baidu.com/p/3307635184
http://c.tieba.baidu.com/p/3307637198
http://c.tieba.baidu.com/p/3307639785
http://c.tieba.baidu.com/p/3307690263
http://c.tieba.baidu.com/p/3307681537
http://c.tieba.baidu.com/p/3307682188
http://c.tieba.baidu.com/p/3307685241
http://c.tieba.baidu.com/p/3307683736
http://c.tieba.baidu.com/p/3307688228
http://c.tieba.baidu.com/p/3307713062
http://c.tieba.baidu.com/p/3307701022
http://c.tieba.baidu.com/p/3307702208
http://c.tieba.baidu.com/p/3307703382
http://c.tieba.baidu.com/p/3307704507
http://c.tieba.baidu.com/p/3307705425
http://c.tieba.baidu.com/p/3307707187
http://c.tieba.baidu.com/p/3307708657
http://c.tieba.baidu.com/p/3307710243
http://c.tieba.baidu.com/p/3307712001
http://c.tieba.baidu.com/p/3307759394
http://c.tieba.baidu.com/p/3307748452
http://c.tieba.baidu.com/p/3307755890
http://c.tieba.baidu.com/p/3307769257
http://c.tieba.baidu.com/p/3307771604
http://c.tieba.baidu.com/p/3307772939
http://c.tieba.baidu.com/p/3307786547
http://c.tieba.baidu.com/p/3307777773
http://c.tieba.baidu.com/p/3307781654
http://c.tieba.baidu.com/p/3307783360
http://c.tieba.baidu.com/p/3307784884
http://c.tieba.baidu.com/p/3307791992
http://c.tieba.baidu.com/p/3307793304
http://c.tieba.baidu.com/p/3307789542
http://c.tieba.baidu.com/p/3307790711
http://c.tieba.baidu.com/p/3307795295
http://c.tieba.baidu.com/p/3307796936
http://tieba.baidu.com/p/3307920840
http://tieba.baidu.com/p/3307922036
http://tieba.baidu.com/p/3307923517
http://tieba.baidu.com/p/3307925568
http://tieba.baidu.com/p/3307931717
http://tieba.baidu.com/p/3307935717
http://tieba.baidu.com/p/3307938086
http://tieba.baidu.com/p/3307939842
http://tieba.baidu.com/p/3307942190
http://tieba.baidu.com/p/3307944856
http://tieba.baidu.com/p/3307946786
http://tieba.baidu.com/p/3307948576
http://tieba.baidu.com/p/3308319497
http://tieba.baidu.com/p/3308318200
http://tieba.baidu.com/p/3308317098
http://tieba.baidu.com/p/3308317492
http://tieba.baidu.com/p/3308317799
http://tieba.baidu.com/p/3308318713
http://tieba.baidu.com/p/3308323022
http://tieba.baidu.com/p/3308323444
http://tieba.baidu.com/p/3308323869
http://tieba.baidu.com/p/3308325622
http://tieba.baidu.com/p/3308325973
http://tieba.baidu.com/p/3308326446
http://tieba.baidu.com/p/3308331845
http://tieba.baidu.com/p/3308332079
http://tieba.baidu.com/p/3308332240
http://tieba.baidu.com/p/3308332846
http://tieba.baidu.com/p/3308333483
http://tieba.baidu.com/p/3308334909
http://tieba.baidu.com/p/3308334932
http://tieba.baidu.com/p/3308335703
调用findExtensions,null在缓存中保存null