Package org.apache.hadoop.io

Examples of org.apache.hadoop.io.ObjectWritable


     */
    public void map(Text key, Writable value,
      OutputCollector<Text, ObjectWritable> output, Reporter reporter)
      throws IOException {

      ObjectWritable objWrite = new ObjectWritable();
      objWrite.set(value);
      output.collect(key, objWrite);
    }
View Full Code Here


      Node node = null;
      List<LinkDatum> outlinkList = new ArrayList<LinkDatum>();

      // collect all outlinks and assign node
      while (values.hasNext()) {
        ObjectWritable objWrite = values.next();
        Object obj = objWrite.get();
        if (obj instanceof LinkDatum) {
          outlinkList.add((LinkDatum)obj);
        }
        else if (obj instanceof Node) {
          node = (Node)obj;
View Full Code Here

     */
    public void map(Text key, Writable value,
      OutputCollector<Text, ObjectWritable> output, Reporter reporter)
      throws IOException {

      ObjectWritable objWrite = new ObjectWritable();
      Writable cloned = null;
      if (value instanceof LinkDatum) {
        cloned = new Text(((LinkDatum)value).getUrl());
      }
      else {
        cloned = WritableUtils.clone(value, conf);
      }
      objWrite.set(cloned);
      output.collect(key, objWrite);
    }
View Full Code Here

      Set<String> outlinkUrls = new LinkedHashSet<String>();
      int numValues = 0;

      // aggregate all routes and outlinks for a given url
      while (values.hasNext()) {
        ObjectWritable next = values.next();
        Object value = next.get();
        if (value instanceof Route) {
          routeList.add((Route)WritableUtils.clone((Route)value, conf));
        }
        else if (value instanceof Text) {
          String outlinkUrl = ((Text)value).toString();
View Full Code Here

   */
  public void map(Text key, Writable value,
    OutputCollector<Text, ObjectWritable> output, Reporter reporter)
    throws IOException {

    ObjectWritable objWrite = new ObjectWritable();
    objWrite.set(value);
    output.collect(key, objWrite);
  }
View Full Code Here

    CrawlDatum datum = null;

    // set the node and the crawl datum, should be one of each unless no node
    // for url in the crawldb
    while (values.hasNext()) {
      ObjectWritable next = values.next();
      Object value = next.get();
      if (value instanceof Node) {
        node = (Node)value;
      }
      else if (value instanceof CrawlDatum) {
        datum = (CrawlDatum)value;
View Full Code Here

                    return 0.0f;
            }

            @Override
            public Object createKey() {
                return new ObjectWritable();
            }

            @Override
            public Object createValue() {
                return new ObjectWritable();
            }

            @Override
            public long getPos() throws IOException {
                if (isReadingDone) {
View Full Code Here

    public void readFields(DataInput in) throws IOException {
      methodName = Text.readString(in);
      parameters = new Object[in.readInt()];
      parameterClasses = new Class[parameters.length];
      ObjectWritable objectWritable = new ObjectWritable();
      for (int i = 0; i < parameters.length; i++) {
        parameters[i] = ObjectWritable
            .readObject(in, objectWritable, this.conf);
        parameterClasses[i] = objectWritable.getDeclaredClass();
      }
    }
View Full Code Here

      long startTime = 0;
      if (logDebug) {
        startTime = System.currentTimeMillis();
      }

      ObjectWritable value = (ObjectWritable) client.call(new Invocation(
          method, args), remoteId);
      if (logDebug) {
        long callTime = System.currentTimeMillis() - startTime;
        LOG.debug("Call: " + method.getName() + " " + callTime);
      }
      return value.get();
    }
View Full Code Here

              + " procesingTime= " + processingTime);
        }
        if (verbose)
          log("Return: " + value);

        return new ObjectWritable(method.getReturnType(), value);

      } catch (InvocationTargetException e) {
        Throwable target = e.getTargetException();
        if (target instanceof IOException) {
          throw (IOException) target;
View Full Code Here

TOP

Related Classes of org.apache.hadoop.io.ObjectWritable

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.