Repository: apache/incubator-fluo (java)

Issue:
Fix name of ParitionManger class
The name of the class `ParitionManager` should be fixed and renamed to `PartitionManager`.

Pull request:
fixes #860 spelled partition corectly

Patch:
diff --git a/modules/core/src/main/java/org/apache/fluo/core/worker/finder/hash/ParitionManager.java b/modules/core/src/main/java/org/apache/fluo/core/worker/finder/hash/PartitionManager.java
similarity index 98%
rename from modules/core/src/main/java/org/apache/fluo/core/worker/finder/hash/ParitionManager.java
rename to modules/core/src/main/java/org/apache/fluo/core/worker/finder/hash/PartitionManager.java
index 3ebb01e1..f0e6305d 100644
--- a/modules/core/src/main/java/org/apache/fluo/core/worker/finder/hash/ParitionManager.java
+++ b/modules/core/src/main/java/org/apache/fluo/core/worker/finder/hash/PartitionManager.java
@@ -67,9 +67,9 @@ import static java.nio.charset.StandardCharsets.UTF_8;
  * notifications. This limitation is important for scaling, even if there are 1,000 workers there
  * will never be more than 7 to 13 workers scanning a portion of the table.
  */
-public class ParitionManager {
+public class PartitionManager {
 
-  private static final Logger log = LoggerFactory.getLogger(ParitionManager.class);
+  private static final Logger log = LoggerFactory.getLogger(PartitionManager.class);
 
   private final PathChildrenCache childrenCache;
   private final PersistentEphemeralNode myESNode;
@@ -267,7 +267,7 @@ public class ParitionManager {
     }
   }
 
-  ParitionManager(Environment env, long minSleepTime, long maxSleepTime) {
+  PartitionManager(Environment env, long minSleepTime, long maxSleepTime) {
     try {
       this.curator = env.getSharedResources().getCurator();
       this.env = env;
diff --git a/modules/core/src/main/java/org/apache/fluo/core/worker/finder/hash/PartitionNotificationFinder.java b/modules/core/src/main/java/org/apache/fluo/core/worker/finder/hash/PartitionNotificationFinder.java
index c9408504..c3649aaa 100644
--- a/modules/core/src/main/java/org/apache/fluo/core/worker/finder/hash/PartitionNotificationFinder.java
+++ b/modules/core/src/main/java/org/apache/fluo/core/worker/finder/hash/PartitionNotificationFinder.java
@@ -26,7 +26,7 @@ import org.apache.fluo.core.worker.TxResult;
 
 public class PartitionNotificationFinder implements NotificationFinder {
 
-  private ParitionManager paritionManager;
+  private PartitionManager partitionManager;
   private Thread scanThread;
   private NotificationProcessor processor;
   private Environment env;
@@ -49,10 +49,10 @@ public class PartitionNotificationFinder implements NotificationFinder {
         env.getConfiguration().getInt(FluoConfigurationImpl.NTFY_FINDER_MAX_SLEEP_TIME_PROP,
             FluoConfigurationImpl.NTFY_FINDER_MAX_SLEEP_TIME_DEFAULT);
 
-    paritionManager = new ParitionManager(env, minSleepTime, maxSleepTime);
+    partitionManager = new PartitionManager(env, minSleepTime, maxSleepTime);
 
     scanThread =
-        new Thread(new ScanTask(this, processor, paritionManager, env, stopped, minSleepTime,
+        new Thread(new ScanTask(this, processor, partitionManager, env, stopped, minSleepTime,
             maxSleepTime));
     scanThread.setName(getClass().getSimpleName() + " " + ScanTask.class.getSimpleName());
     scanThread.setDaemon(true);
@@ -70,12 +70,12 @@ public class PartitionNotificationFinder implements NotificationFinder {
       throw new RuntimeException(e);
     }
 
-    paritionManager.stop();
+    partitionManager.stop();
   }
 
   @Override
   public boolean shouldProcess(Notification notification) {
-    return paritionManager.shouldProcess(notification);
+    return partitionManager.shouldProcess(notification);
   }
 
   @Override
diff --git a/modules/core/src/main/java/org/apache/fluo/core/worker/finder/hash/ScanTask.java b/modules/core/src/main/java/org/apache/fluo/core/worker/finder/hash/ScanTask.java
index 00726a8d..3ebc6254 100644
--- a/modules/core/src/main/java/org/apache/fluo/core/worker/finder/hash/ScanTask.java
+++ b/modules/core/src/main/java/org/apache/fluo/core/worker/finder/hash/ScanTask.java
@@ -47,7 +47,7 @@ public class ScanTask implements Runnable {
   private static final Logger log = LoggerFactory.getLogger(ScanTask.class);
 
   private final NotificationFinder finder;
-  private final ParitionManager partitionManager;
+  private final PartitionManager partitionManager;
   private final NotificationProcessor proccessor;
   private final Random rand = new Random();
   private final AtomicBoolean stopped;
@@ -58,7 +58,7 @@ public class ScanTask implements Runnable {
   private long maxSleepTime;
 
   ScanTask(NotificationFinder finder, NotificationProcessor proccessor,
-      ParitionManager partitionManager, Environment env, AtomicBoolean stopped, long minSleepTime,
+      PartitionManager partitionManager, Environment env, AtomicBoolean stopped, long minSleepTime,
       long maxSleepTime) {
     this.finder = finder;
     this.rangeData = new HashMap<>();
@@ -76,6 +76,7 @@ public class ScanTask implements Runnable {
   @Override
   public void run() {
 
+
     List<TableRange> ranges = new ArrayList<>();
     Set<TableRange> rangeSet = new HashSet<>();
 
@@ -134,12 +135,7 @@ public class ScanTask implements Runnable {
           // nothing to do
         }
 
-        long sleepTime;
-        if (!partition.equals(partitionManager.getPartitionInfo())) {
-          sleepTime = minSleepTime;
-        } else {
-          sleepTime = Math.max(minSleepTime, minRetryTime - System.currentTimeMillis());
-        }
+        long sleepTime = Math.max(minSleepTime, minRetryTime - System.currentTimeMillis());
 
         qSize = proccessor.size();
 
diff --git a/pom.xml b/pom.xml
index c8916166..f0ad6d5e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -359,20 +359,6 @@
     </plugins>
   </build>
   <profiles>
-    <profile>
-      <!-- This profile skips all Quality Assurance checks  -->
-      <id>skipQA</id>
-      <properties>
-        <accumulo.skip>true</accumulo.skip>
-        <checkstyle.skip>true</checkstyle.skip>
-        <findbugs.skip>true</findbugs.skip>
-        <mdep.analyze.skip>true</mdep.analyze.skip>
-        <modernizer.skip>true</modernizer.skip>
-        <rat.skip>true</rat.skip>
-        <skipITs>true</skipITs>
-        <skipTests>true</skipTests>
-      </properties>
-    </profile>
     <profile>
       <id>fluo-release</id>
       <!-- some properties to make the release build a bit faster -->


Test patch:
diff --git a/modules/core/src/test/java/org/apache/fluo/core/worker/finder/hash/HashTest.java b/modules/core/src/test/java/org/apache/fluo/core/worker/finder/hash/HashTest.java
index b3496dd4..1d1c5a69 100644
--- a/modules/core/src/test/java/org/apache/fluo/core/worker/finder/hash/HashTest.java
+++ b/modules/core/src/test/java/org/apache/fluo/core/worker/finder/hash/HashTest.java
@@ -63,7 +63,7 @@ public class HashTest {
     byte[] cfcq = NotificationUtil.encodeCol(col);
     Key k = new Key(row, ColumnConstants.NOTIFY_CF.toArray(), cfcq, new byte[0], 6);
     boolean accept = NotificationHashFilter.accept(k, 7, 3);
-    Assert.assertEquals(accept, ParitionManager.shouldProcess(Notification.from(k), 7, 3));
+    Assert.assertEquals(accept, PartitionManager.shouldProcess(Notification.from(k), 7, 3));
     return accept;
   }
 }
diff --git a/modules/core/src/test/java/org/apache/fluo/core/worker/finder/hash/PartitionManagerTest.java b/modules/core/src/test/java/org/apache/fluo/core/worker/finder/hash/PartitionManagerTest.java
index 8a02edc1..b3d0d648 100644
--- a/modules/core/src/test/java/org/apache/fluo/core/worker/finder/hash/PartitionManagerTest.java
+++ b/modules/core/src/test/java/org/apache/fluo/core/worker/finder/hash/PartitionManagerTest.java
@@ -59,7 +59,7 @@ public class PartitionManagerTest {
 
           for (int i = 0; i < numWorkers; i++) {
             String me = nff.apply(i);
-            PartitionInfo pi = ParitionManager.getGroupInfo(me, children, tablets, groupSize);
+            PartitionInfo pi = PartitionManager.getGroupInfo(me, children, tablets, groupSize);
             Assert.assertEquals(expectedGroups, pi.getNumGroups());
             Assert.assertTrue(pi.getMyGroupSize() >= Math.min(numWorkers, groupSize)
                 && pi.getMyGroupSize() <= maxGroupSize);