@Override protected QuadWritable createInstance(Quad tuple) { return new QuadWritable(tuple); } }
@Override protected void sendOutput(TKey key, QuadWritable value, StreamRDF stream) { stream.quad(value.get()); } }
/** * Creates a new instance from the given input * * @param input * Input * @return New instance * @throws IOException */ public static QuadWritable read(DataInput input) throws IOException { QuadWritable q = new QuadWritable(); q.readFields(input); return q; }
@Override public void readFields(DataInput input) throws IOException { this.quad.clear(); int tripleLength = input.readInt(); byte[] buffer = new byte[tripleLength]; input.readFully(buffer); try { ThriftConverter.fromBytes(buffer, this.quad); } catch (TException e) { throw new IOException(e); } this.setInternal(new Quad(ThriftConvert.convert(this.quad.getG()), ThriftConvert.convert(this.quad.getS()), ThriftConvert.convert(this.quad.getP()), ThriftConvert.convert(this.quad.getO()))); }
@Override public void readFields(DataInput input) throws IOException { this.quad.clear(); int tripleLength = input.readInt(); byte[] buffer = new byte[tripleLength]; input.readFully(buffer); try { ThriftConverter.fromBytes(buffer, this.quad); } catch (TException e) { throw new IOException(e); } this.setInternal(new Quad(ThriftConvert.convert(this.quad.getG()), ThriftConvert.convert(this.quad.getS()), ThriftConvert.convert(this.quad.getP()), ThriftConvert.convert(this.quad.getO()))); }
@Override protected void sendOutput(TKey key, QuadWritable value, StreamRDF stream) { stream.quad(value.get()); } }
@Override protected QuadWritable createInstance(Quad tuple) { return new QuadWritable(tuple); } }
/** * Creates a new instance from the given input * * @param input * Input * @return New instance * @throws IOException */ public static QuadWritable read(DataInput input) throws IOException { QuadWritable q = new QuadWritable(); q.readFields(input); return q; }
@Override protected final NodeWritable selectKey(QuadWritable tuple) { return this.selectKey(tuple.get()); }
@Override protected QuadWritable createInstance(Quad tuple) { return new QuadWritable(tuple); } }
@Override protected final void add(QuadWritable value) { this.g.add(value.get()); }
@Override protected QuadWritable createInstance(Quad tuple) { return new QuadWritable(tuple); } }
@Override protected final void add(QuadWritable value) { this.g.add(value.get()); }
@Override protected QuadWritable createInstance(Quad q) { return new QuadWritable(q); }
@Override protected void map(TKey key, QuadWritable value, Context context) throws IOException, InterruptedException { context.write(key, new TripleWritable(value.get().asTriple())); }
@Override protected QuadWritable createInstance(Quad q) { return new QuadWritable(q); }
@Override protected NodeWritable[] getNodes(QuadWritable tuple) { return new NodeWritable[] { new NodeWritable(tuple.get().getSubject()) }; } }
@Override protected final void map(TKey key, TripleWritable value, Context context) throws IOException, InterruptedException { Triple triple = value.get(); Node graphNode = this.selectGraph(triple); context.write(key, new QuadWritable(new Quad(graphNode, triple))); }
@Override protected NodeWritable[] getNodes(QuadWritable tuple) { return new NodeWritable[] { new NodeWritable(tuple.get().getGraph()) }; } }
@Override public final QuadWritable getCurrentValue() throws IOException, InterruptedException { TripleWritable t = this.reader.getCurrentValue(); return new QuadWritable(new Quad(this.graph, t.get())); }