You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by rv...@apache.org on 2014/10/20 16:48:09 UTC
[47/50] [abbrv] Get Jena Hadoop RDF Tools building
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/readers/TurtleReader.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/readers/TurtleReader.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/readers/TurtleReader.java
deleted file mode 100644
index 766717f..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/readers/TurtleReader.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.input.readers;
-
-import org.apache.jena.riot.Lang;
-
-/**
- * A record reader for Turtle files
- *
- *
- *
- */
-public class TurtleReader extends AbstractWholeFileTripleReader {
-
- @Override
- protected Lang getRdfLanguage() {
- return Lang.TURTLE;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/readers/WholeFileNQuadsReader.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/readers/WholeFileNQuadsReader.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/readers/WholeFileNQuadsReader.java
deleted file mode 100644
index 1df4a90..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/readers/WholeFileNQuadsReader.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.input.readers;
-
-import org.apache.jena.riot.Lang;
-
-/**
- * A record record for NQuads
- * <p>
- * Unlike the {@link NQuadsReader} this processes files as a whole rather than
- * individual lines. This has the advantage of less parser setup overhead but
- * the disadvantage that the input cannot be split between multiple mappers.
- * </p>
- *
- *
- *
- */
-public class WholeFileNQuadsReader extends AbstractWholeFileQuadReader {
-
- @Override
- protected Lang getRdfLanguage() {
- return Lang.NQUADS;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/readers/WholeFileNTriplesReader.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/readers/WholeFileNTriplesReader.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/readers/WholeFileNTriplesReader.java
deleted file mode 100644
index d975c58..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/readers/WholeFileNTriplesReader.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.input.readers;
-
-import org.apache.jena.riot.Lang;
-
-/**
- * A record record for NTriples
- * <p>
- * Unlike the {@link NTriplesReader} this processes files as a whole rather than
- * individual lines. This has the advantage of less parser setup overhead but
- * the disadvantage that the input cannot be split between multiple mappers.
- * </p>
- *
- *
- *
- */
-public class WholeFileNTriplesReader extends AbstractWholeFileTripleReader {
-
- @Override
- protected Lang getRdfLanguage() {
- return Lang.NTRIPLES;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/BlockInputStream.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/BlockInputStream.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/BlockInputStream.java
deleted file mode 100644
index a9e692e..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/BlockInputStream.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.input.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * A block input stream which can is a wrapper around another input stream which
- * restricts reading to a specific number of bytes and can report the number of
- * bytes read
- * <p>
- * The class assumes that the underlying input stream has already been seeked to
- * the appropriate start point
- * </p>
- *
- *
- *
- */
-public final class BlockInputStream extends TrackedInputStream {
-
- private long limit = Long.MAX_VALUE;
-
- /**
- * Creates a new tracked input stream
- *
- * @param input
- * Input stream to track
- * @param limit
- * Maximum number of bytes to read from the stream
- */
- public BlockInputStream(InputStream input, long limit) {
- super(input);
- if (limit < 0)
- throw new IllegalArgumentException("limit must be >= 0");
- this.limit = limit;
- }
-
- @Override
- public int read() throws IOException {
- if (this.bytesRead >= this.limit) {
- return -1;
- }
- return super.read();
- }
-
- @Override
- public int available() throws IOException {
- if (this.bytesRead >= this.limit) {
- return 0;
- }
- return super.available();
- }
-
- @Override
- public int read(byte[] b, int off, int len) throws IOException {
- if (len == 0) {
- return 0;
- } else if (this.bytesRead >= this.limit) {
- return -1;
- } else if (len > this.limit - this.bytesRead) {
- len = (int) (this.limit - this.bytesRead);
- }
- return super.read(b, off, len);
- }
-
- @Override
- public long skip(long n) throws IOException {
- if (n == 0) {
- return 0;
- } else if (this.bytesRead >= this.limit) {
- return -1;
- } else if (n > this.limit - this.bytesRead) {
- n = this.limit - this.bytesRead;
- }
- return super.skip(n);
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/RdfIOUtils.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/RdfIOUtils.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/RdfIOUtils.java
deleted file mode 100644
index f1c9dfe..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/RdfIOUtils.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.input.util;
-
-import java.util.UUID;
-
-import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.mapreduce.JobContext;
-import org.apache.jena.hadoop.rdf.io.HadoopIOConstants;
-import org.apache.jena.riot.lang.LabelToNode;
-import org.apache.jena.riot.system.ErrorHandlerFactory;
-import org.apache.jena.riot.system.IRIResolver;
-import org.apache.jena.riot.system.ParserProfile;
-import org.apache.jena.riot.system.ParserProfileBase;
-import org.apache.jena.riot.system.Prologue;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-/**
- * RDF IO utility functions
- *
- *
- *
- */
-public class RdfIOUtils {
- private static final Logger log = LoggerFactory.getLogger(RdfIOUtils.class);
-
- /**
- * Private constructor prevents instantiation
- */
- private RdfIOUtils() {
- }
-
- /**
- * Creates a parser profile for the given job context
- *
- * @param context
- * Context
- * @param path
- * File path
- * @return Parser profile
- */
- public static ParserProfile createParserProfile(JobContext context, Path path) {
- Prologue prologue = new Prologue(null, IRIResolver.createNoResolve());
- UUID seed = RdfIOUtils.getSeed(context, path);
- LabelToNode labelMapping = LabelToNode.createScopeByDocumentHash(seed);
- return new ParserProfileBase(prologue, ErrorHandlerFactory.errorHandlerStd, labelMapping);
- }
-
- /**
- * Selects a seed for use in generating blank node identifiers
- *
- * @param context
- * Job Context
- * @param path
- * File path
- * @return Seed
- */
- public static UUID getSeed(JobContext context, Path path) {
- // This is to ensure that blank node allocation policy is constant when
- // subsequent MapReduce jobs need that
- String jobId = context.getJobID().toString();
- if (jobId == null) {
- jobId = String.valueOf(System.currentTimeMillis());
- log.warn(
- "Job ID was not set, using current milliseconds of {}. Sequence of MapReduce jobs must handle carefully blank nodes.",
- jobId);
- }
- log.debug("MapReduceAllocator({}, {})", jobId, path);
-
- // Form a reproducible seed for the run
- return new UUID(jobId.hashCode(), path.hashCode());
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/TrackableInputStream.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/TrackableInputStream.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/TrackableInputStream.java
deleted file mode 100644
index 92e2df5..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/TrackableInputStream.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.input.util;
-
-import java.io.InputStream;
-
-/**
- * An input stream that tracks the number of bytes read
- *
- *
- *
- */
-public abstract class TrackableInputStream extends InputStream {
-
- /**
- * Gets the number of bytes read
- *
- * @return Number of bytes read
- */
- public abstract long getBytesRead();
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/TrackedInputStream.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/TrackedInputStream.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/TrackedInputStream.java
deleted file mode 100644
index e51a866..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/TrackedInputStream.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.input.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * A tracked input stream which can is a wrapper around another input stream and
- * can report the number of bytes read
- *
- *
- *
- */
-public class TrackedInputStream extends TrackableInputStream {
-
- protected InputStream input;
- protected long bytesRead = 0, lastMark;
-
- /**
- * Creates a new tracked input stream
- *
- * @param input
- * Input stream to track
- */
- public TrackedInputStream(InputStream input) {
- if (input == null)
- throw new NullPointerException("Input cannot be null");
- this.input = input;
- }
-
- @Override
- public int read() throws IOException {
- int read = this.input.read();
- if (read >= 0)
- this.bytesRead++;
- return read;
- }
-
- @Override
- public long getBytesRead() {
- return this.bytesRead;
- }
-
- @Override
- public void close() throws IOException {
- this.input.close();
- }
-
- @Override
- public int available() throws IOException {
- return this.input.available();
- }
-
- @Override
- public synchronized void mark(int readlimit) {
- this.input.mark(readlimit);
- this.lastMark = this.bytesRead;
- }
-
- @Override
- public boolean markSupported() {
- return this.input.markSupported();
- }
-
- @Override
- public int read(byte[] b, int off, int len) throws IOException {
- if (len == 0) return 0;
- int read = this.input.read(b, off, len);
- if (read > 0)
- this.bytesRead += read;
- return read;
- }
-
- @Override
- public int read(byte[] b) throws IOException {
- return this.read(b, 0, b.length);
- }
-
- @Override
- public synchronized void reset() throws IOException {
- this.input.reset();
- this.bytesRead = this.lastMark;
- }
-
- @Override
- public long skip(long n) throws IOException {
- if (n == 0)
- return 0;
- long skipped = 0;
- byte[] buffer = new byte[16];
- int readSize = Math.min(buffer.length, n > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) n);
- int read;
- do {
- if (n - skipped > readSize) {
- read = this.input.read(buffer, 0, readSize);
- } else {
- read = this.input.read(buffer, 0, (int) (n - skipped));
- }
- if (read > 0) {
- this.bytesRead += read;
- skipped += read;
- }
- } while (skipped < n && read >= 0);
-
- return skipped;
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/TrackedPipedQuadsStream.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/TrackedPipedQuadsStream.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/TrackedPipedQuadsStream.java
deleted file mode 100644
index 845c709..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/TrackedPipedQuadsStream.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.input.util;
-
-import org.apache.jena.riot.lang.PipedRDFIterator;
-
-import com.hp.hpl.jena.graph.Triple;
-import com.hp.hpl.jena.sparql.core.Quad;
-
-/**
- * A tracked piped quads stream
- *
- *
- *
- */
-public class TrackedPipedQuadsStream extends TrackedPipedRDFStream<Quad> {
-
- /**
- * Creates a new stream
- *
- * @param sink
- * Sink
- * @param input
- * Input stream
- */
- public TrackedPipedQuadsStream(PipedRDFIterator<Quad> sink, TrackableInputStream input) {
- super(sink, input);
- }
-
- @Override
- public void triple(Triple triple) {
- // Triples are discarded
- }
-
- @Override
- public void quad(Quad quad) {
- this.receive(quad);
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/TrackedPipedRDFStream.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/TrackedPipedRDFStream.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/TrackedPipedRDFStream.java
deleted file mode 100644
index 6e910be..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/TrackedPipedRDFStream.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.input.util;
-
-import java.util.LinkedList;
-import java.util.Queue;
-
-import org.apache.jena.riot.lang.PipedRDFIterator;
-import org.apache.jena.riot.lang.PipedRDFStream;
-
-/**
- * A tracked piped RDF stream
- *
- *
- *
- * @param <T>
- * Type corresponding to a supported RDF primitive
- */
-public abstract class TrackedPipedRDFStream<T> extends PipedRDFStream<T> {
-
- private TrackableInputStream input;
- private Queue<Long> positions = new LinkedList<Long>();
-
- protected TrackedPipedRDFStream(PipedRDFIterator<T> sink, TrackableInputStream input) {
- super(sink);
- this.input = input;
- }
-
- @Override
- protected void receive(T t) {
- // Track positions the input stream is at as we receive inputs
- synchronized (this.positions) {
- this.positions.add(this.input.getBytesRead());
- }
- super.receive(t);
- }
-
- /**
- * Gets the next position
- *
- * @return Position
- */
- public Long getPosition() {
- synchronized (this.positions) {
- return this.positions.poll();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/TrackedPipedTriplesStream.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/TrackedPipedTriplesStream.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/TrackedPipedTriplesStream.java
deleted file mode 100644
index 2040c4f..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/input/util/TrackedPipedTriplesStream.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.input.util;
-
-import org.apache.jena.riot.lang.PipedRDFIterator;
-
-import com.hp.hpl.jena.graph.Triple;
-import com.hp.hpl.jena.sparql.core.Quad;
-
-/**
- * A tracked piped triples stream
- *
- *
- *
- */
-public class TrackedPipedTriplesStream extends TrackedPipedRDFStream<Triple> {
-
- /**
- * Creates a tracked triples stream
- *
- * @param sink
- * Sink
- * @param input
- * Input stream
- */
- public TrackedPipedTriplesStream(PipedRDFIterator<Triple> sink, TrackableInputStream input) {
- super(sink, input);
- }
-
- @Override
- public void triple(Triple triple) {
- receive(triple);
- }
-
- @Override
- public void quad(Quad quad) {
- // Quads are discarded
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/AbstractBatchedNodeTupleOutputFormat.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/AbstractBatchedNodeTupleOutputFormat.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/AbstractBatchedNodeTupleOutputFormat.java
deleted file mode 100644
index ac4ea2b..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/AbstractBatchedNodeTupleOutputFormat.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.output;
-
-import java.io.Writer;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.mapreduce.RecordWriter;
-import org.apache.jena.hadoop.rdf.io.RdfIOConstants;
-import org.apache.jena.hadoop.rdf.io.output.writers.AbstractBatchedNodeTupleWriter;
-import org.apache.jena.hadoop.rdf.types.AbstractNodeTupleWritable;
-
-
-/**
- * Abstract output format for formats that use a
- * {@link AbstractBatchedNodeTupleWriter} as their writer
- *
- *
- *
- * @param <TKey>
- * Key type
- * @param <TTuple>
- * Tuple type
- * @param <TValue>
- * Writable tuple type i.e. the value type
- */
-public abstract class AbstractBatchedNodeTupleOutputFormat<TKey, TTuple, TValue extends AbstractNodeTupleWritable<TTuple>> extends
- AbstractNodeTupleOutputFormat<TKey, TTuple, TValue> {
-
- @Override
- protected RecordWriter<TKey, TValue> getRecordWriter(Writer writer, Configuration config) {
- long batchSize = config.getLong(RdfIOConstants.OUTPUT_BATCH_SIZE, RdfIOConstants.DEFAULT_OUTPUT_BATCH_SIZE);
- return this.getRecordWriter(writer, batchSize);
- }
-
- protected abstract RecordWriter<TKey, TValue> getRecordWriter(Writer writer, long batchSize);
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/AbstractNodeOutputFormat.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/AbstractNodeOutputFormat.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/AbstractNodeOutputFormat.java
deleted file mode 100644
index cfc98bd..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/AbstractNodeOutputFormat.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.output;
-
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.FSDataOutputStream;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.io.compress.CompressionCodec;
-import org.apache.hadoop.io.compress.GzipCodec;
-import org.apache.hadoop.mapreduce.RecordWriter;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
-import org.apache.hadoop.util.ReflectionUtils;
-import org.apache.jena.hadoop.rdf.types.NodeWritable;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-/**
- * Abstract output format which takes pairs with Node keys and arbitrary values
- * and writes them as a simple line based text file
- *
- *
- *
- * @param <TValue> Value type
- */
-public abstract class AbstractNodeOutputFormat<TValue> extends FileOutputFormat<NodeWritable, TValue> {
-
- private static final Logger LOG = LoggerFactory.getLogger(AbstractNodeOutputFormat.class);
-
- @Override
- public RecordWriter<NodeWritable, TValue> getRecordWriter(TaskAttemptContext context) throws IOException, InterruptedException {
- Configuration config = context.getConfiguration();
- boolean isCompressed = getCompressOutput(context);
- CompressionCodec codec = null;
- String extension = this.getFileExtension();
- if (isCompressed) {
- Class<? extends CompressionCodec> codecClass = getOutputCompressorClass(context, GzipCodec.class);
- codec = (CompressionCodec) ReflectionUtils.newInstance(codecClass, config);
- extension += codec.getDefaultExtension();
- }
- Path file = getDefaultWorkFile(context, extension);
- LOG.info("Writing output to file " + file);
- FileSystem fs = file.getFileSystem(config);
- if (!isCompressed) {
- FSDataOutputStream fileOut = fs.create(file, false);
- return this.getRecordWriter(new OutputStreamWriter(fileOut), config);
- } else {
- FSDataOutputStream fileOut = fs.create(file, false);
- return this.getRecordWriter(new OutputStreamWriter(codec.createOutputStream(fileOut)), config);
- }
- }
-
- /**
- * Gets the file extension to use for output
- *
- * @return File extension including the '.'
- */
- protected String getFileExtension() {
- return ".nodes";
- }
-
- /**
- * Gets the record writer to use
- *
- * @param writer
- * Writer to write output to
- * @param config
- * Configuration
- * @return Record writer
- */
- protected abstract RecordWriter<NodeWritable, TValue> getRecordWriter(Writer writer, Configuration config);
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/AbstractNodeTupleOutputFormat.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/AbstractNodeTupleOutputFormat.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/AbstractNodeTupleOutputFormat.java
deleted file mode 100644
index 1944bda..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/AbstractNodeTupleOutputFormat.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.output;
-
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.fs.FSDataOutputStream;
-import org.apache.hadoop.fs.FileSystem;
-import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.io.compress.CompressionCodec;
-import org.apache.hadoop.io.compress.GzipCodec;
-import org.apache.hadoop.mapreduce.RecordWriter;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
-import org.apache.hadoop.util.ReflectionUtils;
-import org.apache.jena.hadoop.rdf.types.AbstractNodeTupleWritable;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-/**
- * An abstract implementation of an output format for line based tuple formats
- * where the key is ignored and only the tuple values will be output
- *
- *
- * @param <TKey>
- * Key type
- * @param <TValue>
- * Tuple value type
- * @param <T>
- * Writable node tuple type
- *
- */
-public abstract class AbstractNodeTupleOutputFormat<TKey, TValue, T extends AbstractNodeTupleWritable<TValue>> extends
- FileOutputFormat<TKey, T> {
-
- private static final Logger LOG = LoggerFactory.getLogger(AbstractNodeTupleOutputFormat.class);
-
- @Override
- public RecordWriter<TKey, T> getRecordWriter(TaskAttemptContext context) throws IOException, InterruptedException {
- Configuration config = context.getConfiguration();
- boolean isCompressed = getCompressOutput(context);
- CompressionCodec codec = null;
- String extension = this.getFileExtension();
- if (isCompressed) {
- Class<? extends CompressionCodec> codecClass = getOutputCompressorClass(context, GzipCodec.class);
- codec = (CompressionCodec) ReflectionUtils.newInstance(codecClass, config);
- extension += codec.getDefaultExtension();
- }
- Path file = getDefaultWorkFile(context, extension);
- LOG.info("Writing output to file " + file);
- FileSystem fs = file.getFileSystem(config);
- if (!isCompressed) {
- FSDataOutputStream fileOut = fs.create(file, false);
- return this.getRecordWriter(new OutputStreamWriter(fileOut), config);
- } else {
- FSDataOutputStream fileOut = fs.create(file, false);
- return this.getRecordWriter(new OutputStreamWriter(codec.createOutputStream(fileOut)), config);
- }
- }
-
- /**
- * Gets the file extension to use for output
- *
- * @return File extension including the '.'
- */
- protected abstract String getFileExtension();
-
- /**
- * Gets the record writer to use
- *
- * @param writer
- * Writer to write output to
- * @param config
- * Configuration
- * @return Record writer
- */
- protected abstract RecordWriter<TKey, T> getRecordWriter(Writer writer, Configuration config);
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/AbstractStreamRdfNodeTupleOutputFormat.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/AbstractStreamRdfNodeTupleOutputFormat.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/AbstractStreamRdfNodeTupleOutputFormat.java
deleted file mode 100644
index 54be421..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/AbstractStreamRdfNodeTupleOutputFormat.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.apache.jena.hadoop.rdf.io.output;
-
-import java.io.Writer;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.mapreduce.RecordWriter;
-import org.apache.jena.hadoop.rdf.types.AbstractNodeTupleWritable;
-import org.apache.jena.riot.system.StreamRDF;
-
-/**
- * Abstract output format for formats that use the RIOT {@link StreamRDF} API to
- * stream the writes
- *
- *
- *
- * @param <TKey>
- * Key type
- * @param <TTuple>
- * Tuple type
- * @param <TValue>
- * Writable tuple type i.e. the value type
- */
-public abstract class AbstractStreamRdfNodeTupleOutputFormat<TKey, TTuple, TValue extends AbstractNodeTupleWritable<TTuple>>
- extends AbstractNodeTupleOutputFormat<TKey, TTuple, TValue> {
-
- @Override
- protected RecordWriter<TKey, TValue> getRecordWriter(Writer writer,
- Configuration config) {
- return getRecordWriter(getStream(writer, config), writer, config);
- }
-
- /**
- * Gets a writer which provides a bridge between the {@link RecordWriter}
- * and {@link StreamRDF} APIs
- *
- * @param stream
- * RDF Stream
- * @param writer
- * Writer
- * @param config
- * Configuration
- * @return Record Writer
- */
- protected abstract RecordWriter<TKey, TValue> getRecordWriter(
- StreamRDF stream, Writer writer, Configuration config);
-
- /**
- * Gets a {@link StreamRDF} to which the tuples to be output should be
- * passed
- *
- * @param writer
- * Writer
- * @param config
- * Configuration
- * @return RDF Stream
- */
- protected abstract StreamRDF getStream(Writer writer, Configuration config);
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/BatchedTriGOutputFormat.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/BatchedTriGOutputFormat.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/BatchedTriGOutputFormat.java
deleted file mode 100644
index 8cb28fe..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/BatchedTriGOutputFormat.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.output;
-
-import java.io.Writer;
-
-import org.apache.hadoop.mapreduce.RecordWriter;
-import org.apache.jena.hadoop.rdf.io.output.writers.BatchedTriGWriter;
-import org.apache.jena.hadoop.rdf.types.QuadWritable;
-
-import com.hp.hpl.jena.sparql.core.Quad;
-
-/**
- * Output format for TriG that uses a batched approach, note that this will
- * produce invalid data where blank nodes span batches so it is typically better
- * to use the {@link TriGOutputFormat} instead
- *
- *
- *
- * @param <TKey>
- * Key type
- */
-public class BatchedTriGOutputFormat<TKey> extends
- AbstractBatchedNodeTupleOutputFormat<TKey, Quad, QuadWritable> {
-
- @Override
- protected RecordWriter<TKey, QuadWritable> getRecordWriter(Writer writer,
- long batchSize) {
- return new BatchedTriGWriter<TKey>(writer, batchSize);
- }
-
- @Override
- protected String getFileExtension() {
- return ".trig";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/BatchedTurtleOutputFormat.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/BatchedTurtleOutputFormat.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/BatchedTurtleOutputFormat.java
deleted file mode 100644
index 4ad9549..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/BatchedTurtleOutputFormat.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.output;
-
-import java.io.Writer;
-
-import org.apache.hadoop.mapreduce.RecordWriter;
-import org.apache.jena.hadoop.rdf.io.output.writers.BatchedTurtleWriter;
-import org.apache.jena.hadoop.rdf.types.TripleWritable;
-
-import com.hp.hpl.jena.graph.Triple;
-
-/**
- * Output format for Turtle that uses a batched approach, note that this will
- * produce invalid data where blank nodes span batches so it is typically better
- * to use the {@link TurtleOutputFormat} instead
- *
- *
- *
- * @param <TKey>
- * Key type
- */
-public class BatchedTurtleOutputFormat<TKey> extends
- AbstractBatchedNodeTupleOutputFormat<TKey, Triple, TripleWritable> {
-
- @Override
- protected RecordWriter<TKey, TripleWritable> getRecordWriter(Writer writer,
- long batchSize) {
- return new BatchedTurtleWriter<TKey>(writer, batchSize);
- }
-
- @Override
- protected String getFileExtension() {
- return ".ttl";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/NQuadsOutputFormat.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/NQuadsOutputFormat.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/NQuadsOutputFormat.java
deleted file mode 100644
index f7f35df..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/NQuadsOutputFormat.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.output;
-
-import java.io.Writer;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.mapreduce.RecordWriter;
-import org.apache.jena.hadoop.rdf.io.output.writers.NQuadsWriter;
-import org.apache.jena.hadoop.rdf.types.QuadWritable;
-
-import com.hp.hpl.jena.sparql.core.Quad;
-
-/**
- * NQuads output format
- *
- *
- *
- * @param <TKey>
- * Key type
- */
-public class NQuadsOutputFormat<TKey> extends AbstractNodeTupleOutputFormat<TKey, Quad, QuadWritable> {
-
- @Override
- protected RecordWriter<TKey, QuadWritable> getRecordWriter(Writer writer, Configuration config) {
- return new NQuadsWriter<TKey>(writer);
- }
-
- @Override
- protected String getFileExtension() {
- return ".nq";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/NTriplesNodeOutputFormat.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/NTriplesNodeOutputFormat.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/NTriplesNodeOutputFormat.java
deleted file mode 100644
index 14bac22..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/NTriplesNodeOutputFormat.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.output;
-
-import java.io.Writer;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.mapreduce.RecordWriter;
-import org.apache.jena.hadoop.rdf.io.output.writers.NTriplesNodeWriter;
-import org.apache.jena.hadoop.rdf.types.NodeWritable;
-
-
-/**
- * NTriples based node output format
- *
- *
- *
- * @param <TValue>
- * Value type
- */
-public class NTriplesNodeOutputFormat<TValue> extends AbstractNodeOutputFormat<TValue> {
-
- @Override
- protected RecordWriter<NodeWritable, TValue> getRecordWriter(Writer writer, Configuration config) {
- return new NTriplesNodeWriter<TValue>(writer);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/NTriplesOutputFormat.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/NTriplesOutputFormat.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/NTriplesOutputFormat.java
deleted file mode 100644
index 1309852..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/NTriplesOutputFormat.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.output;
-
-import java.io.Writer;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.mapreduce.RecordWriter;
-import org.apache.jena.hadoop.rdf.io.output.writers.NTriplesWriter;
-import org.apache.jena.hadoop.rdf.types.TripleWritable;
-
-import com.hp.hpl.jena.graph.Triple;
-
-/**
- * NTriples output format
- *
- *
- * @param <TKey>
- *
- */
-public class NTriplesOutputFormat<TKey> extends AbstractNodeTupleOutputFormat<TKey, Triple, TripleWritable> {
-
- @Override
- protected RecordWriter<TKey, TripleWritable> getRecordWriter(Writer writer, Configuration config) {
- return new NTriplesWriter<TKey>(writer);
- }
-
- @Override
- protected String getFileExtension() {
- return ".nt";
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/RdfJsonOutputFormat.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/RdfJsonOutputFormat.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/RdfJsonOutputFormat.java
deleted file mode 100644
index 6d79132..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/RdfJsonOutputFormat.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.output;
-
-import java.io.Writer;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.mapreduce.RecordWriter;
-import org.apache.jena.hadoop.rdf.io.output.writers.RdfJsonWriter;
-import org.apache.jena.hadoop.rdf.types.TripleWritable;
-
-import com.hp.hpl.jena.graph.Triple;
-
-/**
- * RDF/JSON output format
- *
- *
- *
- * @param <TKey>
- * Key type
- */
-public class RdfJsonOutputFormat<TKey> extends AbstractNodeTupleOutputFormat<TKey, Triple, TripleWritable> {
-
- @Override
- protected String getFileExtension() {
- return ".rj";
- }
-
- @Override
- protected RecordWriter<TKey, TripleWritable> getRecordWriter(Writer writer, Configuration config) {
- return new RdfJsonWriter<TKey>(writer);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/RdfXmlOutputFormat.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/RdfXmlOutputFormat.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/RdfXmlOutputFormat.java
deleted file mode 100644
index 4bd37ca..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/RdfXmlOutputFormat.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.output;
-
-import java.io.Writer;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.mapreduce.RecordWriter;
-import org.apache.jena.hadoop.rdf.io.output.writers.RdfXmlWriter;
-import org.apache.jena.hadoop.rdf.types.TripleWritable;
-
-import com.hp.hpl.jena.graph.Triple;
-
-/**
- * RDF/XML output format
- *
- *
- *
- * @param <TKey>
- * Key type
- */
-public class RdfXmlOutputFormat<TKey> extends AbstractNodeTupleOutputFormat<TKey, Triple, TripleWritable> {
-
- @Override
- protected String getFileExtension() {
- return ".rdf";
- }
-
- @Override
- protected RecordWriter<TKey, TripleWritable> getRecordWriter(Writer writer, Configuration config) {
- return new RdfXmlWriter<TKey>(writer);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/TriGOutputFormat.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/TriGOutputFormat.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/TriGOutputFormat.java
deleted file mode 100644
index 0d0d429..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/TriGOutputFormat.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.apache.jena.hadoop.rdf.io.output;
-
-import java.io.Writer;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.mapreduce.RecordWriter;
-import org.apache.jena.hadoop.rdf.io.output.writers.StreamRdfQuadWriter;
-import org.apache.jena.hadoop.rdf.types.QuadWritable;
-import org.apache.jena.riot.system.StreamRDF;
-import org.apache.jena.riot.writer.WriterStreamRDFBlocks;
-
-import com.hp.hpl.jena.sparql.core.Quad;
-
-/**
- * Output format for TriG
- *
- *
- *
- * @param <TKey>
- * Key type
- */
-public class TriGOutputFormat<TKey> extends
- AbstractStreamRdfNodeTupleOutputFormat<TKey, Quad, QuadWritable> {
-
- @Override
- protected RecordWriter<TKey, QuadWritable> getRecordWriter(
- StreamRDF stream, Writer writer, Configuration config) {
- return new StreamRdfQuadWriter<TKey>(stream, writer);
- }
-
- @Override
- protected StreamRDF getStream(Writer writer, Configuration config) {
- return new WriterStreamRDFBlocks(writer);
- }
-
- @Override
- protected String getFileExtension() {
- return ".trig";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/TurtleOutputFormat.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/TurtleOutputFormat.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/TurtleOutputFormat.java
deleted file mode 100644
index cb340a3..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/TurtleOutputFormat.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.output;
-
-import java.io.Writer;
-
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.mapreduce.RecordWriter;
-import org.apache.jena.hadoop.rdf.io.output.writers.StreamRdfTripleWriter;
-import org.apache.jena.hadoop.rdf.types.TripleWritable;
-import org.apache.jena.riot.system.StreamRDF;
-import org.apache.jena.riot.writer.WriterStreamRDFBlocks;
-
-import com.hp.hpl.jena.graph.Triple;
-
-/**
- * Turtle output format
- *
- *
- *
- * @param <TKey>
- * Key type
- */
-public class TurtleOutputFormat<TKey> extends
- AbstractStreamRdfNodeTupleOutputFormat<TKey, Triple, TripleWritable> {
-
- @Override
- protected String getFileExtension() {
- return ".ttl";
- }
-
- @Override
- protected RecordWriter<TKey, TripleWritable> getRecordWriter(
- StreamRDF stream, Writer writer, Configuration config) {
- return new StreamRdfTripleWriter<TKey>(stream, writer);
- }
-
- @Override
- protected StreamRDF getStream(Writer writer, Configuration config) {
- return new WriterStreamRDFBlocks(writer);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractBatchedNodeTupleWriter.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractBatchedNodeTupleWriter.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractBatchedNodeTupleWriter.java
deleted file mode 100644
index c4eafd8..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractBatchedNodeTupleWriter.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.output.writers;
-
-import java.io.IOException;
-import java.io.Writer;
-
-import org.apache.hadoop.mapreduce.RecordWriter;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.apache.jena.hadoop.rdf.types.AbstractNodeTupleWritable;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-/**
- * An abstract implementation of a record writer that writes records in batches.
- * <p>
- * It is important to note that the writer will write output periodically once
- * sufficient tuples have been gathered. If there is an incomplete batch when
- * the {@link #close(TaskAttemptContext)} method is called then the final batch
- * will be written then. Writing in batches increases the chances that the
- * writer will be able to effectively use the syntax compressions of the RDF
- * serialization being used.
- * </p>
- * <p>
- * The implementation only writes the value portion of the key value pair since
- * it is the value portion that is used to convey the node tuples
- * </p>
- *
- *
- *
- * @param <TKey>
- * @param <TValue>
- * @param <T>
- */
-public abstract class AbstractBatchedNodeTupleWriter<TKey, TValue, T extends AbstractNodeTupleWritable<TValue>> extends
- RecordWriter<TKey, T> {
- private static final Logger LOG = LoggerFactory.getLogger(AbstractBatchedNodeTupleWriter.class);
-
- private Writer writer;
- private long batchSize;
-
- protected AbstractBatchedNodeTupleWriter(Writer writer, long batchSize) {
- if (writer == null)
- throw new NullPointerException("writer cannot be null");
- if (batchSize <= 0)
- throw new IllegalArgumentException("batchSize must be >= 1");
- this.writer = writer;
- this.batchSize = batchSize;
- }
-
- @Override
- public final void write(TKey key, T value) throws IOException, InterruptedException {
- LOG.debug("write({}={})", key, value);
- if (this.add(value) >= this.batchSize) {
- long size = this.writeOutput(writer);
- if (size > 0)
- throw new IOException("Derived implementation failed to empty the current batch after writing");
- }
- }
-
- /**
- * Adds the tuple to the batch of tuples that will be written when the batch
- * threshold is reached or when the {@link #close(TaskAttemptContext)}
- * method is called.
- *
- * @param value
- * Tuple
- * @return The current size of the batch waiting to be written
- */
- protected abstract long add(T value);
-
- @Override
- public void close(TaskAttemptContext context) throws IOException, InterruptedException {
- if (this.writer != null) {
- long size = this.writeOutput(writer);
- if (size > 0)
- throw new IOException("Derived implementation failed to empty the current batch after writing");
- this.writer.close();
- this.writer = null;
- }
- }
-
- /**
- * Writes the current batch of tuples to the writer, the writer should not
- * be closed and the batch should be emptied by the implementation.
- * <p>
- * If the current batch is empty then this should be a no-op
- * </p>
- *
- * @param writer
- * Writer
- * @return Current batch size which should always be zero
- */
- protected abstract long writeOutput(Writer writer);
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractBatchedQuadWriter.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractBatchedQuadWriter.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractBatchedQuadWriter.java
deleted file mode 100644
index 13c2799..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractBatchedQuadWriter.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.output.writers;
-
-import java.io.Writer;
-import java.util.List;
-
-import org.apache.commons.collections.IteratorUtils;
-import org.apache.jena.hadoop.rdf.types.QuadWritable;
-import org.apache.jena.riot.Lang;
-import org.apache.jena.riot.RDFDataMgr;
-import org.apache.jena.riot.RDFWriterRegistry;
-
-import com.hp.hpl.jena.graph.Node;
-import com.hp.hpl.jena.sparql.core.DatasetGraph;
-import com.hp.hpl.jena.sparql.core.DatasetGraphFactory;
-import com.hp.hpl.jena.sparql.core.Quad;
-
-/**
- * Abstract batched record writer for quad formats
- *
- *
- *
- * @param <TKey>
- */
-public abstract class AbstractBatchedQuadWriter<TKey> extends AbstractBatchedNodeTupleWriter<TKey, Quad, QuadWritable> {
-
- private DatasetGraph g = DatasetGraphFactory.createMem();
-
- protected AbstractBatchedQuadWriter(Writer writer, long batchSize) {
- super(writer, batchSize);
- }
-
- @Override
- protected final long add(QuadWritable value) {
- g.add(value.get());
- return g.size();
- }
-
- @SuppressWarnings("deprecation")
- @Override
- protected final long writeOutput(Writer writer) {
- if (this.g.size() == 0)
- return 0;
- RDFDataMgr.write(writer, this.g, RDFWriterRegistry.defaultSerialization(this.getRdfLanguage()));
-
- // Clear the dataset graph
- @SuppressWarnings("unchecked")
- List<Node> graphNames = IteratorUtils.toList(this.g.listGraphNodes());
- for (Node graphName : graphNames) {
- this.g.removeGraph(graphName);
- }
- this.g.getDefaultGraph().clear();
-
- return this.g.size();
- }
-
- /**
- * Gets the RDF language used for output
- *
- * @return RDF language
- */
- protected abstract Lang getRdfLanguage();
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractBatchedTripleWriter.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractBatchedTripleWriter.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractBatchedTripleWriter.java
deleted file mode 100644
index 881cf15..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractBatchedTripleWriter.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.output.writers;
-
-import java.io.Writer;
-
-import org.apache.jena.hadoop.rdf.types.TripleWritable;
-import org.apache.jena.riot.Lang;
-import org.apache.jena.riot.RDFDataMgr;
-
-import com.hp.hpl.jena.graph.Graph;
-import com.hp.hpl.jena.graph.Triple;
-import com.hp.hpl.jena.sparql.graph.GraphFactory;
-
-/**
- * Abstract batched record writer for triple formats
- *
- *
- *
- * @param <TKey>
- */
-public abstract class AbstractBatchedTripleWriter<TKey> extends AbstractBatchedNodeTupleWriter<TKey, Triple, TripleWritable> {
-
- private Graph g = GraphFactory.createDefaultGraph();
-
- protected AbstractBatchedTripleWriter(Writer writer, long batchSize) {
- super(writer, batchSize);
- }
-
- @Override
- protected final long add(TripleWritable value) {
- g.add(value.get());
- return g.size();
- }
-
- @SuppressWarnings("deprecation")
- @Override
- protected final long writeOutput(Writer writer) {
- if (this.g.size() == 0)
- return 0;
- RDFDataMgr.write(writer, this.g, this.getRdfLanguage());
- this.g.clear();
- return this.g.size();
- }
-
- /**
- * Gets the RDF language used for output
- *
- * @return RDF language
- */
- protected abstract Lang getRdfLanguage();
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractLineBasedNodeTupleWriter.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractLineBasedNodeTupleWriter.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractLineBasedNodeTupleWriter.java
deleted file mode 100644
index 89b8f4b..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractLineBasedNodeTupleWriter.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.output.writers;
-
-import java.io.IOException;
-import java.io.Writer;
-
-import org.apache.hadoop.mapreduce.RecordWriter;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.apache.jena.atlas.io.AWriter;
-import org.apache.jena.atlas.io.Writer2;
-import org.apache.jena.hadoop.rdf.types.AbstractNodeTupleWritable;
-import org.apache.jena.riot.out.NodeFormatter;
-import org.apache.jena.riot.out.NodeFormatterNT;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.hp.hpl.jena.graph.Node;
-
-/**
- * An abstract implementation of a record writer that writes records to a line
- * based tuple formats.
- * <p>
- * The implementation only writes the value portion of the key value pair since
- * it is the value portion that is used to convey the node tuples
- * </p>
- *
- *
- * @param <TKey>
- * Key type
- * @param <TValue>
- * Tuple type
- * @param <T>
- * Writable node tuple type
- *
- */
-public abstract class AbstractLineBasedNodeTupleWriter<TKey, TValue, T extends AbstractNodeTupleWritable<TValue>> extends
- RecordWriter<TKey, T> {
- /**
- * Default separator written between nodes
- */
- public static final String DEFAULT_SEPARATOR = " ";
- /**
- * Default terminator written at the end of each line
- */
- public static final String DEFAULT_TERMINATOR = ".";
-
- private static final Logger log = LoggerFactory.getLogger(AbstractLineBasedNodeTupleWriter.class);
-
- private AWriter writer;
- private NodeFormatter formatter;
-
- /**
- * Creates a new tuple writer using the default NTriples node formatter
- *
- * @param writer
- * Writer
- */
- public AbstractLineBasedNodeTupleWriter(Writer writer) {
- this(writer, new NodeFormatterNT());
- }
-
- /**
- * Creates a new tuple writer
- *
- * @param writer
- * Writer
- * @param formatter
- * Node formatter
- */
- public AbstractLineBasedNodeTupleWriter(Writer writer, NodeFormatter formatter) {
- if (writer == null)
- throw new NullPointerException("writer cannot be null");
- if (formatter == null)
- throw new NullPointerException("formatter cannot be null");
- this.formatter = formatter;
- this.writer = Writer2.wrap(writer);
- }
-
- @Override
- public void write(TKey key, T value) throws IOException, InterruptedException {
- log.debug("write({}={})", key, value);
-
- Node[] ns = this.getNodes(value);
- String sep = this.getSeparator();
- NodeFormatter formatter = this.getNodeFormatter();
- for (int i = 0; i < ns.length; i++) {
- formatter.format(this.writer, ns[i]);
- this.writer.print(sep);
- }
- this.writer.println(this.getTerminator());
- this.writer.flush();
- }
-
- /**
- * Gets the nodes of the tuple in the order they should be written
- *
- * @param tuple
- * Tuple
- * @return Nodes
- */
- protected abstract Node[] getNodes(T tuple);
-
- /**
- * Gets the node formatter to use for formatting nodes
- *
- * @return Node formatter
- */
- protected NodeFormatter getNodeFormatter() {
- return this.formatter;
- }
-
- /**
- * Gets the separator that is written between nodes
- *
- * @return Separator
- */
- protected String getSeparator() {
- return DEFAULT_SEPARATOR;
- }
-
- /**
- * Gets the terminator that is written at the end of each tuple
- *
- * @return Terminator
- */
- protected String getTerminator() {
- return DEFAULT_TERMINATOR;
- }
-
- @Override
- public void close(TaskAttemptContext context) throws IOException, InterruptedException {
- log.debug("close({})", context);
- writer.close();
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractLineBasedQuadWriter.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractLineBasedQuadWriter.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractLineBasedQuadWriter.java
deleted file mode 100644
index 9ecef61..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractLineBasedQuadWriter.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.output.writers;
-
-import java.io.Writer;
-
-import org.apache.jena.hadoop.rdf.types.QuadWritable;
-import org.apache.jena.riot.out.NodeFormatter;
-import org.apache.jena.riot.out.NodeFormatterNT;
-
-import com.hp.hpl.jena.graph.Node;
-import com.hp.hpl.jena.sparql.core.Quad;
-
-/**
- * An abstract writer for line based quad formats
- *
- *
- * @param <TKey>
- *
- */
-public abstract class AbstractLineBasedQuadWriter<TKey> extends AbstractLineBasedNodeTupleWriter<TKey, Quad, QuadWritable> {
-
- /**
- * Creates a new writer using the default NTriples node formatter
- *
- * @param writer
- * Writer
- */
- public AbstractLineBasedQuadWriter(Writer writer) {
- this(writer, new NodeFormatterNT());
- }
-
- /**
- * Creates a new writer using the specified node formatter
- *
- * @param writer
- * Writer
- * @param formatter
- * Node formatter
- */
- public AbstractLineBasedQuadWriter(Writer writer, NodeFormatter formatter) {
- super(writer, formatter);
- }
-
- @Override
- protected Node[] getNodes(QuadWritable tuple) {
- Quad q = tuple.get();
- if (q.isDefaultGraph()) {
- return new Node[] { q.getSubject(), q.getPredicate(), q.getObject() };
- } else {
- return new Node[] { q.getSubject(), q.getPredicate(), q.getObject(), q.getGraph() };
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractLineBasedTripleWriter.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractLineBasedTripleWriter.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractLineBasedTripleWriter.java
deleted file mode 100644
index 161c067..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractLineBasedTripleWriter.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.output.writers;
-
-import java.io.Writer;
-
-import org.apache.jena.hadoop.rdf.types.TripleWritable;
-import org.apache.jena.riot.out.NodeFormatter;
-import org.apache.jena.riot.out.NodeFormatterNT;
-
-import com.hp.hpl.jena.graph.Node;
-import com.hp.hpl.jena.graph.Triple;
-
-/**
- * An abstract writer for line based triple formats
- *
- * @param <TKey>
- * Key type
- *
- */
-public abstract class AbstractLineBasedTripleWriter<TKey> extends
- AbstractLineBasedNodeTupleWriter<TKey, Triple, TripleWritable> {
-
- /**
- * Creates a new writer using the default NTriples node formatter
- *
- * @param writer
- * Writer
- */
- public AbstractLineBasedTripleWriter(Writer writer) {
- this(writer, new NodeFormatterNT());
- }
-
- /**
- * Creates a new writer using the specified node formatter
- *
- * @param writer
- * Writer
- * @param formatter
- * Node formatter
- */
- public AbstractLineBasedTripleWriter(Writer writer, NodeFormatter formatter) {
- super(writer, formatter);
- }
-
- @Override
- protected Node[] getNodes(TripleWritable tuple) {
- Triple t = tuple.get();
- return new Node[] { t.getSubject(), t.getPredicate(), t.getObject() };
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jena/blob/92fb810a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractNodeWriter.java
----------------------------------------------------------------------
diff --git a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractNodeWriter.java b/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractNodeWriter.java
deleted file mode 100644
index 5d0826d..0000000
--- a/hadoop-rdf/hadoop-rdf-io/src/main/java/org/apache/jena/hadoop/rdf/io/output/writers/AbstractNodeWriter.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.jena.hadoop.rdf.io.output.writers;
-
-import java.io.IOException;
-import java.io.Writer;
-
-import org.apache.hadoop.io.NullWritable;
-import org.apache.hadoop.mapreduce.RecordWriter;
-import org.apache.hadoop.mapreduce.TaskAttemptContext;
-import org.apache.jena.atlas.io.AWriter;
-import org.apache.jena.atlas.io.Writer2;
-import org.apache.jena.hadoop.rdf.types.NodeWritable;
-import org.apache.jena.riot.out.NodeFormatter;
-import org.apache.jena.riot.out.NodeFormatterNT;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.hp.hpl.jena.graph.Node;
-
-/**
- * Abstract implementation of a record writer which writes pairs of nodes and
- * arbitrary values to text based files
- *
- *
- *
- * @param <TValue>
- */
-public abstract class AbstractNodeWriter<TValue> extends RecordWriter<NodeWritable, TValue> {
-
- /**
- * Default separator written between nodes and their associated values
- */
- public static final String DEFAULT_SEPARATOR = "\t";
-
- private static final Logger log = LoggerFactory.getLogger(AbstractNodeWriter.class);
-
- protected AWriter writer;
- private NodeFormatter formatter;
-
- /**
- * Creates a new tuple writer using the default NTriples node formatter
- *
- * @param writer
- * Writer
- */
- public AbstractNodeWriter(Writer writer) {
- this(writer, new NodeFormatterNT());
- }
-
- /**
- * Creates a new tuple writer
- *
- * @param writer
- * Writer
- * @param formatter
- * Node formatter
- */
- public AbstractNodeWriter(Writer writer, NodeFormatter formatter) {
- if (writer == null)
- throw new NullPointerException("writer cannot be null");
- if (formatter == null)
- throw new NullPointerException("formatter cannot be null");
- this.formatter = formatter;
- this.writer = Writer2.wrap(writer);
- }
-
- @Override
- public final void write(NodeWritable key, TValue value) throws IOException, InterruptedException {
- this.writeKey(key);
- this.writer.write(this.getSeparator());
- this.writeValue(value);
- this.writer.write('\n');
- }
-
- /**
- * Writes the given key
- *
- * @param key
- * Key
- */
- protected void writeKey(NodeWritable key) {
- Node n = key.get();
- this.getNodeFormatter().format(this.writer, n);
- }
-
- /**
- * Writes the given value
- *
- * @param value
- */
- protected void writeValue(TValue value) {
- if (value instanceof NullWritable)
- return;
- this.writer.write(value.toString());
- }
-
- @Override
- public void close(TaskAttemptContext context) throws IOException, InterruptedException {
- log.debug("close({})", context);
- writer.close();
- }
-
- /**
- * Gets the node formatter to use for formatting nodes
- *
- * @return Node formatter
- */
- protected NodeFormatter getNodeFormatter() {
- return this.formatter;
- }
-
- /**
- * Gets the separator that is written between nodes
- *
- * @return Separator
- */
- protected String getSeparator() {
- return DEFAULT_SEPARATOR;
- }
-}