fix native cell ByteOrder

patch by bes; reviewed by jbellis and tested by mshuler for CASSANDRA-7201
This commit is contained in:
Jonathan Ellis 2014-05-21 13:25:17 -05:00
parent dd6a229599
commit e06d74ef53
2 changed files with 3 additions and 7 deletions

View File

@ -18,6 +18,7 @@
package org.apache.cassandra.db;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.security.MessageDigest;
import org.apache.cassandra.config.CFMetaData;
@ -183,7 +184,7 @@ public abstract class AbstractNativeCell extends AbstractCell implements CellNam
public ByteBuffer value()
{
long offset = valueStartOffset();
return getByteBuffer(offset, (int) (internalSize() - (postfixSize() + offset)));
return getByteBuffer(offset, (int) (internalSize() - (postfixSize() + offset))).order(ByteOrder.BIG_ENDIAN);
}
private int clusteringSizeDelta()
@ -291,7 +292,7 @@ public abstract class AbstractNativeCell extends AbstractCell implements CellNam
int cellNamesOffset = nameDeltaOffset(size);
int startDelta = i == 0 ? 0 : getShort(nameDeltaOffset(i));
int endDelta = i < size - 1 ? getShort(nameDeltaOffset(i + 1)) : valueStartOffset() - cellNamesOffset;
return getByteBuffer(cellNamesOffset + startDelta, endDelta - startDelta);
return getByteBuffer(cellNamesOffset + startDelta, endDelta - startDelta).order(ByteOrder.BIG_ENDIAN);
}
private static final ThreadLocal<byte[]> BUFFER = new ThreadLocal<byte[]>()

View File

@ -68,11 +68,6 @@ public class NativeCounterCell extends NativeCell implements CounterCell
return getLong(internalSize() - 8);
}
public ByteBuffer value()
{
return super.value().order(ByteOrder.BIG_ENDIAN);
}
@Override
public long total()
{