Author: cdouglas
Date: Wed Sep 2 01:00:34 2009
New Revision: 810325
URL: http://svn.apache.org/viewvc?rev=810325&view=rev
Log:
Revert HADOOP-6224
Modified:
hadoop/common/trunk/CHANGES.txt
hadoop/common/trunk/src/java/org/apache/hadoop/io/DataOutputBuffer.java
hadoop/common/trunk/src/java/org/apache/hadoop/io/Text.java
Modified: hadoop/common/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/common/trunk/CHANGES.txt?rev=810325&r1=810324&r2=810325&view=diff
==============================================================================
--- hadoop/common/trunk/CHANGES.txt (original)
+++ hadoop/common/trunk/CHANGES.txt Wed Sep 2 01:00:34 2009
@@ -507,10 +507,6 @@
HADOOP-6184. Provide an API to dump Configuration in a JSON format.
(V.V.Chaitanya Krishna via yhemanth)
-
- HADOOP-6224. Adds methods to read strings safely, makes the Buffer class
- in DataOutputBuffer public, and introduces public constructors there.
These changes
- are required for MAPREDUCE-318. (Jothi Padmanabhan and Arun Murthy via
ddas)
OPTIMIZATIONS
Modified:
hadoop/common/trunk/src/java/org/apache/hadoop/io/DataOutputBuffer.java
URL:
http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/io/DataOutputBuffer.java?rev=810325&r1=810324&r2=810325&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/io/DataOutputBuffer.java
(original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/io/DataOutputBuffer.java Wed
Sep 2 01:00:34 2009
@@ -20,8 +20,6 @@
import java.io.*;
-import org.apache.hadoop.io.DataOutputBuffer.Buffer;
-
/** A reusable {...@link DataOutput} implementation that writes to an in-memory
* buffer.
*
@@ -43,7 +41,7 @@
*/
public class DataOutputBuffer extends DataOutputStream {
- public static class Buffer extends ByteArrayOutputStream {
+ private static class Buffer extends ByteArrayOutputStream {
public byte[] getData() { return buf; }
public int getLength() { return count; }
@@ -55,10 +53,6 @@
super(size);
}
- public Buffer(byte[] buf) {
- super.buf = buf;
- }
-
public void write(DataInput in, int len) throws IOException {
int newcount = count + len;
if (newcount > buf.length) {
@@ -82,10 +76,6 @@
this(new Buffer(size));
}
- public DataOutputBuffer(byte[] buf) {
- this(new Buffer(buf));
- }
-
private DataOutputBuffer(Buffer buffer) {
super(buffer);
this.buffer = buffer;
Modified: hadoop/common/trunk/src/java/org/apache/hadoop/io/Text.java
URL:
http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/io/Text.java?rev=810325&r1=810324&r2=810325&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/io/Text.java (original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/io/Text.java Wed Sep 2
01:00:34 2009
@@ -35,7 +35,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.io.WritableUtils;
/** This class stores text using standard UTF8 encoding. It provides methods
* to serialize, deserialize, and compare texts at byte level. The type of
@@ -404,30 +403,6 @@
in.readFully(bytes, 0, length);
return decode(bytes);
}
- /**
- * Read a string, but check it for sanity. The format consists of a vint
- * followed by the given number of bytes.
- * @param in the stream to read from
- * @param maxLength the largest acceptable length of string
- * @return the bytes as a string
- * @throws IOException if reading from the DataInput fails
- * @throws IllegalArgumentException if the string length is negative or
- * larger than maxSize. Only the vint is read.
- */
- public static String readStringSafely(DataInput in,
- int maxLength
- ) throws IOException,
- IllegalArgumentException {
- int length = WritableUtils.readVInt(in);
- if (length < 0 || length > maxLength) {
- throw new IllegalArgumentException("String size was " + length +
- ", which is outside of 0.." +
- maxLength);
- }
- byte [] bytes = new byte[length];
- in.readFully(bytes, 0, length);
- return decode(bytes);
- }
/** Write a UTF8 encoded string to out
*/