Skip to content

Commit b234e46

Browse files
committed
Read/write var ints instead of longs for the object lengths
1 parent a885f3d commit b234e46

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

chill-hadoop/src/main/java/com/twitter/chill/hadoop/KryoDeserializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void open(InputStream in) throws IOException {
4646

4747
public Object deserialize(Object o) throws IOException {
4848
// TODO, we could share these buffers if we see that alloc is bottlenecking
49-
byte[] bytes = new byte[(int) Varint.readUnsignedVarLong(inputStream)];
49+
byte[] bytes = new byte[Varint.readUnsignedVarInt(inputStream)];
5050
inputStream.readFully( bytes );
5151
return kryoPool.fromBytes(bytes, klass);
5252
}

chill-hadoop/src/main/java/com/twitter/chill/hadoop/KryoSerializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public void serialize(Object o) throws IOException {
4747
try {
4848
st.writeObject(o);
4949
// Copy from buffer to output stream.
50-
Varint.writeUnsignedVarLong(st.numOfWrittenBytes(), outputStream);
50+
Varint.writeUnsignedVarInt(st.numOfWrittenBytes(), outputStream);
5151
st.writeOutputTo(outputStream);
5252
}
5353
finally {

0 commit comments

Comments
 (0)