anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: haxefoundation/intellij-haxe
Issue: Wrong resolution order. Import alias should be resolved before package name.

```haxe
package sample;
class Foo {}
```
```haxe
import something.Bar.instance as sample;

public static function main() {
   sample.doThings();
}
```

`sample` should be resolved as `something.Bar.instance`  not as package `sample`.

Changed files:
src/common/com/intellij/plugins/haxe/lang/psi/HaxeResolver.java

diff --git a/src/common/com/intellij/plugins/haxe/lang/psi/HaxeResolver.java b/src/common/com/intellij/plugins/haxe/lang/psi/HaxeResolver.java
index 6b6d5388..604d2395 100644
--- a/src/common/com/intellij/plugins/haxe/lang/psi/HaxeResolver.java
+++ b/src/common/com/intellij/plugins/haxe/lang/psi/HaxeResolver.java
@@ -75,6 +75,21 @@ public class HaxeResolver implements ResolveCache.AbstractResolver<HaxeReference
         return superElements;
       }
 
+      HaxeFileModel fileModel = HaxeFileModel.fromElement(reference);
+      if (fileModel != null) {
+        String className = reference.getText();
+
+        PsiElement target = HaxeResolveUtil.searchInSameFile(fileModel, className);
+        if (target == null) target = HaxeResolveUtil.searchInImports(fileModel, className);
+        if (target == null) target = HaxeResolveUtil.searchInSamePackage(fileModel, className);
+
+        if (target != null) {
+          return asList(target);
+        }
+      }
+
+      LogResolution(reference, "failed after exhausting all options.");
+
       if (PsiNameHelper.getInstance(reference.getProject()).isQualifiedName(reference.getText())) {
         List<HaxeModel> resolvedPackage =
           HaxeProjectModel.fromElement(reference).resolve(new FullyQualifiedInfo(reference.getText()), reference.getResolveScope());
@@ -83,19 +98,6 @@ public class HaxeResolver implements ResolveCache.AbstractResolver<HaxeReference
           return Collections.singletonList(resolvedPackage.get(0).getBasePsi());
         }
       }
-
-      HaxeFileModel fileModel = HaxeFileModel.fromElement(reference);
-      String className = reference.getText();
-
-      PsiElement target = HaxeResolveUtil.searchInSameFile(fileModel, className);
-      if (target == null) target = HaxeResolveUtil.searchInImports(fileModel, className);
-      if (target == null) target = HaxeResolveUtil.searchInSamePackage(fileModel, className);
-
-      if (target != null) {
-        return asList(target);
-      }
-
-      LogResolution(reference, "failed after exhausting all options.");
     }
 
     return result == null ? ContainerUtil.emptyList() : result;
Repository: haxefoundation/intellij-haxe
Issue: [FIND USAGE] incorrect reference verification for COMPONENT_NAME elements

suppose following code:

```
var foo = new Sprite();
trace(foo);
trace(foo);
```

If you place cursor on second or third line and try to find usages, both usages will be found. But if you'll try to do the same for the first line (in the variable declaration) - no usages will be found.

The problem here is that "var foo" is a reference to PsiElement with token type "COMPONENT_NAME". t
The foo in "trace(foo);", are references to  PsiElement with token type "LOCAL_VAR_DECLARATION_PART", which is parent of element type referenced by "var foo".

In this way elements do not match, and the usages is not found (also refactor->rename doesn't work). I really think that this is a very major bug. 

I've fixed problem in HaxeReferenceImpl::isReferenceTo, by changing the last row 

```
return !chain && resolve == element;
```

to

```
if (element instanceof HaxeComponentName) {
      return !chain && resolve == element.getParent();
    }else {
      return !chain && resolve == element;
    }
```

TIR: STB-9359

but I'm not sure if it's a good way to fix this issue.


Changed files:
src/common/com/intellij/plugins/haxe/lang/psi/impl/HaxePsiTypeAdapter.java, src/common/com/intellij/plugins/haxe/lang/psi/impl/HaxePsiFieldImpl.java

diff --git a/src/common/com/intellij/plugins/haxe/lang/psi/impl/HaxePsiFieldImpl.java b/src/common/com/intellij/plugins/haxe/lang/psi/impl/HaxePsiFieldImpl.java
index 5000e2ec..dbb10b41 100644
--- a/src/common/com/intellij/plugins/haxe/lang/psi/impl/HaxePsiFieldImpl.java
+++ b/src/common/com/intellij/plugins/haxe/lang/psi/impl/HaxePsiFieldImpl.java
@@ -138,7 +138,7 @@ public abstract class HaxePsiFieldImpl extends AbstractHaxeNamedComponent implem
       final HaxeType            type      = (toa != null) ? toa.getType() : null;
       psiType                             = (type != null) ? type.getPsiType() : null;
     }
-    return psiType;
+    return psiType != null ? psiType : HaxePsiTypeAdapter.DYNAMIC;
   }
 
   @Nullable
diff --git a/src/common/com/intellij/plugins/haxe/lang/psi/impl/HaxePsiTypeAdapter.java b/src/common/com/intellij/plugins/haxe/lang/psi/impl/HaxePsiTypeAdapter.java
index 85c096d7..da0471f1 100644
--- a/src/common/com/intellij/plugins/haxe/lang/psi/impl/HaxePsiTypeAdapter.java
+++ b/src/common/com/intellij/plugins/haxe/lang/psi/impl/HaxePsiTypeAdapter.java
@@ -54,11 +54,13 @@ import javax.swing.*;
  */
 public class HaxePsiTypeAdapter extends PsiType implements HaxeType {
 
-  Logger LOG = Logger.getInstance("#com.intellij.plugins.haxe.lang.psi.impl.HaxePsiTypeAdapter");
-  {
+  static final Logger LOG = Logger.getInstance("#com.intellij.plugins.haxe.lang.psi.impl.HaxePsiTypeAdapter");
+  static {
     LOG.setLevel(Level.DEBUG);
   }
 
+  public static final PsiPrimitiveType DYNAMIC = new PsiPrimitiveType("Dynamic", PsiAnnotation.EMPTY_ARRAY);
+
   HaxeType myType = null;
 
   public HaxePsiTypeAdapter(@NotNull HaxeType haxeType) {
Repository: haxefoundation/intellij-haxe
Issue: Imports: incorrect processing for duplicated imports

suppose code:

```
import somepack.classA;
import somepack.classA;
import somepack.classB;
```

Expected result:

Only second import statement is marked as unused.

Actual result:

Both second and third import statements are marked as unused.


Changed files:
src/com/intellij/plugins/haxe/util/HaxeImportUtil.java

diff --git a/src/com/intellij/plugins/haxe/util/HaxeImportUtil.java b/src/com/intellij/plugins/haxe/util/HaxeImportUtil.java
index 6a23390a..44646577 100644
--- a/src/com/intellij/plugins/haxe/util/HaxeImportUtil.java
+++ b/src/com/intellij/plugins/haxe/util/HaxeImportUtil.java
@@ -59,9 +59,10 @@ public class HaxeImportUtil {
       }
     });
 
-    boolean alreadyAdded = false;
 
     for (int i = 0; i < usefulImportStatements.size(); i++) {
+      boolean alreadyAdded = false;
+
       for (int j = 0; j < filteredUsefulImports.size(); j++) {
         if (usefulImportStatements.get(i).getReferenceExpression().getText().equals(
           filteredUsefulImports.get(j).getReferenceExpression().getText())) {
@@ -151,9 +152,10 @@ public class HaxeImportUtil {
         }
       });
 
-    boolean alreadyAdded = false;
 
     for (int i = 0; i < usefulImportStatementWithInSupports.size(); i++) {
+      boolean alreadyAdded = false;
+
       for (int j = 0; j < filteredUsefulImports.size(); j++) {
         if (usefulImportStatementWithInSupports.get(i).getReferenceExpression().getText().equals(
           filteredUsefulImports.get(j).getReferenceExpression().getText())
@@ -249,9 +251,11 @@ public class HaxeImportUtil {
         }
       });
 
-    boolean alreadyAdded = false;
 
     for (int i = 0; i < usefulImportStatementWithInSupports.size(); i++) {
+
+      boolean alreadyAdded = false;
+
       for (int j = 0; j < filteredUsefulImports.size(); j++) {
         if (usefulImportStatementWithInSupports.get(i).getReferenceExpression().getText().equals(
           filteredUsefulImports.get(j).getReferenceExpression().getText())) {
Repository: haxefoundation/intellij-haxe
Issue: [CODE REFORMAT] incorrect reformat for object and array children

suppose you have following code:

```
var arr = [{a:1},{a:2},{a:3}];
```

You could separate it to several lines of code. In this case you expect code like this:

```
var arr = [
    {
        a:1
    },
    {
        a:2
    },
    {
        a:3
    }
];
```

actually after reformat the result is like this:

```
var arr = [
{
a:1
},
{
a:2
},
{
a:3
}
];
```


Changed files:
src/com/intellij/plugins/haxe/ide/formatter/HaxeIndentProcessor.java

diff --git a/src/com/intellij/plugins/haxe/ide/formatter/HaxeIndentProcessor.java b/src/com/intellij/plugins/haxe/ide/formatter/HaxeIndentProcessor.java
index f46c63f0..2ef00d91 100644
--- a/src/com/intellij/plugins/haxe/ide/formatter/HaxeIndentProcessor.java
+++ b/src/com/intellij/plugins/haxe/ide/formatter/HaxeIndentProcessor.java
@@ -79,7 +79,7 @@ public class HaxeIndentProcessor {
       }
       return Indent.getNormalIndent();
     }
-    if (needIndent(parentType)) {
+    if (needIndent(parentType, elementType)) {
       final PsiElement psi = node.getPsi();
       if (psi.getParent() instanceof PsiFile) {
         return Indent.getNoneIndent();
@@ -114,12 +114,15 @@ public class HaxeIndentProcessor {
     return Indent.getNoneIndent();
   }
 
-  private static boolean needIndent(@Nullable IElementType type) {
+  private static boolean needIndent(@Nullable IElementType type, IElementType elementType) {
     if (type == null) {
       return false;
     }
     boolean result = type == BLOCK_STATEMENT;
     result = result || type == CLASS_BODY;
+    result = result || (type == ARRAY_LITERAL && elementType != PLBRACK && elementType != PRBRACK);
+    result = result || type == OBJECT_LITERAL;
+    result = result || type == CLASS_BODY;
     result = result || type == EXTERN_CLASS_DECLARATION_BODY;
     result = result || type == ENUM_BODY;
     result = result || type == INTERFACE_BODY;
Repository: smallrye/smallrye-reactive-messaging
Issue: Cannot configure dead letter queue value serializer

When using Kafka `dead-letter-queue` failure strategy, adding a `dead-letter-queue.value.serializer` has no impact, and the name deduced from the `value.deserializer` is still used. See [KafkaDeadLetterQueue lines 41-42](https://github.com/smallrye/smallrye-reactive-messaging/blob/master/smallrye-reactive-messaging-kafka/src/main/java/io/smallrye/reactive/messaging/kafka/fault/KafkaDeadLetterQueue.java#L41-L42), it is using the key serializer config rather than value deserializer

Changed files:
smallrye-reactive-messaging-kafka/src/main/java/io/smallrye/reactive/messaging/kafka/fault/KafkaDeadLetterQueue.java

diff --git a/smallrye-reactive-messaging-kafka/src/main/java/io/smallrye/reactive/messaging/kafka/fault/KafkaDeadLetterQueue.java b/smallrye-reactive-messaging-kafka/src/main/java/io/smallrye/reactive/messaging/kafka/fault/KafkaDeadLetterQueue.java
index 07324df42..2a854b71f 100644
--- a/smallrye-reactive-messaging-kafka/src/main/java/io/smallrye/reactive/messaging/kafka/fault/KafkaDeadLetterQueue.java
+++ b/smallrye-reactive-messaging-kafka/src/main/java/io/smallrye/reactive/messaging/kafka/fault/KafkaDeadLetterQueue.java
@@ -39,7 +39,7 @@ public class KafkaDeadLetterQueue implements KafkaFailureHandler {
         deadQueueProducerConfig.put("key.serializer",
                 conf.getDeadLetterQueueKeySerializer().orElse(getMirrorSerializer(keyDeserializer)));
         deadQueueProducerConfig.put("value.serializer",
-                conf.getDeadLetterQueueKeySerializer().orElse(getMirrorSerializer(valueDeserializer)));
+                conf.getDeadLetterQueueValueSerializer().orElse(getMirrorSerializer(valueDeserializer)));
 
         String deadQueueTopic = conf.getDeadLetterQueueTopic().orElse("dead-letter-topic-" + conf.getChannel());
Repository: smallrye/smallrye-reactive-messaging
Issue: MP Emitter repackaged from unreleased spec is not marked as Experimental

While there is a note in duplicated `org.eclipse.microprofile.reactive.messaging` package info that new features and changes against the spec are marked with `@Experimental` annotation.

https://github.com/smallrye/smallrye-reactive-messaging/blob/24e3993fd69e6bdc7a1bc60d4deee6a05788bfdd/api/src/main/java/org/eclipse/microprofile/reactive/messaging/package-info.java#L21-L26

`Emitter` and `Channel` are missing this, thus causing confusion between users as this is not part of released spec.

https://github.com/smallrye/smallrye-reactive-messaging/blob/24e3993fd69e6bdc7a1bc60d4deee6a05788bfdd/api/src/main/java/org/eclipse/microprofile/reactive/messaging/Emitter.java#L23-L48



Changed files:
api/src/main/java/org/eclipse/microprofile/reactive/messaging/Channel.java, api/src/main/java/org/eclipse/microprofile/reactive/messaging/Emitter.java

diff --git a/api/src/main/java/org/eclipse/microprofile/reactive/messaging/Channel.java b/api/src/main/java/org/eclipse/microprofile/reactive/messaging/Channel.java
index 8feee86ea..55755b583 100644
--- a/api/src/main/java/org/eclipse/microprofile/reactive/messaging/Channel.java
+++ b/api/src/main/java/org/eclipse/microprofile/reactive/messaging/Channel.java
@@ -27,6 +27,8 @@ import java.lang.annotation.Target;
 import javax.enterprise.util.Nonbinding;
 import javax.inject.Qualifier;
 
+import io.smallrye.common.annotation.Experimental;
+
 /**
  * This qualifier indicates which channel should be injected / populated.
  * <p>
@@ -52,13 +54,14 @@ import javax.inject.Qualifier;
  * emitter.send("a");
  * </code>
  * </pre>
- * 
+ *
  * A subscriber for the above channel must be found by the time a message is emitted to the channel.
  * Otherwise, {@code IllegalStateException} must be thrown.
  */
 @Qualifier
 @Retention(RetentionPolicy.RUNTIME)
 @Target({ METHOD, CONSTRUCTOR, FIELD, PARAMETER })
+@Experimental("smallrye-only, added to the specification")
 public @interface Channel {
 
     /**
diff --git a/api/src/main/java/org/eclipse/microprofile/reactive/messaging/Emitter.java b/api/src/main/java/org/eclipse/microprofile/reactive/messaging/Emitter.java
index e00f23ff1..22210f9b6 100644
--- a/api/src/main/java/org/eclipse/microprofile/reactive/messaging/Emitter.java
+++ b/api/src/main/java/org/eclipse/microprofile/reactive/messaging/Emitter.java
@@ -20,6 +20,8 @@ package org.eclipse.microprofile.reactive.messaging;
 
 import java.util.concurrent.CompletionStage;
 
+import io.smallrye.common.annotation.Experimental;
+
 /**
  * Interface used to feed a channel from an <em>imperative</em> piece of code.
  * <p>
@@ -45,6 +47,7 @@ import java.util.concurrent.CompletionStage;
  *
  * @param <T> type of payload
  */
+@Experimental("smallrye-only, added to the specification")
 public interface Emitter<T> {
 
     /**
Repository: smallrye/smallrye-reactive-messaging
Issue: Kafka passwords are written to the logs

When using smallrye-reactive-messaging with the Kafka connector, the connector merge the config and log this merged config.
It output the password in the logs, this is a security issue.

See this sample log file from a Quarkus application

```
2020-09-22 11:12:12,230 INFO  [io.sma.rea.mes.kafka] (Quarkus Main Thread) SRMSG18200: Merging config with {security.protocol=SSL, ssl.keystore.type=PKCS12, ssl.truststore.location=truststore.jks, ssl.keystore.password=secret, ssl.key.password=secret, ssl.keystore.location=keystore.p12, bootstrap.servers=my-host:9092, ssl.truststore.password=secret}
```

Changed files:
smallrye-reactive-messaging-kafka/src/main/java/io/smallrye/reactive/messaging/kafka/i18n/KafkaLogging.java
smallrye-reactive-messaging-kafka/src/main/java/io/smallrye/reactive/messaging/kafka/KafkaConnector.java

diff --git a/smallrye-reactive-messaging-kafka/src/main/java/io/smallrye/reactive/messaging/kafka/KafkaConnector.java b/smallrye-reactive-messaging-kafka/src/main/java/io/smallrye/reactive/messaging/kafka/KafkaConnector.java
index 7eefe4765..2f90b64af 100644
--- a/smallrye-reactive-messaging-kafka/src/main/java/io/smallrye/reactive/messaging/kafka/KafkaConnector.java
+++ b/smallrye-reactive-messaging-kafka/src/main/java/io/smallrye/reactive/messaging/kafka/KafkaConnector.java
@@ -183,8 +183,6 @@ public class KafkaConnector implements IncomingConnectorFactory, OutgoingConnect
     }
 
     private Config merge(Config passedCfg, Map<String, Object> defaultKafkaCfg) {
-        log.mergingConfigWith(defaultKafkaCfg);
-
         return new Config() {
             @SuppressWarnings("unchecked")
             @Override
diff --git a/smallrye-reactive-messaging-kafka/src/main/java/io/smallrye/reactive/messaging/kafka/i18n/KafkaLogging.java b/smallrye-reactive-messaging-kafka/src/main/java/io/smallrye/reactive/messaging/kafka/i18n/KafkaLogging.java
index b15e52495..177f7b1bb 100644
--- a/smallrye-reactive-messaging-kafka/src/main/java/io/smallrye/reactive/messaging/kafka/i18n/KafkaLogging.java
+++ b/smallrye-reactive-messaging-kafka/src/main/java/io/smallrye/reactive/messaging/kafka/i18n/KafkaLogging.java
@@ -1,6 +1,5 @@
 package io.smallrye.reactive.messaging.kafka.i18n;
 
-import java.util.Map;
 import java.util.Set;
 
 import org.jboss.logging.BasicLogger;
@@ -19,10 +18,6 @@ public interface KafkaLogging extends BasicLogger {
 
     KafkaLogging log = Logger.getMessageLogger(KafkaLogging.class, "io.smallrye.reactive.messaging.kafka");
 
-    @LogMessage(level = Logger.Level.INFO)
-    @Message(id = 18200, value = "Merging config with %s")
-    void mergingConfigWith(Map<String, Object> defaultKafkaCfg);
-
     @LogMessage(level = Logger.Level.DEBUG)
     @Message(id = 18201, value = "Dead queue letter configured with: topic: `%s`, key serializer: `%s`, value serializer: `%s`")
     void deadLetterConfig(String deadQueueTopic, String keySerializer, String valueSerializer);
Repository: google/ground-android
Issue: [Feature details] Observation sync sometimes times out

The timeout may need to be increased for slower internet connections:

```
2021-06-04 11:45:26.204 2125-9557/com.google.android.gnd E/ObservationRepository: Observation sync timed out
    java.util.concurrent.TimeoutException: The source did not signal an event for 5 seconds and has been terminated.
        at io.reactivex.internal.operators.single.SingleTimeout$TimeoutMainObserver.run(SingleTimeout.java:123)
        at io.reactivex.internal.schedulers.ScheduledDirectTask.call(ScheduledDirectTask.java:38)
        at io.reactivex.internal.schedulers.ScheduledDirectTask.call(ScheduledDirectTask.java:26)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:923)
```

Changed files:
gnd/src/main/java/com/google/android/gnd/repository/ObservationRepository.java, gnd/src/main/java/com/google/android/gnd/repository/ProjectRepository.java

diff --git a/gnd/src/main/java/com/google/android/gnd/repository/ObservationRepository.java b/gnd/src/main/java/com/google/android/gnd/repository/ObservationRepository.java
index 31253940a..3a438ffe9 100644
--- a/gnd/src/main/java/com/google/android/gnd/repository/ObservationRepository.java
+++ b/gnd/src/main/java/com/google/android/gnd/repository/ObservationRepository.java
@@ -45,7 +45,7 @@ import timber.log.Timber;
  */
 public class ObservationRepository {
 
-  private static final long LOAD_REMOTE_OBSERVATIONS_TIMEOUT_SECS = 5;
+  private static final long LOAD_REMOTE_OBSERVATIONS_TIMEOUT_SECS = 15;
 
   private final LocalDataStore localDataStore;
   private final RemoteDataStore remoteDataStore;
diff --git a/gnd/src/main/java/com/google/android/gnd/repository/ProjectRepository.java b/gnd/src/main/java/com/google/android/gnd/repository/ProjectRepository.java
index 727e6568f..0c0965555 100644
--- a/gnd/src/main/java/com/google/android/gnd/repository/ProjectRepository.java
+++ b/gnd/src/main/java/com/google/android/gnd/repository/ProjectRepository.java
@@ -53,7 +53,7 @@ import timber.log.Timber;
 @Singleton
 public class ProjectRepository {
 
-  private static final long LOAD_REMOTE_PROJECT_TIMEOUT_SECS = 5;
+  private static final long LOAD_REMOTE_PROJECT_TIMEOUT_SECS = 15;
   private static final long LOAD_REMOTE_PROJECT_SUMMARIES_TIMEOUT_SECS = 30;
 
   private final InMemoryCache cache;
Repository: apache/fluo
Issue: Oracle is advertising its IP address as 0.0.0.0 in Zookeeper

This is preventing remote oracle clients from connecting to the Oracle in a distributed environment.  This should be changed to the hostname of the machine where the oracle resides.


Changed files:
modules/core/src/main/java/accismus/impl/OracleServer.java

diff --git a/modules/core/src/main/java/accismus/impl/OracleServer.java b/modules/core/src/main/java/accismus/impl/OracleServer.java
index 0104cf4c..3b13c9e6 100644
--- a/modules/core/src/main/java/accismus/impl/OracleServer.java
+++ b/modules/core/src/main/java/accismus/impl/OracleServer.java
@@ -16,9 +16,11 @@
  */
 package accismus.impl;
 
-import accismus.impl.support.CuratorCnxnListener;
-import accismus.impl.thrift.OracleService;
-import com.google.common.annotations.VisibleForTesting;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.InetSocketAddress;
+
 import org.apache.curator.framework.CuratorFramework;
 import org.apache.curator.framework.CuratorFrameworkFactory;
 import org.apache.curator.framework.imps.CuratorFrameworkState;
@@ -36,7 +38,10 @@ import org.apache.zookeeper.data.Stat;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.net.InetSocketAddress;
+import accismus.impl.support.CuratorCnxnListener;
+import accismus.impl.thrift.OracleService;
+
+import com.google.common.annotations.VisibleForTesting;
 
 /**
  * Oracle server is the responsible for providing incrementing logical timestamps to clients. It should never
@@ -148,6 +153,12 @@ public class OracleServer extends LeaderSelectorListenerAdapter implements Oracl
     return addr;
 
   }
+  
+  private String getHostName() throws IOException {
+    Process p = Runtime.getRuntime().exec("hostname");
+    BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
+    return reader.readLine();
+  }
 
   public synchronized void start() throws Exception {
     if (started)
@@ -163,7 +174,9 @@ public class OracleServer extends LeaderSelectorListenerAdapter implements Oracl
       Thread.sleep(200);
 
     leaderSelector = new LeaderSelector(curatorFramework, config.getZookeeperRoot() + Constants.Zookeeper.ORACLE_SERVER, this);
-    leaderSelector.setId(addr.getHostName() + ":" + addr.getPort());
+    String leaderId = getHostName() + ":" + addr.getPort();
+    leaderSelector.setId(leaderId);
+    log.info("Leader ID = " + leaderId);
     leaderSelector.autoRequeue();
     leaderSelector.start();
Repository: apache/fluo
Issue: Exception thrown if fluo yarn commands run on empty Zookeeper

This exception is thrown every time the command `fluo-dev deploy` is run with fresh Zookeeper.

No root node '/' exists in ZK which causes exception.  Commands should check if root node exists before reading ZK.

```
Exception in thread "YarnTwillRunnerService STARTING" java.lang.RuntimeException: java.util.concurrent.ExecutionException: org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /
    at com.google.common.base.Throwables.propagate(Throwables.java:160)
    at com.google.common.util.concurrent.AbstractIdleService$1$1.run(AbstractIdleService.java:47)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.concurrent.ExecutionException: org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /
    at com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:294)
    at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:281)
    at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:116)
    at org.apache.twill.yarn.YarnTwillRunnerService.startUp(YarnTwillRunnerService.java:304)
    at com.google.common.util.concurrent.AbstractIdleService$1$1.run(AbstractIdleService.java:43)
    ... 1 more

```


Changed files:
modules/cluster/src/main/java/io/fluo/cluster/yarn/YarnAdmin.java

diff --git a/modules/cluster/src/main/java/io/fluo/cluster/yarn/YarnAdmin.java b/modules/cluster/src/main/java/io/fluo/cluster/yarn/YarnAdmin.java
index a15ee0fc..0e1d3f2c 100644
--- a/modules/cluster/src/main/java/io/fluo/cluster/yarn/YarnAdmin.java
+++ b/modules/cluster/src/main/java/io/fluo/cluster/yarn/YarnAdmin.java
@@ -28,6 +28,7 @@ import io.fluo.api.config.FluoConfiguration;
 import io.fluo.cluster.FluoOracleMain;
 import io.fluo.cluster.FluoWorkerMain;
 import io.fluo.cluster.util.LogbackUtil;
+import io.fluo.core.client.FluoAdminImpl;
 import io.fluo.core.util.CuratorUtil;
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.curator.framework.CuratorFramework;
@@ -258,6 +259,11 @@ public class YarnAdmin {
 
     File configFile = new File(options.getFluoConf() + "/fluo.properties");
     config = new FluoConfiguration(configFile);
+    
+    if (!FluoAdminImpl.zookeeperInitialized(config)) {
+      System.out.println("ERROR - Fluo has not been initialized yet in Zookeeper at " + config.getZookeepers());
+      System.exit(-1);
+    }
 
     try {
       curator = CuratorUtil.newFluoCurator(config);
Repository: apache/fluo
Issue: hash notification log message is misleading

The following message is misleading.  After its printed 118 notification were queued for processing, they may not be finished.  The word `processed` seems to imply they were finished.

```
19:45:18.389 [HashNotificationFinder ScanTask] DEBUG i.f.core.worker.finder.hash.ScanTask - Scanned 50 of 68 tablets, processed 118 notifications, sleeping 0
```


Changed files:
modules/core/src/main/java/io/fluo/core/worker/finder/hash/ScanTask.java

diff --git a/modules/core/src/main/java/io/fluo/core/worker/finder/hash/ScanTask.java b/modules/core/src/main/java/io/fluo/core/worker/finder/hash/ScanTask.java
index 4a49bbcf..85d96529 100644
--- a/modules/core/src/main/java/io/fluo/core/worker/finder/hash/ScanTask.java
+++ b/modules/core/src/main/java/io/fluo/core/worker/finder/hash/ScanTask.java
@@ -103,7 +103,7 @@ class ScanTask implements Runnable {
         
         long sleepTime = Math.max(0, minRetryTime - System.currentTimeMillis());
         
-        log.debug("Scanned {} of {} tablets, processed {} notifications, sleeping {} ", tabletsScanned, tablets.size(), notifications, sleepTime);
+        log.debug("Scanned {} of {} tablets, found {} new notifications, sleeping {} ", tabletsScanned, tablets.size(), notifications, sleepTime);
         
         UtilWaitThread.sleep(sleepTime, stopped);
Repository: apache/fluo
Issue: FluoInputFormat is configured for wrong Zookeeper connection property

In the `configure()` method of FluoInputFormat the `config.getZookeepers()` is used rather than `config.getAccumuloZookeepers()` to create connection to Accumulo.


Changed files:
modules/mapreduce/src/main/java/io/fluo/mapreduce/FluoInputFormat.java

diff --git a/modules/mapreduce/src/main/java/io/fluo/mapreduce/FluoInputFormat.java b/modules/mapreduce/src/main/java/io/fluo/mapreduce/FluoInputFormat.java
index b4f1ad74..be879fe2 100644
--- a/modules/mapreduce/src/main/java/io/fluo/mapreduce/FluoInputFormat.java
+++ b/modules/mapreduce/src/main/java/io/fluo/mapreduce/FluoInputFormat.java
@@ -151,7 +151,7 @@ public class FluoInputFormat extends InputFormat<Bytes,ColumnIterator> {
         props.store(baos, "");
         conf.getConfiguration().set(PROPS_CONF_KEY, new String(baos.toByteArray(), "UTF8"));
 
-        AccumuloInputFormat.setZooKeeperInstance(conf, config.getAccumuloInstance(), config.getZookeepers());
+        AccumuloInputFormat.setZooKeeperInstance(conf, config.getAccumuloInstance(), config.getAccumuloZookeepers());
         AccumuloInputFormat.setConnectorInfo(conf, config.getAccumuloUser(), new PasswordToken(config.getAccumuloPassword()));
         AccumuloInputFormat.setInputTableName(conf, env.getTable());
         AccumuloInputFormat.setScanAuthorizations(conf, env.getAuthorizations());
Repository: apache/fluo
Issue: Notification scanner slept max time when tablets changed

I noticed this while running the stress test.  The test started the Fluo app and then later added splits to the table.  Fluo eventually noticed these new splits and when it did scanned 0 tablets and then slept for 5 mins (which is the max time to sleep between tablet scans).   This case could be handled in a more responsive way.

```
14:02:52.596 [Fluo-0007-001-Fluo worker partition manager] DEBUG o.a.f.c.w.f.hash.ParitionManager - Updated finder partition info : workers:2  groups:1  groupSize:2  groupId:0  idInGroup:1  #tablets:10
14:02:52.635 [PartitionNotificationFinder ScanTask] DEBUG o.a.f.c.worker.finder.hash.ScanTask - Scanned 0 of 1 tablets. Notifications added: 0 seen: 0 queued: 0
14:07:52.786 [PartitionNotificationFinder ScanTask] DEBUG o.a.f.c.worker.finder.hash.ScanTask - Scanned 10 of 10 tablets. Notifications added: 331 seen: 331 queued: 38
```

Changed files:
modules/core/src/main/java/org/apache/fluo/core/worker/finder/hash/ScanTask.java

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 35f3215f..00726a8d 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
@@ -76,7 +76,6 @@ public class ScanTask implements Runnable {
   @Override
   public void run() {
 
-
     List<TableRange> ranges = new ArrayList<>();
     Set<TableRange> rangeSet = new HashSet<>();
 
@@ -135,7 +134,12 @@ public class ScanTask implements Runnable {
           // nothing to do
         }
 
-        long sleepTime = Math.max(minSleepTime, minRetryTime - System.currentTimeMillis());
+        long sleepTime;
+        if (!partition.equals(partitionManager.getPartitionInfo())) {
+          sleepTime = minSleepTime;
+        } else {
+          sleepTime = Math.max(minSleepTime, minRetryTime - System.currentTimeMillis());
+        }
 
         qSize = proccessor.size();