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:
21 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: 731
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
inilarythikibia, rickykennion, PromotionToold, HypromeImpupe, toneylapham544, rondawolinski7, Marypof5711, roycedelargie91, kourtneyquisenbe, ellis87832073466Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1