ehoner commented on code in PR #1662:
URL: https://github.com/apache/samza/pull/1662#discussion_r1227312731


##########
samza-azure/src/main/java/org/apache/samza/system/azureblob/AzureBlobConfig.java:
##########
@@ -80,6 +80,12 @@ public class AzureBlobConfig extends MapConfig {
   public static final String SYSTEM_MAX_FLUSH_THRESHOLD_SIZE = 
SYSTEM_AZUREBLOB_PREFIX + "maxFlushThresholdSize";
   private static final int SYSTEM_MAX_FLUSH_THRESHOLD_SIZE_DEFAULT = 10485760;
 
+  // initialization size of in-memory OutputStream
+  // This value should be between SYSTEM_INIT_BUFFER_SIZE_DEFAULT and 
getMaxFlushThresholdSize() exclusive.
+  public static final String SYSTEM_INIT_BUFFER_SIZE = SYSTEM_AZUREBLOB_PREFIX 
+ "initBufferSize.bytes";
+  // re-use size for parameterless constructor java.io.ByteArrayOutputStream()
+  public static final int SYSTEM_INIT_BUFFER_SIZE_DEFAULT = 32;

Review Comment:
   @mynameborat Can you provide an example? The comment above the field 
identifies the source. tbc, `ByteArrayOutputStream` has two constructors, and 
the value here is the default when using the [parameterless 
constructor](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/ByteArrayOutputStream.html#%3Cinit%3E()).
 
   
   Fwiw, I am in-part also avoiding "magic" values. Where the implementation, 
`AzureBlobOutputStream`, would need to "understand" if the value is 
provided/set, ie. `-1` or `null`, and then select the "correct" constructor. 
This allows the config object to establish the "meaning"/intent of the value 
and create a "default" that is always usable by the implementation.



-- 
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: commits-unsubscr...@samza.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to