Skip to content

Commit

Permalink
Address darion's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
heng committed Dec 13, 2019
1 parent 735d908 commit f1a7511
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/dataman/RowReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ int64_t RowReader::skipToNext(int64_t index, int64_t offset) const noexcept {
break;
}
case cpp2::SupportedType::FLOAT: {
// Eight bytes
// Four bytes
offset += sizeof(float);
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ public class NebulaCodec {
private static final Logger LOGGER = LoggerFactory.getLogger(NebulaCodec.class.getName());

static {
System.loadLibrary("nebula_codec");
try {
System.loadLibrary("nebula_codec");
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
} catch (Error e) {
LOGGER.error(e.getMessage(), e);
}
}

public static class Pair {
Expand Down
2 changes: 1 addition & 1 deletion src/jni/src/datamanlite/RowReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ int64_t RowReader::skipToNext(int64_t index, int64_t offset) const noexcept {
break;
}
case ValueType::FLOAT: {
// Eight bytes
// Four bytes
offset += sizeof(float);
break;
}
Expand Down
9 changes: 6 additions & 3 deletions src/jni/src/datamanlite/RowReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ class RowReader {
public:
template<typename T>
typename std::enable_if<std::is_integral<T>::value, ResultType>::type
getInt(T& v) const noexcept;
getInt(T& v) const noexcept;

ResultType getBool(bool& v) const noexcept;
ResultType getFloat(float& v) const noexcept;
ResultType getDouble(double& v) const noexcept;
Expand Down Expand Up @@ -199,7 +200,8 @@ class RowReader {
// A negative number will be returned if an error occurs
template<typename T>
typename std::enable_if<std::is_integral<T>::value, int32_t>::type
readInteger(int64_t offset, T& v) const noexcept;
readInteger(int64_t offset, T& v) const noexcept;

int32_t readFloat(int64_t offset, float& v) const noexcept;
int32_t readDouble(int64_t offset, double& v) const noexcept;
int32_t readString(int64_t offset, Slice& v) const noexcept;
Expand All @@ -210,7 +212,8 @@ class RowReader {
// When succeeded, offset will advance
template<typename T>
typename std::enable_if<std::is_integral<T>::value, ResultType>::type
getInt(int64_t index, int64_t& offset, T& v) const noexcept;
getInt(int64_t index, int64_t& offset, T& v) const noexcept;

ResultType getBool(int64_t index, int64_t& offset, bool& v) const noexcept;
ResultType getFloat(int64_t index, int64_t& offset, float& v) const noexcept;
ResultType getDouble(int64_t index, int64_t& offset, double& v)
Expand Down

0 comments on commit f1a7511

Please sign in to comment.