6:22, EEST
September 24, 2015
We want to get history data in batches, for that we set numValuesPerNode =10; But its not working, It returns entire Data
UnsignedInteger batchsize=new UnsignedInteger(10);
DataValue[] result = client.historyReadRaw(nodeId,
DateTime.MIN_VALUE, DateTime.currentTime(),
UnsignedInteger.ONE, true, null, TimestampsToReturn.Source);
8:45, EEST
December 21, 2011
Yes, that is true. The current implementation fetches the data in batches automatically and provides the data as a whole, when ready.
historyRead() is the raw interface for calling the service with your own parameters and doing it in batches on your own code.
This is the internal implementation:
startTime, endTime, numValuesPerNode, returnBounds);
return historyReadAll(nodeId, indexRange, timestampsToReturn, details);
where
TimestampsToReturn timestampsToReturn, HistoryReadDetails details)
throws ServiceException, StatusException,
DecodingException {
HistoryReadValueId id = new HistoryReadValueId();
id.setNodeId(nodeId);
if (indexRange != null)
id.setIndexRange(indexRange.toString());
List<DataValue> dataList = null;
HistoryData data;
byte[] continuationPoint;
// While continuationPoints returned
do {
HistoryReadResult[] results = historyRead(details,
timestampsToReturn, false, id);
checkOperationResult(results[0].getStatusCode());
if (results[0].getStatusCode().getValue()
.equals(StatusCodes.Good_NoData))
break;
ExtensionObject historyDataObject = results[0].getHistoryData();
if (historyDataObject == null)
break;
data = historyDataObject.decode(client.getEncoderContext());
continuationPoint = results[0].getContinuationPoint();
if ((continuationPoint == null) && (dataList == null))
return data.getDataValues();
if (dataList == null)
dataList = new ArrayList<DataValue>();
dataList.addAll(Arrays.asList(data.getDataValues()));
id.setContinuationPoint(continuationPoint);
if ((data.getDataValues().length == 0)
&& (continuationPoint != null)) {
logger.info(
"historyReadAll: Received empty HistoryData with continuationPoint");
break;
} else
logger.debug("historyReadAll: got {} values",
data.getDataValues().length);
} while (continuationPoint != null);
return dataList == null ? new DataValue[0]
: dataList.toArray(new DataValue[dataList.size()]);
}
Most Users Ever Online: 1919
Currently Online:
11 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 738
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1524
Posts: 6451
Newest Members:
jonathonmcintyre, fannielima, kristiewinkle8, rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettingerModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0
Administrators: admin: 1