Skip to content

Commit

Permalink
fix #2864 Refactored ResultData to use rawData with a dedicated seria…
Browse files Browse the repository at this point in the history
…lizer.
  • Loading branch information
marevol committed Dec 29, 2024
1 parent e739c8c commit 4726b59
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ public ResultData transform(final ResponseData responseData) {
final ResultData resultData = new ResultData();
resultData.setTransformerName(getName());
try {
resultData.setData(dataSerializer.fromObjectToBinary(generateData(responseData)));
resultData.setRawData(generateData(responseData));
resultData.setSerializer(dataSerializer::fromObjectToBinary);
} catch (final Exception e) {
throw new CrawlingAccessException("Could not serialize object", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ protected void storeData(final ResponseData responseData, final ResultData resul
normalizeData(responseData, dataMap);

try {
resultData.setData(dataSerializer.fromObjectToBinary(dataMap));
resultData.setRawData(dataMap);
resultData.setSerializer(dataSerializer::fromObjectToBinary);
} catch (final Exception e) {
throw new CrawlingAccessException("Could not serialize object: " + responseData.getUrl(), e);
}
Expand Down

0 comments on commit 4726b59

Please sign in to comment.