lakshmi-manasa-g commented on a change in pull request #1531:
URL: https://github.com/apache/samza/pull/1531#discussion_r713277339



##########
File path: 
samza-api/src/main/java/org/apache/samza/system/SystemStreamPartitionKeyHash.java
##########
@@ -0,0 +1,136 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.samza.system;
+
+import org.apache.samza.Partition;
+
+/**
+ * Aggregate object representing a portion of {@link SystemStreamPartition} 
consisting of envelopes within the
+ * SystemStreamPartition that have envelope.key % job's elasticity factor = 
keyHash of this object.
+ */
+public class SystemStreamPartitionKeyHash extends SystemStreamPartition {

Review comment:
       theoretically this should be possible. But the problem I forsee is with 
the serde of job model where the backwards compatability of reading an old job 
model containing old SSP serde might get impacted with the new defn and serde 
of SSP. Let me test this and get back on this thread. 

##########
File path: 
samza-api/src/main/java/org/apache/samza/system/IncomingMessageEnvelope.java
##########
@@ -71,6 +74,7 @@ public IncomingMessageEnvelope(SystemStreamPartition 
systemStreamPartition, Stri
     this.message = message;
     this.size = size;
     this.arrivalTime = Instant.now().toEpochMilli();
+    this.hashCodeForKeyHashComputation = key != null ? key.hashCode() : offset 
!= null ? offset.hashCode() : hashCode();

Review comment:
       I did consider this originally but if there are multiple calls to 
getSystemStreamPartitionKeyHash then it would be worth having this cached.

##########
File path: samza-core/src/main/java/org/apache/samza/config/TaskConfig.java
##########
@@ -136,6 +136,11 @@
       "task.transactional.state.retain.existing.state";
   private static final boolean 
DEFAULT_TRANSACTIONAL_STATE_RETAIN_EXISTING_STATE = true;
 
+  // Job Elasticity related configs
+  // Take effect only when job.elasticity.factor is > 1. otherwise there is no 
elasticity
+  private static final String TASK_ELASTICITY_FACTOR = 
"task.elasticity.factor";

Review comment:
       I am looking at this more as a split multiple. As in if the factor = 2 
then split each original task into 2 virtual/elastic tasks. It can also be 
looked at as task-to-partition/ssp factor where factor = 2 means each ssp is 
read by 2 virtual/elastic tasks. would lend the same semantics.




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