All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.tinkerpop.gremlin.hadoop.structure.io.script.ScriptOutputFormat Maven / Gradle / Ivy

The newest version!
package com.tinkerpop.gremlin.hadoop.structure.io.script;

import com.tinkerpop.gremlin.hadoop.structure.io.CommonFileOutputFormat;
import com.tinkerpop.gremlin.hadoop.structure.io.VertexWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.mapreduce.RecordWriter;
import org.apache.hadoop.mapreduce.TaskAttemptContext;

import java.io.DataOutputStream;
import java.io.IOException;

/**
 * @author Daniel Kuppitz (daniel at thinkaurelius.com)
 */
public class ScriptOutputFormat extends CommonFileOutputFormat {

    @Override
    public RecordWriter getRecordWriter(final TaskAttemptContext job) throws IOException, InterruptedException {
        return getRecordWriter(job, getDataOuputStream(job));
    }

    public RecordWriter getRecordWriter(final TaskAttemptContext job, final DataOutputStream outputStream) throws IOException, InterruptedException {
        return new ScriptRecordWriter(outputStream, job);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy