本文整理了Java中org.apache.spark.unsafe.Platform.getFloat()
方法的一些代码示例,展示了Platform.getFloat()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Platform.getFloat()
方法的具体详情如下:
包路径:org.apache.spark.unsafe.Platform
类名称:Platform
方法名:getFloat
暂无
代码示例来源:origin: org.apache.spark/spark-sql_2.10
@Override
public final float readFloat() {
float v;
if (!bigEndianPlatform) {
v = Platform.getFloat(buffer, offset);
} else {
v = byteBuffer.getFloat(offset - Platform.BYTE_ARRAY_OFFSET);
}
offset += 4;
return v;
}
代码示例来源:origin: org.apache.spark/spark-sql_2.10
@Override
public float getFloat(int rowId) {
if (dictionary == null) {
return Platform.getFloat(null, data + rowId * 4);
} else {
return dictionary.decodeToFloat(dictionaryIds.getDictId(rowId));
}
}
代码示例来源:origin: org.apache.spark/spark-sql
@Override
public float getFloat(int rowId) {
if (dictionary == null) {
return Platform.getFloat(null, data + rowId * 4L);
} else {
return dictionary.decodeToFloat(dictionaryIds.getDictId(rowId));
}
}
代码示例来源:origin: org.apache.spark/spark-sql_2.11
@Override
public float getFloat(int rowId) {
if (dictionary == null) {
return Platform.getFloat(null, data + rowId * 4L);
} else {
return dictionary.decodeToFloat(dictionaryIds.getDictId(rowId));
}
}
代码示例来源:origin: io.snappydata/snappy-spark-sql
@Override
public final float readFloat() {
float v;
if (!bigEndianPlatform) {
v = Platform.getFloat(buffer, offset);
} else {
v = byteBuffer.getFloat(offset - Platform.BYTE_ARRAY_OFFSET);
}
offset += 4;
return v;
}
代码示例来源:origin: shunfei/indexr
public static int binarySearchFloats(ByteBufferReader reader, int count, float key) throws IOException {
int from = 0;
int to = count;
--to;
byte[] valBuffer = new byte[4];
while (from <= to) {
int mid = from + to >>> 1;
reader.read(mid << 2, valBuffer, 0, 4);
float midVal = Platform.getFloat(valBuffer, Platform.BYTE_ARRAY_OFFSET);
if (midVal < key) {
from = mid + 1;
} else if (midVal > key) {
to = mid - 1;
} else {
return mid;
}
}
return -(from + 1);
}
代码示例来源:origin: org.apache.spark/spark-catalyst_2.10
@Override
public float getFloat(int ordinal) {
assertIndexIsValid(ordinal);
return Platform.getFloat(baseObject, getFieldOffset(ordinal));
}
代码示例来源:origin: org.apache.spark/spark-catalyst_2.11
@Override
public float getFloat(int ordinal) {
assertIndexIsValid(ordinal);
return Platform.getFloat(baseObject, getFieldOffset(ordinal));
}
代码示例来源:origin: org.apache.spark/spark-catalyst_2.10
@Override
public float getFloat(int ordinal) {
assertIndexIsValid(ordinal);
return Platform.getFloat(baseObject, getElementOffset(ordinal, 4));
}
代码示例来源:origin: org.apache.spark/spark-catalyst
@Override
public float getFloat(int ordinal) {
assertIndexIsValid(ordinal);
return Platform.getFloat(baseObject, getElementOffset(ordinal, 4));
}
代码示例来源:origin: io.snappydata/snappy-spark-sql
@Override
public float getFloat(int rowId) {
if (dictionary == null) {
return Platform.getFloat(null, data + rowId * 4);
} else {
return dictionary.decodeToFloat(dictionaryIds.getDictId(rowId));
}
}
代码示例来源:origin: org.apache.spark/spark-catalyst_2.11
@Override
public float getFloat(int ordinal) {
assertIndexIsValid(ordinal);
return Platform.getFloat(baseObject, getElementOffset(ordinal, 4));
}
代码示例来源:origin: org.apache.spark/spark-catalyst
@Override
public float getFloat(int ordinal) {
assertIndexIsValid(ordinal);
return Platform.getFloat(baseObject, getFieldOffset(ordinal));
}
内容来源于网络,如有侵权,请联系作者删除!