mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2024-11-24 09:40:30 -06:00
fix buffer bug
This commit is contained in:
parent
cc5997c1dc
commit
92d62ae88c
@ -83,11 +83,11 @@ public class FVecReader implements LongFunction<float[]> {
|
||||
ByteBuffer record = this.bb.get(recpos,buf).order(ByteOrder.LITTLE_ENDIAN);
|
||||
int recdim = record.getInt();
|
||||
if(recdim!=dimensions) {
|
||||
throw new RuntimeException("dimensions are not uniform for ivec file '" + this.path.toString() + "', found dim " + recdim + " at record " + value);
|
||||
throw new RuntimeException("dimensions are not uniform for fvec file '" + this.path.toString() + "', found dim " + recdim + " at record " + value);
|
||||
}
|
||||
float[] data = new float[recdim];
|
||||
for (int i = 0; i < dimensions; i++) {
|
||||
data[i]=bb.getFloat();
|
||||
data[i]=record.getFloat();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ public class IVecReader implements LongFunction<int[]> {
|
||||
}
|
||||
int[] data = new int[recdim];
|
||||
for (int i = 0; i < dimensions; i++) {
|
||||
data[i]=Integer.reverseBytes(bb.getInt());
|
||||
data[i]=Integer.reverseBytes(record.getInt());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user