You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2013/03/27 05:14:38 UTC
[2/4] rename dis -> in, dos -> out
http://git-wip-us.apache.org/repos/asf/cassandra/blob/60d9c7f2/src/java/org/apache/cassandra/utils/MerkleTree.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/MerkleTree.java b/src/java/org/apache/cassandra/utils/MerkleTree.java
index d9040d9..5284a57 100644
--- a/src/java/org/apache/cassandra/utils/MerkleTree.java
+++ b/src/java/org/apache/cassandra/utils/MerkleTree.java
@@ -84,22 +84,22 @@ public class MerkleTree implements Serializable
public static class MerkleTreeSerializer implements IVersionedSerializer<MerkleTree>
{
- public void serialize(MerkleTree mt, DataOutput dos, int version) throws IOException
+ public void serialize(MerkleTree mt, DataOutput out, int version) throws IOException
{
- dos.writeByte(mt.hashdepth);
- dos.writeLong(mt.maxsize);
- dos.writeLong(mt.size);
- Hashable.serializer.serialize(mt.root, dos, version);
+ out.writeByte(mt.hashdepth);
+ out.writeLong(mt.maxsize);
+ out.writeLong(mt.size);
+ Hashable.serializer.serialize(mt.root, out, version);
}
- public MerkleTree deserialize(DataInput dis, int version) throws IOException
+ public MerkleTree deserialize(DataInput in, int version) throws IOException
{
- byte hashdepth = dis.readByte();
- long maxsize = dis.readLong();
- long size = dis.readLong();
+ byte hashdepth = in.readByte();
+ long maxsize = in.readLong();
+ long size = in.readLong();
MerkleTree mt = new MerkleTree(null, null, hashdepth, maxsize);
mt.size = size;
- mt.root = Hashable.serializer.deserialize(dis, version);
+ mt.root = Hashable.serializer.deserialize(in, version);
return mt;
}
@@ -689,29 +689,29 @@ public class MerkleTree implements Serializable
private static class InnerSerializer implements IVersionedSerializer<Inner>
{
- public void serialize(Inner inner, DataOutput dos, int version) throws IOException
+ public void serialize(Inner inner, DataOutput out, int version) throws IOException
{
if (inner.hash == null)
- dos.writeInt(-1);
+ out.writeInt(-1);
else
{
- dos.writeInt(inner.hash.length);
- dos.write(inner.hash);
+ out.writeInt(inner.hash.length);
+ out.write(inner.hash);
}
- Token.serializer.serialize(inner.token, dos);
- Hashable.serializer.serialize(inner.lchild, dos, version);
- Hashable.serializer.serialize(inner.rchild, dos, version);
+ Token.serializer.serialize(inner.token, out);
+ Hashable.serializer.serialize(inner.lchild, out, version);
+ Hashable.serializer.serialize(inner.rchild, out, version);
}
- public Inner deserialize(DataInput dis, int version) throws IOException
+ public Inner deserialize(DataInput in, int version) throws IOException
{
- int hashLen = dis.readInt();
+ int hashLen = in.readInt();
byte[] hash = hashLen >= 0 ? new byte[hashLen] : null;
if (hash != null)
- dis.readFully(hash);
- Token token = Token.serializer.deserialize(dis);
- Hashable lchild = Hashable.serializer.deserialize(dis, version);
- Hashable rchild = Hashable.serializer.deserialize(dis, version);
+ in.readFully(hash);
+ Token token = Token.serializer.deserialize(in);
+ Hashable lchild = Hashable.serializer.deserialize(in, version);
+ Hashable rchild = Hashable.serializer.deserialize(in, version);
return new Inner(token, lchild, rchild);
}
@@ -775,25 +775,25 @@ public class MerkleTree implements Serializable
private static class LeafSerializer implements IVersionedSerializer<Leaf>
{
- public void serialize(Leaf leaf, DataOutput dos, int version) throws IOException
+ public void serialize(Leaf leaf, DataOutput out, int version) throws IOException
{
if (leaf.hash == null)
{
- dos.writeInt(-1);
+ out.writeInt(-1);
}
else
{
- dos.writeInt(leaf.hash.length);
- dos.write(leaf.hash);
+ out.writeInt(leaf.hash.length);
+ out.write(leaf.hash);
}
}
- public Leaf deserialize(DataInput dis, int version) throws IOException
+ public Leaf deserialize(DataInput in, int version) throws IOException
{
- int hashLen = dis.readInt();
+ int hashLen = in.readInt();
byte[] hash = hashLen < 0 ? null : new byte[hashLen];
if (hash != null)
- dis.readFully(hash);
+ in.readFully(hash);
return new Leaf(hash);
}
@@ -895,29 +895,29 @@ public class MerkleTree implements Serializable
private static class HashableSerializer implements IVersionedSerializer<Hashable>
{
- public void serialize(Hashable h, DataOutput dos, int version) throws IOException
+ public void serialize(Hashable h, DataOutput out, int version) throws IOException
{
if (h instanceof Inner)
{
- dos.writeByte(Inner.IDENT);
- Inner.serializer.serialize((Inner)h, dos, version);
+ out.writeByte(Inner.IDENT);
+ Inner.serializer.serialize((Inner)h, out, version);
}
else if (h instanceof Leaf)
{
- dos.writeByte(Leaf.IDENT);
- Leaf.serializer.serialize((Leaf) h, dos, version);
+ out.writeByte(Leaf.IDENT);
+ Leaf.serializer.serialize((Leaf) h, out, version);
}
else
throw new IOException("Unexpected Hashable: " + h.getClass().getCanonicalName());
}
- public Hashable deserialize(DataInput dis, int version) throws IOException
+ public Hashable deserialize(DataInput in, int version) throws IOException
{
- byte ident = dis.readByte();
+ byte ident = in.readByte();
if (Inner.IDENT == ident)
- return Inner.serializer.deserialize(dis, version);
+ return Inner.serializer.deserialize(in, version);
else if (Leaf.IDENT == ident)
- return Leaf.serializer.deserialize(dis, version);
+ return Leaf.serializer.deserialize(in, version);
else
throw new IOException("Unexpected Hashable: " + ident);
}
http://git-wip-us.apache.org/repos/asf/cassandra/blob/60d9c7f2/src/java/org/apache/cassandra/utils/StreamingHistogram.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/StreamingHistogram.java b/src/java/org/apache/cassandra/utils/StreamingHistogram.java
index 749e295..c4ba956 100644
--- a/src/java/org/apache/cassandra/utils/StreamingHistogram.java
+++ b/src/java/org/apache/cassandra/utils/StreamingHistogram.java
@@ -169,26 +169,26 @@ public class StreamingHistogram
public static class StreamingHistogramSerializer implements ISerializer<StreamingHistogram>
{
- public void serialize(StreamingHistogram histogram, DataOutput dos) throws IOException
+ public void serialize(StreamingHistogram histogram, DataOutput out) throws IOException
{
- dos.writeInt(histogram.maxBinSize);
+ out.writeInt(histogram.maxBinSize);
Map<Double, Long> entries = histogram.getAsMap();
- dos.writeInt(entries.size());
+ out.writeInt(entries.size());
for (Map.Entry<Double, Long> entry : entries.entrySet())
{
- dos.writeDouble(entry.getKey());
- dos.writeLong(entry.getValue());
+ out.writeDouble(entry.getKey());
+ out.writeLong(entry.getValue());
}
}
- public StreamingHistogram deserialize(DataInput dis) throws IOException
+ public StreamingHistogram deserialize(DataInput in) throws IOException
{
- int maxBinSize = dis.readInt();
- int size = dis.readInt();
+ int maxBinSize = in.readInt();
+ int size = in.readInt();
Map<Double, Long> tmp = new HashMap<Double, Long>(size);
for (int i = 0; i < size; i++)
{
- tmp.put(dis.readDouble(), dis.readLong());
+ tmp.put(in.readDouble(), in.readLong());
}
return new StreamingHistogram(maxBinSize, tmp);
http://git-wip-us.apache.org/repos/asf/cassandra/blob/60d9c7f2/src/java/org/apache/cassandra/utils/obs/IBitSet.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/obs/IBitSet.java b/src/java/org/apache/cassandra/utils/obs/IBitSet.java
index c5a2fb8..c6fbddd 100644
--- a/src/java/org/apache/cassandra/utils/obs/IBitSet.java
+++ b/src/java/org/apache/cassandra/utils/obs/IBitSet.java
@@ -44,7 +44,7 @@ public interface IBitSet extends Closeable
*/
public void clear(long index);
- public void serialize(DataOutput dos) throws IOException;
+ public void serialize(DataOutput out) throws IOException;
public long serializedSize(TypeSizes type);
http://git-wip-us.apache.org/repos/asf/cassandra/blob/60d9c7f2/src/java/org/apache/cassandra/utils/obs/OffHeapBitSet.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/obs/OffHeapBitSet.java b/src/java/org/apache/cassandra/utils/obs/OffHeapBitSet.java
index 1733a81..a45ff6e 100644
--- a/src/java/org/apache/cassandra/utils/obs/OffHeapBitSet.java
+++ b/src/java/org/apache/cassandra/utils/obs/OffHeapBitSet.java
@@ -88,9 +88,9 @@ public class OffHeapBitSet implements IBitSet
bytes.setMemory(0, bytes.size(), (byte) 0);
}
- public void serialize(DataOutput dos) throws IOException
+ public void serialize(DataOutput out) throws IOException
{
- dos.writeInt((int) (bytes.size() / 8));
+ out.writeInt((int) (bytes.size() / 8));
for (long i = 0; i < bytes.size();)
{
long value = ((bytes.getByte(i++) & 0xff) << 0)
@@ -101,7 +101,7 @@ public class OffHeapBitSet implements IBitSet
+ ((long) (bytes.getByte(i++) & 0xff) << 40)
+ ((long) (bytes.getByte(i++) & 0xff) << 48)
+ ((long) bytes.getByte(i++) << 56);
- dos.writeLong(value);
+ out.writeLong(value);
}
}
@@ -110,13 +110,13 @@ public class OffHeapBitSet implements IBitSet
return type.sizeof((int) bytes.size()) + bytes.size();
}
- public static OffHeapBitSet deserialize(DataInput dis) throws IOException
+ public static OffHeapBitSet deserialize(DataInput in) throws IOException
{
- int byteCount = dis.readInt() * 8;
+ int byteCount = in.readInt() * 8;
Memory memory = RefCountedMemory.allocate(byteCount);
for (int i = 0; i < byteCount;)
{
- long v = dis.readLong();
+ long v = in.readLong();
memory.setByte(i++, (byte) (v >>> 0));
memory.setByte(i++, (byte) (v >>> 8));
memory.setByte(i++, (byte) (v >>> 16));
http://git-wip-us.apache.org/repos/asf/cassandra/blob/60d9c7f2/src/java/org/apache/cassandra/utils/obs/OpenBitSet.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/obs/OpenBitSet.java b/src/java/org/apache/cassandra/utils/obs/OpenBitSet.java
index 4fce3f8..c3220a7 100644
--- a/src/java/org/apache/cassandra/utils/obs/OpenBitSet.java
+++ b/src/java/org/apache/cassandra/utils/obs/OpenBitSet.java
@@ -391,16 +391,16 @@ public class OpenBitSet implements IBitSet
// noop, let GC do the cleanup.
}
- public void serialize(DataOutput dos) throws IOException {
+ public void serialize(DataOutput out) throws IOException {
int bitLength = getNumWords();
int pageSize = getPageSize();
int pageCount = getPageCount();
- dos.writeInt(bitLength);
+ out.writeInt(bitLength);
for (int p = 0; p < pageCount; p++) {
long[] bits = getPage(p);
for (int i = 0; i < pageSize && bitLength-- > 0; i++) {
- dos.writeLong(bits[i]);
+ out.writeLong(bits[i]);
}
}
}
@@ -423,8 +423,8 @@ public class OpenBitSet implements IBitSet
clear(0, capacity());
}
- public static OpenBitSet deserialize(DataInput dis) throws IOException {
- long bitLength = dis.readInt();
+ public static OpenBitSet deserialize(DataInput in) throws IOException {
+ long bitLength = in.readInt();
OpenBitSet bs = new OpenBitSet(bitLength << 6);
int pageSize = bs.getPageSize();
@@ -433,7 +433,7 @@ public class OpenBitSet implements IBitSet
for (int p = 0; p < pageCount; p++) {
long[] bits = bs.getPage(p);
for (int i = 0; i < pageSize && bitLength-- > 0; i++)
- bits[i] = dis.readLong();
+ bits[i] = in.readLong();
}
return bs;
}
http://git-wip-us.apache.org/repos/asf/cassandra/blob/60d9c7f2/test/unit/org/apache/cassandra/Util.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/Util.java b/test/unit/org/apache/cassandra/Util.java
index be5d218..2de8c0c 100644
--- a/test/unit/org/apache/cassandra/Util.java
+++ b/test/unit/org/apache/cassandra/Util.java
@@ -291,10 +291,10 @@ public class Util
try
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
- DataOutputStream dos = new DataOutputStream(baos);
- DeletionInfo.serializer().serializeForSSTable(cf.deletionInfo(), dos);
- dos.writeInt(cf.getColumnCount());
- new ColumnIndex.Builder(cf, ByteBufferUtil.EMPTY_BYTE_BUFFER, dos).build(cf);
+ DataOutputStream out = new DataOutputStream(baos);
+ DeletionInfo.serializer().serializeForSSTable(cf.deletionInfo(), out);
+ out.writeInt(cf.getColumnCount());
+ new ColumnIndex.Builder(cf, ByteBufferUtil.EMPTY_BYTE_BUFFER, out).build(cf);
return ByteBuffer.wrap(baos.toByteArray());
}
catch (IOException e)
http://git-wip-us.apache.org/repos/asf/cassandra/blob/60d9c7f2/test/unit/org/apache/cassandra/db/ReadMessageTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/ReadMessageTest.java b/test/unit/org/apache/cassandra/db/ReadMessageTest.java
index 23aea67..825e52c 100644
--- a/test/unit/org/apache/cassandra/db/ReadMessageTest.java
+++ b/test/unit/org/apache/cassandra/db/ReadMessageTest.java
@@ -75,11 +75,11 @@ public class ReadMessageTest extends SchemaLoader
private ReadCommand serializeAndDeserializeReadMessage(ReadCommand rm) throws IOException
{
ReadCommandSerializer rms = ReadCommand.serializer;
- DataOutputBuffer dos = new DataOutputBuffer();
+ DataOutputBuffer out = new DataOutputBuffer();
ByteArrayInputStream bis;
- rms.serialize(rm, dos, MessagingService.current_version);
- bis = new ByteArrayInputStream(dos.getData(), 0, dos.getLength());
+ rms.serialize(rm, out, MessagingService.current_version);
+ bis = new ByteArrayInputStream(out.getData(), 0, out.getLength());
return rms.deserialize(new DataInputStream(bis), MessagingService.current_version);
}
http://git-wip-us.apache.org/repos/asf/cassandra/blob/60d9c7f2/test/unit/org/apache/cassandra/io/sstable/SSTableMetadataSerializerTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/io/sstable/SSTableMetadataSerializerTest.java b/test/unit/org/apache/cassandra/io/sstable/SSTableMetadataSerializerTest.java
index 6f941be..fd9e9c5 100644
--- a/test/unit/org/apache/cassandra/io/sstable/SSTableMetadataSerializerTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/SSTableMetadataSerializerTest.java
@@ -55,14 +55,14 @@ public class SSTableMetadataSerializerTest
SSTableMetadata originalMetadata = collector.finalizeMetadata(RandomPartitioner.class.getCanonicalName(), 0.1);
ByteArrayOutputStream byteOutput = new ByteArrayOutputStream();
- DataOutputStream dos = new DataOutputStream(byteOutput);
+ DataOutputStream out = new DataOutputStream(byteOutput);
- SSTableMetadata.serializer.serialize(originalMetadata, dos);
+ SSTableMetadata.serializer.serialize(originalMetadata, out);
ByteArrayInputStream byteInput = new ByteArrayInputStream(byteOutput.toByteArray());
- DataInputStream dis = new DataInputStream(byteInput);
+ DataInputStream in = new DataInputStream(byteInput);
Descriptor desc = new Descriptor(Descriptor.Version.CURRENT, new File("."), "", "", 0, false);
- SSTableMetadata stats = SSTableMetadata.serializer.deserialize(dis, desc);
+ SSTableMetadata stats = SSTableMetadata.serializer.deserialize(in, desc);
assert stats.estimatedRowSize.equals(originalMetadata.estimatedRowSize);
assert stats.estimatedRowSize.equals(rowSizes);
http://git-wip-us.apache.org/repos/asf/cassandra/blob/60d9c7f2/test/unit/org/apache/cassandra/streaming/compress/CompressedInputStreamTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/streaming/compress/CompressedInputStreamTest.java b/test/unit/org/apache/cassandra/streaming/compress/CompressedInputStreamTest.java
index ecb6e14..d432ea5 100644
--- a/test/unit/org/apache/cassandra/streaming/compress/CompressedInputStreamTest.java
+++ b/test/unit/org/apache/cassandra/streaming/compress/CompressedInputStreamTest.java
@@ -94,12 +94,12 @@ public class CompressedInputStreamTest
// read buffer using CompressedInputStream
CompressionInfo info = new CompressionInfo(chunks, param);
CompressedInputStream input = new CompressedInputStream(new ByteArrayInputStream(toRead), info);
- DataInputStream dis = new DataInputStream(input);
+ DataInputStream in = new DataInputStream(input);
for (int i = 0; i < sections.size(); i++)
{
input.position(sections.get(i).left);
- long exp = dis.readLong();
+ long exp = in.readLong();
assert exp == valuesToCheck[i] : "expected " + valuesToCheck[i] + " but was " + exp;
}
}
http://git-wip-us.apache.org/repos/asf/cassandra/blob/60d9c7f2/test/unit/org/apache/cassandra/utils/BitSetTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/utils/BitSetTest.java b/test/unit/org/apache/cassandra/utils/BitSetTest.java
index 9684131..c49483c 100644
--- a/test/unit/org/apache/cassandra/utils/BitSetTest.java
+++ b/test/unit/org/apache/cassandra/utils/BitSetTest.java
@@ -73,13 +73,13 @@ public class BitSetTest
@Test
public void testExpectedCompatablity() throws IOException
{
- DataInputStream dis = new DataInputStream(new FileInputStream(new File(LEGACY_SST_FILE)));
- dis.readInt(); // bloom filter hash count
- OpenBitSet bs = OpenBitSet.deserialize(dis);
+ DataInputStream in = new DataInputStream(new FileInputStream(new File(LEGACY_SST_FILE)));
+ in.readInt(); // bloom filter hash count
+ OpenBitSet bs = OpenBitSet.deserialize(in);
- dis = new DataInputStream(new FileInputStream(new File(LEGACY_SST_FILE)));
- dis.readInt(); // bloom filter hash count
- OffHeapBitSet obs = OffHeapBitSet.deserialize(dis);
+ in = new DataInputStream(new FileInputStream(new File(LEGACY_SST_FILE)));
+ in.readInt(); // bloom filter hash count
+ OffHeapBitSet obs = OffHeapBitSet.deserialize(in);
compare(obs, bs);
}
@@ -109,10 +109,10 @@ public class BitSetTest
if (random.nextBoolean())
bs.set(i);
- DataOutputBuffer dos = new DataOutputBuffer();
- bs.serialize(dos);
- DataInputStream dis = new DataInputStream(new ByteArrayInputStream(dos.getData()));
- OffHeapBitSet newbs = OffHeapBitSet.deserialize(dis);
+ DataOutputBuffer out = new DataOutputBuffer();
+ bs.serialize(out);
+ DataInputStream in = new DataInputStream(new ByteArrayInputStream(out.getData()));
+ OffHeapBitSet newbs = OffHeapBitSet.deserialize(in);
compare(bs, newbs);
}
http://git-wip-us.apache.org/repos/asf/cassandra/blob/60d9c7f2/test/unit/org/apache/cassandra/utils/BytesReadTrackerTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/utils/BytesReadTrackerTest.java b/test/unit/org/apache/cassandra/utils/BytesReadTrackerTest.java
index b26cb9a..e2e0bf2 100644
--- a/test/unit/org/apache/cassandra/utils/BytesReadTrackerTest.java
+++ b/test/unit/org/apache/cassandra/utils/BytesReadTrackerTest.java
@@ -37,37 +37,37 @@ public class BytesReadTrackerTest
byte[] testData;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
- DataOutputStream dos = new DataOutputStream(baos);
+ DataOutputStream out = new DataOutputStream(baos);
try
{
// boolean
- dos.writeBoolean(true);
+ out.writeBoolean(true);
// byte
- dos.writeByte(0x1);
+ out.writeByte(0x1);
// char
- dos.writeChar('a');
+ out.writeChar('a');
// short
- dos.writeShort(1);
+ out.writeShort(1);
// int
- dos.writeInt(1);
+ out.writeInt(1);
// long
- dos.writeLong(1L);
+ out.writeLong(1L);
// float
- dos.writeFloat(1.0f);
+ out.writeFloat(1.0f);
// double
- dos.writeDouble(1.0d);
+ out.writeDouble(1.0d);
// String
- dos.writeUTF("abc");
+ out.writeUTF("abc");
testData = baos.toByteArray();
}
finally
{
- dos.close();
+ out.close();
}
- DataInputStream dis = new DataInputStream(new ByteArrayInputStream(testData));
- BytesReadTracker tracker = new BytesReadTracker(dis);
+ DataInputStream in = new DataInputStream(new ByteArrayInputStream(testData));
+ BytesReadTracker tracker = new BytesReadTracker(in);
try
{
@@ -112,7 +112,7 @@ public class BytesReadTrackerTest
}
finally
{
- dis.close();
+ in.close();
}
tracker.reset(0);
@@ -125,22 +125,22 @@ public class BytesReadTrackerTest
byte[] testData;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
- DataOutputStream dos = new DataOutputStream(baos);
+ DataOutputStream out = new DataOutputStream(baos);
try
{
// byte
- dos.writeByte(0x1);
+ out.writeByte(0x1);
// short
- dos.writeShort(1);
+ out.writeShort(1);
testData = baos.toByteArray();
}
finally
{
- dos.close();
+ out.close();
}
- DataInputStream dis = new DataInputStream(new ByteArrayInputStream(testData));
- BytesReadTracker tracker = new BytesReadTracker(dis);
+ DataInputStream in = new DataInputStream(new ByteArrayInputStream(testData));
+ BytesReadTracker tracker = new BytesReadTracker(in);
try
{
@@ -157,7 +157,7 @@ public class BytesReadTrackerTest
}
finally
{
- dis.close();
+ in.close();
}
}
@@ -167,8 +167,8 @@ public class BytesReadTrackerTest
String testStr = "1234567890";
byte[] testData = testStr.getBytes();
- DataInputStream dis = new DataInputStream(new ByteArrayInputStream(testData));
- BytesReadTracker tracker = new BytesReadTracker(dis);
+ DataInputStream in = new DataInputStream(new ByteArrayInputStream(testData));
+ BytesReadTracker tracker = new BytesReadTracker(in);
try
{
@@ -192,15 +192,15 @@ public class BytesReadTrackerTest
}
finally
{
- dis.close();
+ in.close();
}
}
@Test(expected = UnsupportedOperationException.class)
public void testReadLine() throws Exception
{
- DataInputStream dis = new DataInputStream(new ByteArrayInputStream("1".getBytes()));
- BytesReadTracker tracker = new BytesReadTracker(dis);
+ DataInputStream in = new DataInputStream(new ByteArrayInputStream("1".getBytes()));
+ BytesReadTracker tracker = new BytesReadTracker(in);
try
{
@@ -209,7 +209,7 @@ public class BytesReadTrackerTest
}
finally
{
- dis.close();
+ in.close();
}
}
}
http://git-wip-us.apache.org/repos/asf/cassandra/blob/60d9c7f2/test/unit/org/apache/cassandra/utils/EncodedStreamsTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/utils/EncodedStreamsTest.java b/test/unit/org/apache/cassandra/utils/EncodedStreamsTest.java
index 2258988..f93191f 100644
--- a/test/unit/org/apache/cassandra/utils/EncodedStreamsTest.java
+++ b/test/unit/org/apache/cassandra/utils/EncodedStreamsTest.java
@@ -51,30 +51,30 @@ public class EncodedStreamsTest extends SchemaLoader
EncodedDataOutputStream odos = new EncodedDataOutputStream(byteArrayOStream1);
ByteArrayOutputStream byteArrayOStream2 = new ByteArrayOutputStream();
- DataOutputStream dos = new DataOutputStream(byteArrayOStream2);
+ DataOutputStream out = new DataOutputStream(byteArrayOStream2);
for (short i = 0; i < 10000; i++)
{
- dos.writeShort(i);
+ out.writeShort(i);
odos.writeShort(i);
}
- dos.flush();
+ out.flush();
odos.flush();
for (int i = Short.MAX_VALUE; i < ((int)Short.MAX_VALUE + 10000); i++)
{
- dos.writeInt(i);
+ out.writeInt(i);
odos.writeInt(i);
}
- dos.flush();
+ out.flush();
odos.flush();
for (long i = Integer.MAX_VALUE; i < ((long)Integer.MAX_VALUE + 10000);i++)
{
- dos.writeLong(i);
+ out.writeLong(i);
odos.writeLong(i);
}
- dos.flush();
+ out.flush();
odos.flush();
Assert.assertTrue(byteArrayOStream1.size() < byteArrayOStream2.size());
http://git-wip-us.apache.org/repos/asf/cassandra/blob/60d9c7f2/test/unit/org/apache/cassandra/utils/IntervalTreeTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/utils/IntervalTreeTest.java b/test/unit/org/apache/cassandra/utils/IntervalTreeTest.java
index 8ac13ec..974befa 100644
--- a/test/unit/org/apache/cassandra/utils/IntervalTreeTest.java
+++ b/test/unit/org/apache/cassandra/utils/IntervalTreeTest.java
@@ -143,14 +143,14 @@ public class IntervalTreeTest extends TestCase
IVersionedSerializer<IntervalTree<Integer, String, Interval<Integer, String>>> serializer = IntervalTree.serializer(
new ISerializer<Integer>()
{
- public void serialize(Integer i, DataOutput dos) throws IOException { dos.writeInt(i); }
- public Integer deserialize(DataInput dis) throws IOException { return dis.readInt(); }
+ public void serialize(Integer i, DataOutput out) throws IOException { out.writeInt(i); }
+ public Integer deserialize(DataInput in) throws IOException { return in.readInt(); }
public long serializedSize(Integer i, TypeSizes ts) { return 4; }
},
new ISerializer<String>()
{
- public void serialize(String v, DataOutput dos) throws IOException { dos.writeUTF(v); }
- public String deserialize(DataInput dis) throws IOException { return dis.readUTF(); }
+ public void serialize(String v, DataOutput out) throws IOException { out.writeUTF(v); }
+ public String deserialize(DataInput in) throws IOException { return in.readUTF(); }
public long serializedSize(String v, TypeSizes ts) { return v.length(); }
},
Interval.class.getConstructor(Object.class, Object.class, Object.class)