Package com.commons

Examples of com.commons.UrlData


                if (Div.class.equals(tag.getClass())
                    && "con".equals(tag
                        .getAttribute("class"))) {
                  tag.accept(new NodeVisitor() {
                    public void visitTag(Tag tag) {
                      UrlData data = new UrlData();
                      if (LinkTag.class.equals(tag
                          .getClass())) {
                        data.setUrlName(tag
                            .getAttribute("title"));
                        data.setUrl(tag
                            .getAttribute("href"));
                        try {
                          LoggerUtils
                              .log(DigitalUrlGetter.class
                                  .getName(),
                                  data.toString());
                        } catch (IOException e) {
                          // TODO Auto-generated catch
                          e.printStackTrace();
                        }
                        System.out.println(data);
View Full Code Here


      Text value,
      org.apache.hadoop.mapreduce.Mapper<Object, Text, Text, Text>.Context context)
      throws IOException, InterruptedException {
    LoggerUtils.log(DataGettingMapper.class.getName(), "map key:" + key
        + " value:" + value);
    UrlData data = new UrlData();
    data.decode(value.toString());
    Text outputKey = new Text();
    outputKey.set(data.getUrlName());
    Text url = new Text();
    url.set(data.getUrl());
    context.write(outputKey, url);
  }
View Full Code Here

TOP

Related Classes of com.commons.UrlData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.