OpenTSDB/opentsdb — pull request #256 by zackurey (2013-11-17 01:43:22+00:00)
Title: Fix for RTPublisher dropping datapoints if non-floats were not 8 bytes long

In TSDB longs are reduced to the smallest number of bytes to represent the value. The shrinking was not accounted for in RTPublisher that attempted to treat all non floats as 8 byte values. This led to most datapoints getting dropped for my particular use cases.

Added a check in to see if its a float value: flags == (Const.FLAG_FLOAT | 0x7). This should be cheap, but I'm not sure its correct, other than mimicking behavior on the flag setting. Meaning there probably should just be a FlagHelper, to make setting/checking these consistent. But for now, this works for me.

If its not a float it figures out the right way to convert back into a long based on the value byte[] size.