Bug #5335
closedSpanToDT should write metadata first rather than data when it starts up
0%
Description
When i starts the SpanToDT, here are the statement from sdtout:
[run] archive size (in frames):1000000
[run] cache size (in frames):2
[run] flushing every 60 seconds
[run] detaching every 60 flushes, which is every 3600 seconds
[run] writing full metadata every 1 minutes
[run] connected to span data.
[run] connected to span metadata.
[run] wrote data (PutDataAsFlaot64): 68.3531692080818 to channelIndex:0 for time:1.299178964002E9
[run] wrote data (PutDataAsFlaot64): 93.76955538060749 to channelIndex:2 for time:1.299178964006E9
[run] wrote data (PutDataAsFlaot64): 2.411074232369337 to channelIndex:0 for time:1.299178966003E9
....................................................
....................................................
[run] wrote data (PutDataAsFlaot64): 98.79339411591688 to channelIndex:2 for time:1.299179022017E9
[run] flushed at Thu Mar 03 11:03:43 PST 2011
[run] wrote metadata (PutDataAsString): CR800_sensor0 coefficients=,conversion-type=Linear,isOn=true,latitude=32.884164,longitude=-117.239957,measurement-unit=degrees Celsius,sampleMethod=average,samples-per-measurement=10,samplingPeriod=2,sensor-make=Vaisala,sensor-measurement=Temperature,sensor-model=HMP45A,serial-number=B3310000 to channelIndex:1 for time:1.299179023898E9
[run] wrote metadata (PutDataAsString): CR800_sensor1 coefficients=,conversion-type=Linear,isOn=true,latitude=32.884243999999995,longitude=-117.239457,measurement-unit=degrees Celsius,sampleMethod=average,samples-per-measurement=10,samplingPeriod=2,sensor-make=Vaisala,sensor-measurement=Temperature,sensor-model=HMP45A,serial-number=B3310001 to channelIndex:3 for time:1.299179023902E9
For sensor0, the first writing data happened at 1.299178964002E9, but the first writing metadata at 1.299179023898E9.
So it wrote data first, then wrote metadata after a while. But we needs the opposite way: writing metadata before writing data.
Updated by Daniel Crawl over 13 years ago
I updated SpanToDT to write metadata entries before any data values. Please check if it's fixed.
Updated by Jing Tao over 13 years ago
Yeah, now it wrote metadata first:
[run] connected to span data.
[run] connected to span metadata.
[run] Waiting until metadata is written.
[run] Metadata written; will start writing data.
[run] wrote metadata (PutDataAsString): CR800_sensor0 coefficients=,conversion-type=Linear,isOn=true,latitude=32.884164,longitude=-117.239957,measurement-unit=degrees Celsius,sampleMethod=average,samples-per-measurement=10,samplingPeriod=2,sensor-make=Vaisala,sensor-measurement=Temperature,sensor-model=HMP45A,serial-number=B3310000 to channelIndex:1 for time:1.299262623873E9
[run] wrote metadata (PutDataAsString): CR800_sensor1 coefficients=,conversion-type=Linear,isOn=true,latitude=32.884243999999995,longitude=-117.239457,measurement-unit=degrees Celsius,sampleMethod=average,samples-per-measurement=10,samplingPeriod=2,sensor-make=Vaisala,sensor-measurement=Temperature,sensor-model=HMP45A,serial-number=B3310001 to channelIndex:3 for time:1.299262623878E9
[run] wrote data (PutDataAsFloat64): 97.80991918543457 to channelIndex:0 for time:1.299262624697E9
[run] wrote data (PutDataAsFloat64): 11.118884715328337 to channelIndex:2 for time:1.299262624701E9