Brzhk commented on code in PR #6012:
URL: https://github.com/apache/nifi/pull/6012#discussion_r866071944
##########
nifi-registry/nifi-registry-core/nifi-registry-framework/src/main/java/org/apache/nifi/registry/provider/flow/git/GitFlowMetaData.java:
##########
@@ -522,7 +524,8 @@ void commit(String author, String message, Bucket bucket,
Flow.FlowPointer flowP
byte[] getContent(String objectId) throws IOException {
final ObjectId flowSnapshotObjectId = gitRepo.resolve(objectId);
- return gitRepo.newObjectReader().open(flowSnapshotObjectId).getBytes();
+ final ObjectStream objStream =
gitRepo.newObjectReader().open(flowSnapshotObjectId).openStream();
+ return IOUtils.toByteArray(objStream);
Review Comment:
So, about that. There is a limitation, either on calling knowing the type,
because the ObjectLoader is of a subclass (small or large) that is created
following rules that, i believe are not perfectly applied everytime, just as
you stumbled upon. My rationale for my first 11PR, was to keep a code impact
to a minimum, and so i kept all of that concern away as well.
However, it is a very good point that we havent tested, or i missed that
part in the build, for performance impact.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]