You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@heron.apache.org by GitBox <gi...@apache.org> on 2021/12/10 17:16:22 UTC

[GitHub] [incubator-heron] surahman commented on a change in pull request #3747: [Heron-3723] Add support for Empty Dir, Host Path, and NFS via CLI

surahman commented on a change in pull request #3747:
URL: https://github.com/apache/incubator-heron/pull/3747#discussion_r766848869



##########
File path: heron/schedulers/src/java/org/apache/heron/scheduler/kubernetes/V1Controller.java
##########
@@ -415,17 +415,21 @@ private V1StatefulSet createStatefulSet(Resource containerResource, int numberOf
     final String topologyName = getTopologyName();
     final Config runtimeConfiguration = getRuntimeConfiguration();
 
-    // Get and then create Persistent Volume Claims from the CLI.
-    final Map<String, Map<KubernetesConstants.VolumeClaimTemplateConfigKeys, String>> configsPVC =
+    final List<V1Volume> volumes = new LinkedList<>();

Review comment:
       Thank you for taking the time to review this!
   
   This is a good question. The access patterns on the data structure are such that we only tail append, and when we do access elements we iterate across the entire list from beginning to end. We do not require index-based random access and as such the risk of having to resize the Array backing an `ArrayList` is unnecessary.
   
   With our access patterns, appending to `LinkedList` is O(1) and iteration is O(n) whilst with an `ArrayList` appending would be an amortized O(1) and iteration will be O(n).




-- 
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-unsubscribe@heron.apache.org

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