kevdoran commented on code in PR #10909:
URL: https://github.com/apache/nifi/pull/10909#discussion_r2823823187


##########
nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/components/connector/StandardConnectorRepository.java:
##########
@@ -367,17 +404,158 @@ public FrameworkConnectorInitializationContextBuilder 
createInitializationContex
         return new StandardConnectorInitializationContext.Builder();
     }
 
+    // ConnectorAssetRepository is an internal implementation detail;
+    // all external callers should use the asset methods on 
ConnectorRepository directly.
+
+    @Override
+    public Asset storeAsset(final String connectorId, final String assetId, 
final String assetName, final InputStream content) throws IOException {
+        if (configurationProvider == null) {
+            return assetRepository.storeAsset(connectorId, assetId, assetName, 
content);
+        }
+
+        // Buffer content so we can send it to both the local store and the 
provider
+        final byte[] contentBytes = content.readAllBytes();

Review Comment:
   Yep this is a good suggestion. I've refactored this in my new approach to 
avoid ever materializing the full bytes into memory



-- 
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]

Reply via email to