You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by "Marcosrico (via GitHub)" <gi...@apache.org> on 2023/06/30 18:31:38 UTC

[GitHub] [helix] Marcosrico opened a new pull request, #2549: MultiThreading Stress Test Lattice - Puppy Logic and Skeleton (Part 1)

Marcosrico opened a new pull request, #2549:
URL: https://github.com/apache/helix/pull/2549

   ### Issues
   
   - [ ] My PR addresses the following Helix issues and references them in the PR description:
   
   [(#200 - Link your issue number here: You can write "Fixes #XXX". Please use the proper keyword so that the issue gets closed automatically. See https://docs.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue
   Any of the following keywords can be used: close, closes, closed, fix, fixes, fixed, resolve, resolves, resolved)](https://github.com/apache/helix/issues/2237)
   
   ### Description
   
   - [ ] Here are some details about my PR, including screenshots of any UI changes:
   
   The skeleton / logic of the multithreading stress testing. We are using a concept called "puppies" to add in chaos to stress testing. Each puppy that extends the AbstractPuppy class represents one action (i.e. zk.CreatePuppy will create nodes in zk at specified path). The PuppyManager manages puppys by executing them and stopping them when indicated time limit is reached.
   
   ### Tests
   
   - [ ] The following tests are written for this issue:
   
   n/a
   
   - The following is the result of the "mvn test" command on the appropriate module:
   
   (If CI test fails due to known issue, please specify the issue and test PR locally. Then copy & paste the result of "mvn test" to here.)
   
   ### Code Quality
   
   - My diff has been formatted using helix-style.xml 
   (helix-style-intellij.xml if IntelliJ IDE is used)
   


-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] Marcosrico commented on pull request #2549: MultiThreading Stress Test Lattice - Puppy Logic and Skeleton (Part 1)

Posted by "Marcosrico (via GitHub)" <gi...@apache.org>.
Marcosrico commented on PR #2549:
URL: https://github.com/apache/helix/pull/2549#issuecomment-1634583918

   PR approved by @xyuanlu and @qqu0127 
   Commit message: Multithreading Stress Test Lattice - Puppy Logic and Skeleton (Part 1)


-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] xyuanlu commented on a diff in pull request #2549: MultiThreading Stress Test Lattice - Puppy Logic and Skeleton (Part 1)

Posted by "xyuanlu (via GitHub)" <gi...@apache.org>.
xyuanlu commented on code in PR #2549:
URL: https://github.com/apache/helix/pull/2549#discussion_r1262993195


##########
meta-client/src/test/java/org/apache/helix/metaclient/puppy/AbstractPuppy.java:
##########
@@ -0,0 +1,95 @@
+package org.apache.helix.metaclient.puppy;
+
+/*
+ * 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.
+ */
+
+import org.apache.helix.metaclient.api.MetaClientInterface;
+import java.util.HashMap;
+
+/**
+ * AbstractPuppy object contains interfaces to implement puppy and main logics to manage puppy life cycle
+ */
+public abstract class AbstractPuppy implements Runnable {
+
+  protected MetaClientInterface<String> _metaclient;
+  protected PuppySpec _puppySpec;
+  public HashMap<String, Integer> _eventChangeCounterMap;
+  protected int _unhandledErrorCounter;
+
+  public AbstractPuppy(MetaClientInterface<String> metaclient, PuppySpec puppySpec) {
+    this._metaclient = metaclient;
+    this._puppySpec = puppySpec;

Review Comment:
    I guess no need for 'this'?
   



-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] Marcosrico commented on a diff in pull request #2549: MultiThreading Stress Test Lattice - Puppy Logic and Skeleton (Part 1)

Posted by "Marcosrico (via GitHub)" <gi...@apache.org>.
Marcosrico commented on code in PR #2549:
URL: https://github.com/apache/helix/pull/2549#discussion_r1260129836


##########
meta-client/src/test/java/org/apache/helix/metaclient/puppy/AbstractPuppy.java:
##########
@@ -0,0 +1,79 @@
+package org.apache.helix.metaclient.puppy;
+
+/*
+ * 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.
+ */
+
+import org.apache.helix.metaclient.api.MetaClientInterface;
+
+import java.util.HashMap;
+
+/**
+ * AbstractPuppy object contains interfaces to implement puppy and main logics to manage puppy life cycle
+ */
+public abstract class AbstractPuppy implements Runnable {
+
+  protected MetaClientInterface<String> _metaclient;
+  protected PuppySpec _puppySpec;
+  public HashMap<String, Integer> _eventChangeCounterMap;
+  public int _unhandledErrorCounter;

Review Comment:
   I agree with protected security but what I am not quite sure I understands the use case for a getter method here. I can create a helper method that increments the counter but it would also be accessing the member variable the same way.



##########
meta-client/src/test/java/org/apache/helix/metaclient/puppy/AbstractPuppy.java:
##########
@@ -0,0 +1,79 @@
+package org.apache.helix.metaclient.puppy;
+
+/*
+ * 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.
+ */
+
+import org.apache.helix.metaclient.api.MetaClientInterface;
+
+import java.util.HashMap;
+
+/**
+ * AbstractPuppy object contains interfaces to implement puppy and main logics to manage puppy life cycle
+ */
+public abstract class AbstractPuppy implements Runnable {
+
+  protected MetaClientInterface<String> _metaclient;
+  protected PuppySpec _puppySpec;
+  public HashMap<String, Integer> _eventChangeCounterMap;
+  public int _unhandledErrorCounter;

Review Comment:
   I agree with protected security but what I am not quite sure I understand the use case for a getter method here. I can create a helper method that increments the counter but it would also be accessing the member variable the same way.



-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] Marcosrico commented on a diff in pull request #2549: MultiThreading Stress Test Lattice - Puppy Logic and Skeleton (Part 1)

Posted by "Marcosrico (via GitHub)" <gi...@apache.org>.
Marcosrico commented on code in PR #2549:
URL: https://github.com/apache/helix/pull/2549#discussion_r1258655221


##########
meta-client/src/test/java/org/apache/helix/metaclient/puppy/AbstractPuppy.java:
##########
@@ -0,0 +1,84 @@
+package org.apache.helix.metaclient.puppy;
+
+/*
+ * 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.
+ */
+
+import org.apache.helix.metaclient.api.MetaClientInterface;
+
+import java.util.HashMap;
+
+/**
+ * AbstractPuppy object contains interfaces to implement puppy and main logics to manage puppy life cycle
+ */
+public abstract class AbstractPuppy implements Runnable {
+
+  protected MetaClientInterface<String> metaclient;
+  protected PuppySpec puppySpec;
+  public HashMap<String, Integer> eventChangeCounterMap;
+  public int unhandledErrorCounter;
+
+  public AbstractPuppy(MetaClientInterface<String> metaclient, PuppySpec puppySpec) {
+    this.metaclient = metaclient;
+    this.puppySpec = puppySpec;
+    this.eventChangeCounterMap = new HashMap<>();
+  }
+
+  /**
+   * Implements puppy's main logic. Puppy needs to implement its chaos logic, recovery logic based on
+   * errorRate, recoverDelay. For OneOff puppy, it will bark once with execDelay in spec, and for
+   * Repeat puppy, it will bark forever, with execDelay between 2 barks
+   */
+  protected abstract void bark() throws Exception;
+
+  /**
+   * Implements puppy's final cleanup logic - it will be called only once right before the puppy terminates.
+   * Before the puppy terminates, it needs to recover from all chaos it created.
+   */
+  protected abstract void cleanup();
+
+  @Override
+  public void run() {
+    try {
+      while (true) {
+        if (puppySpec.getMode() == PuppyMode.OneOff) {
+          try {
+            bark();
+          } catch (Exception e) {
+            unhandledErrorCounter++;
+            e.printStackTrace();
+          }
+          cleanup();
+          break;
+        } else {
+          try {
+            bark();
+          } catch (Exception e) {
+            unhandledErrorCounter++;
+            e.printStackTrace();
+          }
+          Thread.sleep(puppySpec.getExecDelay().getNextDelay());

Review Comment:
   It's configured in the PuppyManager! The timeout of the puppies is indicates before executing the puppies through the PuppyManager



-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] Marcosrico commented on a diff in pull request #2549: MultiThreading Stress Test Lattice - Puppy Logic and Skeleton (Part 1)

Posted by "Marcosrico (via GitHub)" <gi...@apache.org>.
Marcosrico commented on code in PR #2549:
URL: https://github.com/apache/helix/pull/2549#discussion_r1260132855


##########
meta-client/src/test/java/org/apache/helix/metaclient/puppy/ExecDelay.java:
##########
@@ -0,0 +1,63 @@
+package org.apache.helix.metaclient.puppy;
+
+/*
+ * 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.
+ */
+
+import java.util.Random;
+
+/**
+ * ExecDelay class definition
+ */
+public class ExecDelay {
+  private final long _duration;
+  private final float _jitter;
+
+  private final long _delayBase;
+  private final long _delayRange;
+  private Random _random;
+
+  public ExecDelay(long duration, float jitter) {
+    if (jitter < 0 || jitter > 1 || duration < 0) {
+      throw new IllegalArgumentException(
+          String.format("Invalid _jitter (%s) or _duration (%s)", jitter, duration));
+    }
+    this._duration = duration;
+    this._jitter = jitter;
+    this._delayRange = Math.round(this._duration * this._jitter * 2);
+    this._delayBase = this._duration - this._delayRange / 2;
+  }
+
+  /**
+   * Calculate the next delay based on the configured _duration and _jitter.
+   * @return The next delay in milliseconds.
+   */
+  public long getNextDelay() {
+    _random = new Random();

Review Comment:
   You're right my bad, I've updated it now. I thinks this achieves it! Thanks for the catch!



-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] Marcosrico commented on a diff in pull request #2549: MultiThreading Stress Test Lattice - Puppy Logic and Skeleton (Part 1)

Posted by "Marcosrico (via GitHub)" <gi...@apache.org>.
Marcosrico commented on code in PR #2549:
URL: https://github.com/apache/helix/pull/2549#discussion_r1248244956


##########
meta-client/src/test/java/org/apache/helix/metaclient/puppy/AbstractPuppy.java:
##########
@@ -30,8 +30,8 @@ public abstract class AbstractPuppy implements Runnable {
 
   protected MetaClientInterface<String> metaclient;
   protected PuppySpec puppySpec;
-  protected HashMap<String, Integer> eventChangeCounterMap;
-  protected int unhandledErrorCounter;
+  public HashMap<String, Integer> eventChangeCounterMap;

Review Comment:
   Not a dumb question! I intend to have the implementation of Lattice specific puppies in a separate package so for it to be accessed, it would need to be public.



-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] xyuanlu commented on a diff in pull request #2549: MultiThreading Stress Test Lattice - Puppy Logic and Skeleton (Part 1)

Posted by "xyuanlu (via GitHub)" <gi...@apache.org>.
xyuanlu commented on code in PR #2549:
URL: https://github.com/apache/helix/pull/2549#discussion_r1261760324


##########
meta-client/src/test/java/org/apache/helix/metaclient/puppy/PuppyMode.java:
##########
@@ -0,0 +1,28 @@
+package org.apache.helix.metaclient.puppy;
+
+/*
+ * 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.
+ */
+
+/**
+ * Enum for Puppy mode (OneOff or Repeat)
+ */
+public enum PuppyMode {
+  OneOff,

Review Comment:
   Please follow Enum naming pattern



-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] qqu0127 commented on a diff in pull request #2549: MultiThreading Stress Test Lattice - Puppy Logic and Skeleton (Part 1)

Posted by "qqu0127 (via GitHub)" <gi...@apache.org>.
qqu0127 commented on code in PR #2549:
URL: https://github.com/apache/helix/pull/2549#discussion_r1261902293


##########
meta-client/src/test/java/org/apache/helix/metaclient/puppy/ExecDelay.java:
##########
@@ -0,0 +1,63 @@
+package org.apache.helix.metaclient.puppy;
+
+/*
+ * 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.
+ */
+
+import java.util.Random;
+
+/**
+ * ExecDelay class definition
+ */
+public class ExecDelay {
+  private final long _duration;
+  private final float _jitter;
+
+  private final long _delayBase;
+  private final long _delayRange;
+  private final Random _random;
+
+  public ExecDelay(long duration, float jitter) {
+    if (jitter < 0 || jitter > 1 || duration < 0) {
+      throw new IllegalArgumentException(
+          String.format("Invalid _jitter (%s) or _duration (%s)", jitter, duration));
+    }
+    this._duration = duration;
+    this._jitter = jitter;
+    this._delayRange = Math.round(this._duration * this._jitter * 2);
+    this._delayBase = this._duration - this._delayRange / 2;
+    this._random = new Random();

Review Comment:
   All  `this` can be dropped. Please follow the convention



##########
meta-client/src/test/java/org/apache/helix/metaclient/puppy/PuppyManager.java:
##########
@@ -0,0 +1,65 @@
+package org.apache.helix.metaclient.puppy;
+
+/*
+ * 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.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * This class is used to manage the lifecycle of a set of _puppies.
+ */
+public class PuppyManager {
+  private final List<AbstractPuppy> _puppies;
+  private final ExecutorService EXECUTOR_SERVICE = Executors.newCachedThreadPool();
+
+  public PuppyManager() {
+    _puppies = new ArrayList<>();

Review Comment:
   nit: can be declared inline



##########
meta-client/src/test/java/org/apache/helix/metaclient/puppy/PuppySpec.java:
##########
@@ -0,0 +1,53 @@
+package org.apache.helix.metaclient.puppy;
+
+/*
+ * 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.
+ */
+
+/**
+ * PuppySpec class definition
+ */
+public class PuppySpec {
+  private final PuppyMode mode;
+  private final float errorRate;
+  private final ExecDelay execDelay;
+  private final int numberDiffPaths;
+
+  public PuppySpec(PuppyMode mode, float errorRate, ExecDelay execDelay, int numberDiffPaths) {
+    this.mode = mode;
+    this.errorRate = errorRate;
+    this.execDelay = execDelay;
+    this.numberDiffPaths = numberDiffPaths;

Review Comment:
   Naming convention, use underscore and no need for `this`



-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] qqu0127 commented on a diff in pull request #2549: MultiThreading Stress Test Lattice - Puppy Logic and Skeleton (Part 1)

Posted by "qqu0127 (via GitHub)" <gi...@apache.org>.
qqu0127 commented on code in PR #2549:
URL: https://github.com/apache/helix/pull/2549#discussion_r1248860370


##########
meta-client/src/test/java/org/apache/helix/metaclient/puppy/AbstractPuppy.java:
##########
@@ -0,0 +1,84 @@
+package org.apache.helix.metaclient.puppy;
+
+/*
+ * 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.
+ */
+
+import org.apache.helix.metaclient.api.MetaClientInterface;
+
+import java.util.HashMap;
+
+/**
+ * AbstractPuppy object contains interfaces to implement puppy and main logics to manage puppy life cycle
+ */
+public abstract class AbstractPuppy implements Runnable {
+
+  protected MetaClientInterface<String> metaclient;
+  protected PuppySpec puppySpec;
+  public HashMap<String, Integer> eventChangeCounterMap;
+  public int unhandledErrorCounter;
+
+  public AbstractPuppy(MetaClientInterface<String> metaclient, PuppySpec puppySpec) {
+    this.metaclient = metaclient;
+    this.puppySpec = puppySpec;
+    this.eventChangeCounterMap = new HashMap<>();
+  }
+
+  /**
+   * Implements puppy's main logic. Puppy needs to implement its chaos logic, recovery logic based on
+   * errorRate, recoverDelay. For OneOff puppy, it will bark once with execDelay in spec, and for
+   * Repeat puppy, it will bark forever, with execDelay between 2 barks
+   */
+  protected abstract void bark() throws Exception;
+
+  /**
+   * Implements puppy's final cleanup logic - it will be called only once right before the puppy terminates.
+   * Before the puppy terminates, it needs to recover from all chaos it created.
+   */
+  protected abstract void cleanup();
+
+  @Override
+  public void run() {
+    try {
+      while (true) {
+        if (puppySpec.getMode() == PuppyMode.OneOff) {
+          try {
+            bark();
+          } catch (Exception e) {
+            unhandledErrorCounter++;
+            e.printStackTrace();
+          }
+          cleanup();
+          break;

Review Comment:
   It seems like the difference is on the cleanup() part. Can we do the if branch for that only?



##########
meta-client/src/test/java/org/apache/helix/metaclient/puppy/PuppyManager.java:
##########
@@ -0,0 +1,66 @@
+package org.apache.helix.metaclient.puppy;
+
+/*
+ * 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.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * This class is used to manage the lifecycle of a set of puppies.
+ */
+public class PuppyManager {
+  private List<AbstractPuppy> puppies;
+  private ExecutorService executorService;

Review Comment:
   nit: you can do the initialization inline.



##########
meta-client/src/test/java/org/apache/helix/metaclient/puppy/AbstractPuppy.java:
##########
@@ -0,0 +1,84 @@
+package org.apache.helix.metaclient.puppy;
+
+/*
+ * 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.
+ */
+
+import org.apache.helix.metaclient.api.MetaClientInterface;
+
+import java.util.HashMap;
+
+/**
+ * AbstractPuppy object contains interfaces to implement puppy and main logics to manage puppy life cycle
+ */
+public abstract class AbstractPuppy implements Runnable {
+
+  protected MetaClientInterface<String> metaclient;
+  protected PuppySpec puppySpec;
+  public HashMap<String, Integer> eventChangeCounterMap;
+  public int unhandledErrorCounter;
+
+  public AbstractPuppy(MetaClientInterface<String> metaclient, PuppySpec puppySpec) {
+    this.metaclient = metaclient;
+    this.puppySpec = puppySpec;
+    this.eventChangeCounterMap = new HashMap<>();
+  }
+
+  /**
+   * Implements puppy's main logic. Puppy needs to implement its chaos logic, recovery logic based on
+   * errorRate, recoverDelay. For OneOff puppy, it will bark once with execDelay in spec, and for
+   * Repeat puppy, it will bark forever, with execDelay between 2 barks
+   */
+  protected abstract void bark() throws Exception;
+
+  /**
+   * Implements puppy's final cleanup logic - it will be called only once right before the puppy terminates.
+   * Before the puppy terminates, it needs to recover from all chaos it created.
+   */
+  protected abstract void cleanup();
+
+  @Override
+  public void run() {
+    try {
+      while (true) {
+        if (puppySpec.getMode() == PuppyMode.OneOff) {
+          try {
+            bark();
+          } catch (Exception e) {
+            unhandledErrorCounter++;
+            e.printStackTrace();
+          }
+          cleanup();
+          break;
+        } else {
+          try {
+            bark();
+          } catch (Exception e) {
+            unhandledErrorCounter++;
+            e.printStackTrace();
+          }
+          Thread.sleep(puppySpec.getExecDelay().getNextDelay());

Review Comment:
   Maybe a dump question, how is repeated puppy supposed to stop?



##########
meta-client/src/test/java/org/apache/helix/metaclient/puppy/ExecDelay.java:
##########
@@ -0,0 +1,62 @@
+package org.apache.helix.metaclient.puppy;
+
+/*
+ * 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.
+ */
+
+import java.util.Random;
+
+/**
+ * ExecDelay class definition
+ */
+public class ExecDelay {
+  private final long duration;
+  private final float jitter;
+
+  private final long delayBase;
+  private final long delayRange;
+
+  public ExecDelay(long duration, float jitter) {
+    if (jitter < 0 || jitter > 1 || duration < 0) {
+      throw new IllegalArgumentException(
+          String.format("Invalid jitter (%s) or duration (%s)", jitter, duration));
+    }
+    this.duration = duration;
+    this.jitter = jitter;
+    this.delayRange = Math.round(this.duration * this.jitter * 2);
+    this.delayBase = this.duration - this.delayRange / 2;
+  }
+
+  /**
+   * Calculate the next delay based on the configured duration and jitter.
+   * @return The next delay in milliseconds.
+   */
+  public long getNextDelay() {
+    Random random = new Random();

Review Comment:
   I don't believe you need a new random object each time. This can be a member variable.



-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] desaikomal commented on a diff in pull request #2549: MultiThreading Stress Test Lattice - Puppy Logic and Skeleton (Part 1)

Posted by "desaikomal (via GitHub)" <gi...@apache.org>.
desaikomal commented on code in PR #2549:
URL: https://github.com/apache/helix/pull/2549#discussion_r1248209930


##########
meta-client/src/test/java/org/apache/helix/metaclient/puppy/AbstractPuppy.java:
##########
@@ -30,8 +30,8 @@ public abstract class AbstractPuppy implements Runnable {
 
   protected MetaClientInterface<String> metaclient;
   protected PuppySpec puppySpec;
-  protected HashMap<String, Integer> eventChangeCounterMap;
-  protected int unhandledErrorCounter;
+  public HashMap<String, Integer> eventChangeCounterMap;

Review Comment:
   sorry, may be few dumb questions - why would you make the member public ?



-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] qqu0127 commented on a diff in pull request #2549: MultiThreading Stress Test Lattice - Puppy Logic and Skeleton (Part 1)

Posted by "qqu0127 (via GitHub)" <gi...@apache.org>.
qqu0127 commented on code in PR #2549:
URL: https://github.com/apache/helix/pull/2549#discussion_r1259212519


##########
meta-client/src/test/java/org/apache/helix/metaclient/puppy/AbstractPuppy.java:
##########
@@ -0,0 +1,79 @@
+package org.apache.helix.metaclient.puppy;
+
+/*
+ * 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.
+ */
+
+import org.apache.helix.metaclient.api.MetaClientInterface;
+
+import java.util.HashMap;
+
+/**
+ * AbstractPuppy object contains interfaces to implement puppy and main logics to manage puppy life cycle
+ */
+public abstract class AbstractPuppy implements Runnable {
+
+  protected MetaClientInterface<String> _metaclient;
+  protected PuppySpec _puppySpec;
+  public HashMap<String, Integer> _eventChangeCounterMap;
+  public int _unhandledErrorCounter;

Review Comment:
   I'd suggest try using getters instead of direct access. Besides, I think protected should be enough scope. 



##########
meta-client/src/test/java/org/apache/helix/metaclient/puppy/ExecDelay.java:
##########
@@ -0,0 +1,63 @@
+package org.apache.helix.metaclient.puppy;
+
+/*
+ * 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.
+ */
+
+import java.util.Random;
+
+/**
+ * ExecDelay class definition
+ */
+public class ExecDelay {
+  private final long _duration;
+  private final float _jitter;
+
+  private final long _delayBase;
+  private final long _delayRange;
+  private Random _random;
+
+  public ExecDelay(long duration, float jitter) {
+    if (jitter < 0 || jitter > 1 || duration < 0) {
+      throw new IllegalArgumentException(
+          String.format("Invalid _jitter (%s) or _duration (%s)", jitter, duration));
+    }
+    this._duration = duration;
+    this._jitter = jitter;
+    this._delayRange = Math.round(this._duration * this._jitter * 2);
+    this._delayBase = this._duration - this._delayRange / 2;
+  }
+
+  /**
+   * Calculate the next delay based on the configured _duration and _jitter.
+   * @return The next delay in milliseconds.
+   */
+  public long getNextDelay() {
+    _random = new Random();

Review Comment:
   Have you updated? It still creates new Random instance every time. 



-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] Marcosrico commented on a diff in pull request #2549: MultiThreading Stress Test Lattice - Puppy Logic and Skeleton (Part 1)

Posted by "Marcosrico (via GitHub)" <gi...@apache.org>.
Marcosrico commented on code in PR #2549:
URL: https://github.com/apache/helix/pull/2549#discussion_r1262808642


##########
meta-client/src/test/java/org/apache/helix/metaclient/puppy/PuppyMode.java:
##########
@@ -0,0 +1,28 @@
+package org.apache.helix.metaclient.puppy;
+
+/*
+ * 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.
+ */
+
+/**
+ * Enum for Puppy mode (OneOff or Repeat)
+ */
+public enum PuppyMode {
+  OneOff,

Review Comment:
   Enum pattern with capitalized correct?



-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] Marcosrico commented on a diff in pull request #2549: MultiThreading Stress Test Lattice - Puppy Logic and Skeleton (Part 1)

Posted by "Marcosrico (via GitHub)" <gi...@apache.org>.
Marcosrico commented on code in PR #2549:
URL: https://github.com/apache/helix/pull/2549#discussion_r1258949907


##########
meta-client/src/test/java/org/apache/helix/metaclient/puppy/AbstractPuppy.java:
##########
@@ -0,0 +1,84 @@
+package org.apache.helix.metaclient.puppy;
+
+/*
+ * 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.
+ */
+
+import org.apache.helix.metaclient.api.MetaClientInterface;
+
+import java.util.HashMap;
+
+/**
+ * AbstractPuppy object contains interfaces to implement puppy and main logics to manage puppy life cycle
+ */
+public abstract class AbstractPuppy implements Runnable {
+
+  protected MetaClientInterface<String> metaclient;
+  protected PuppySpec puppySpec;
+  public HashMap<String, Integer> eventChangeCounterMap;
+  public int unhandledErrorCounter;
+
+  public AbstractPuppy(MetaClientInterface<String> metaclient, PuppySpec puppySpec) {
+    this.metaclient = metaclient;
+    this.puppySpec = puppySpec;
+    this.eventChangeCounterMap = new HashMap<>();
+  }
+
+  /**
+   * Implements puppy's main logic. Puppy needs to implement its chaos logic, recovery logic based on
+   * errorRate, recoverDelay. For OneOff puppy, it will bark once with execDelay in spec, and for
+   * Repeat puppy, it will bark forever, with execDelay between 2 barks
+   */
+  protected abstract void bark() throws Exception;
+
+  /**
+   * Implements puppy's final cleanup logic - it will be called only once right before the puppy terminates.
+   * Before the puppy terminates, it needs to recover from all chaos it created.
+   */
+  protected abstract void cleanup();
+
+  @Override
+  public void run() {
+    try {
+      while (true) {
+        if (puppySpec.getMode() == PuppyMode.OneOff) {
+          try {
+            bark();
+          } catch (Exception e) {
+            unhandledErrorCounter++;
+            e.printStackTrace();
+          }
+          cleanup();
+          break;

Review Comment:
   True, i can simplify the if statement for just the cleanup. Thanks!



-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] Marcosrico commented on a diff in pull request #2549: MultiThreading Stress Test Lattice - Puppy Logic and Skeleton (Part 1)

Posted by "Marcosrico (via GitHub)" <gi...@apache.org>.
Marcosrico commented on code in PR #2549:
URL: https://github.com/apache/helix/pull/2549#discussion_r1258957680


##########
meta-client/src/test/java/org/apache/helix/metaclient/puppy/ExecDelay.java:
##########
@@ -0,0 +1,62 @@
+package org.apache.helix.metaclient.puppy;
+
+/*
+ * 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.
+ */
+
+import java.util.Random;
+
+/**
+ * ExecDelay class definition
+ */
+public class ExecDelay {
+  private final long duration;
+  private final float jitter;
+
+  private final long delayBase;
+  private final long delayRange;
+
+  public ExecDelay(long duration, float jitter) {
+    if (jitter < 0 || jitter > 1 || duration < 0) {
+      throw new IllegalArgumentException(
+          String.format("Invalid jitter (%s) or duration (%s)", jitter, duration));
+    }
+    this.duration = duration;
+    this.jitter = jitter;
+    this.delayRange = Math.round(this.duration * this.jitter * 2);
+    this.delayBase = this.duration - this.delayRange / 2;
+  }
+
+  /**
+   * Calculate the next delay based on the configured duration and jitter.
+   * @return The next delay in milliseconds.
+   */
+  public long getNextDelay() {
+    Random random = new Random();

Review Comment:
   That makes sense, will fix. thanks!



-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] Marcosrico commented on a diff in pull request #2549: MultiThreading Stress Test Lattice - Puppy Logic and Skeleton (Part 1)

Posted by "Marcosrico (via GitHub)" <gi...@apache.org>.
Marcosrico commented on code in PR #2549:
URL: https://github.com/apache/helix/pull/2549#discussion_r1262994370


##########
meta-client/src/test/java/org/apache/helix/metaclient/puppy/AbstractPuppy.java:
##########
@@ -0,0 +1,95 @@
+package org.apache.helix.metaclient.puppy;
+
+/*
+ * 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.
+ */
+
+import org.apache.helix.metaclient.api.MetaClientInterface;
+import java.util.HashMap;
+
+/**
+ * AbstractPuppy object contains interfaces to implement puppy and main logics to manage puppy life cycle
+ */
+public abstract class AbstractPuppy implements Runnable {
+
+  protected MetaClientInterface<String> _metaclient;
+  protected PuppySpec _puppySpec;
+  public HashMap<String, Integer> _eventChangeCounterMap;
+  protected int _unhandledErrorCounter;
+
+  public AbstractPuppy(MetaClientInterface<String> metaclient, PuppySpec puppySpec) {
+    this._metaclient = metaclient;
+    this._puppySpec = puppySpec;

Review Comment:
   My bad I missed it! Thanks for the catch



-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] xyuanlu merged pull request #2549: MultiThreading Stress Test Lattice - Puppy Logic and Skeleton (Part 1)

Posted by "xyuanlu (via GitHub)" <gi...@apache.org>.
xyuanlu merged PR #2549:
URL: https://github.com/apache/helix/pull/2549


-- 
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: reviews-unsubscribe@helix.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org