public void dumpNodes(Path webGraphDb,DumpType type,long topN,Path output,boolean asEff,NameType nameType,AggrType aggrType,boolean asSequenceFile) throws Exception {
  SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  long start=System.currentTimeMillis();
  LOG.info("NodeDumper: starting at " + sdf.format(start));
  Path nodeDb=new Path(webGraphDb,WebGraph.NODE_DIR);
  Configuration conf=getConf();
  JobConf dumper=new NutchJob(conf);
  dumper.setJobName("NodeDumper: " + webGraphDb);
  FileInputFormat.addInputPath(dumper,nodeDb);
  dumper.setInputFormat(SequenceFileInputFormat.class);
  if (nameType == null) {
    dumper.setMapperClass(Sorter.class);
    dumper.setReducerClass(Sorter.class);
    dumper.setMapOutputKeyClass(FloatWritable.class);
    dumper.setMapOutputValueClass(Text.class);
  }
 else {
    dumper.setMapperClass(Dumper.class);
    dumper.setReducerClass(Dumper.class);
    dumper.setMapOutputKeyClass(Text.class);
    dumper.setMapOutputValueClass(FloatWritable.class);
  }
  dumper.setOutputKeyClass(Text.class);
  dumper.setOutputValueClass(FloatWritable.class);
  FileOutputFormat.setOutputPath(dumper,output);
  if (asSequenceFile) {
    dumper.setOutputFormat(SequenceFileOutputFormat.class);
  }
 else {
    dumper.setOutputFormat(TextOutputFormat.class);
  }
  dumper.setNumReduceTasks(1);
  dumper.setBoolean("inlinks",type == DumpType.INLINKS);
  dumper.setBoolean("outlinks",type == DumpType.OUTLINKS);
  dumper.setBoolean("scores",type == DumpType.SCORES);
  dumper.setBoolean("host",nameType == NameType.HOST);
  dumper.setBoolean("domain",nameType == NameType.DOMAIN);
  dumper.setBoolean("sum",aggrType == AggrType.SUM);
  dumper.setBoolean("max",aggrType == AggrType.MAX);
  dumper.setLong("topn",topN);
  if (asEff) {
    dumper.set("mapred.textoutputformat.separator","=");
  }
  try {
    LOG.info("NodeDumper: running");
    JobClient.runJob(dumper);
  }
 catch (  IOException e) {
    LOG.error(StringUtils.stringifyException(e));
    throw e;
  }
  long end=System.currentTimeMillis();
  LOG.info("NodeDumper: finished at " + sdf.format(end) + ", elapsed: "+ TimingUtil.elapsedTime(start,end));
}

public void dumpNodes ( Path webGraphDb , DumpType type , long topN , Path output , boolean asEff , NameType nameType , AggrType aggrType , boolean asSequenceFile ) throws Exception { SimpleDateFormat sdf = new SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) ; long start = System . currentTimeMillis ( ) ; LOG . info ( "NodeDumper: starting at " + sdf . format ( start ) ) ; Path nodeDb = new Path ( webGraphDb , WebGraph . NODE_DIR ) ; Configuration conf = getConf ( ) ; JobConf dumper = new NutchJob ( conf ) ; dumper . setJobName ( "NodeDumper: " + webGraphDb ) ; FileInputFormat . addInputPath ( dumper , nodeDb ) ; dumper . setInputFormat ( SequenceFileInputFormat . class ) ; if ( nameType == null ) { dumper . setMapperClass ( Sorter . class ) ; dumper . setReducerClass ( Sorter . class ) ; dumper . setMapOutputKeyClass ( FloatWritable . class ) ; dumper . setMapOutputValueClass ( Text . class ) ; } else { dumper . setMapperClass ( Dumper . class ) ; dumper . setReducerClass ( Dumper . class ) ; dumper . setMapOutputKeyClass ( Text . class ) ; dumper . setMapOutputValueClass ( FloatWritable . class ) ; } dumper . setOutputKeyClass ( Text . class ) ; dumper . setOutputValueClass ( FloatWritable . class ) ; FileOutputFormat . setOutputPath ( dumper , output ) ; if ( asSequenceFile ) { dumper . setOutputFormat ( SequenceFileOutputFormat . class ) ; } else { dumper . setOutputFormat ( TextOutputFormat . class ) ; } dumper . setNumReduceTasks ( 1 ) ; dumper . setBoolean ( "inlinks" , type == DumpType . INLINKS ) ; dumper . setBoolean ( "outlinks" , type == DumpType . OUTLINKS ) ; dumper . setBoolean ( "scores" , type == DumpType . SCORES ) ; dumper . setBoolean ( "host" , nameType == NameType . HOST ) ; dumper . setBoolean ( "domain" , nameType == NameType . DOMAIN ) ; dumper . setBoolean ( "sum" , aggrType == AggrType . SUM ) ; dumper . setBoolean ( "max" , aggrType == AggrType . MAX ) ; dumper . setLong ( "topn" , topN ) ; if ( asEff ) { dumper . set ( "mapred.textoutputformat.separator" , "=" ) ; } try { LOG . info ( "NodeDumper: running" ) ; JobClient . runJob ( dumper ) ; } catch ( IOException e ) { LOG . error ( StringUtils . stringifyException ( e ) ) ; throw e ; } long end = System . currentTimeMillis ( ) ; LOG . info ( "NodeDumper: finished at " + sdf . format ( end ) + ", elapsed: " + TimingUtil . elapsedTime ( start , end ) ) ; }
runs the process to dump the top urls out to a text file .
