Example usage for org.apache.hadoop.io MapWritable MapWritable

List of usage examples for org.apache.hadoop.io MapWritable MapWritable

Introduction

In this page you can find the example usage for org.apache.hadoop.io MapWritable MapWritable.

Prototype

public MapWritable(MapWritable other) 

Source Link

Document

Copy constructor.

Usage

From source file:org.apache.giraph.types.ops.MapTypeOps.java

License:Apache License

@Override
public MapWritable createCopy(MapWritable from) {
    return new MapWritable(from);
}

From source file:org.apache.mahout.classifier.sequencelearning.baumwelchmapreduce.MapWritableCache.java

License:Apache License

/**
 * @param key SequenceFile key/*from   w  w w.j a v  a 2 s  .  co  m*/
 * @param map Map to save
 */
public static void save(Writable key, MapWritable map, Path output, Configuration conf, boolean overwritePath,
        boolean deleteOnExit) throws IOException {

    FileSystem fs = FileSystem.get(conf);
    output = fs.makeQualified(output);
    if (overwritePath) {
        HadoopUtil.delete(conf, output);
    }

    // set the cache
    DistributedCache.setCacheFiles(new URI[] { output.toUri() }, conf);

    // set up the writer
    SequenceFile.Writer writer = new SequenceFile.Writer(fs, conf, output, IntWritable.class,
            MapWritable.class);
    try {
        writer.append(key, new MapWritable(map));
    } finally {
        Closeables.closeQuietly(writer);
    }

    if (deleteOnExit) {
        fs.deleteOnExit(output);
    }
}

From source file:org.apache.nutch.util.hostdb.HostDatum.java

License:Apache License

public void setMetaData(MapWritable mapWritable) {
    this.metaData = new MapWritable(mapWritable);
}

From source file:org.commoncrawl.util.CrawlDatum.java

License:Apache License

/** Copy the contents of another instance into this instance. */
public void set(CrawlDatum that) {
    this.status = that.status;
    this.fetchTime = that.fetchTime;
    this.retries = that.retries;
    this.fetchInterval = that.fetchInterval;
    this.score = that.score;
    this.modifiedTime = that.modifiedTime;
    this.signature = that.signature;
    this.metaData = new MapWritable(that.metaData); // make a deep copy
}