[GIRAPH-1095] Performance regression after GIRAPH-1068

Summary: Need to pass some missing parameters to zookeeper

Test Plan: run a few jobs

Reviewers: dionysis.logothetis, heslami, majakabiljo, maja.kabiljo

Reviewed By: maja.kabiljo

Differential Revision: https://reviews.facebook.net/D60831
diff --git a/giraph-core/src/main/java/org/apache/giraph/conf/GiraphConstants.java b/giraph-core/src/main/java/org/apache/giraph/conf/GiraphConstants.java
index ee67bed..b384261 100644
--- a/giraph-core/src/main/java/org/apache/giraph/conf/GiraphConstants.java
+++ b/giraph-core/src/main/java/org/apache/giraph/conf/GiraphConstants.java
@@ -1003,7 +1003,8 @@
   BooleanConfOption KEEP_ZOOKEEPER_DATA =
       new BooleanConfOption("giraph.keepZooKeeperData", false,
           "Keep the zookeeper output for debugging? Default is to remove it.");
-
+  /** Default ZooKeeper snap count. */
+  int DEFAULT_ZOOKEEPER_SNAP_COUNT = 50000;
   /** Default ZooKeeper tick time. */
   int DEFAULT_ZOOKEEPER_TICK_TIME = 6000;
   /** Default ZooKeeper maximum client connections. */
@@ -1021,6 +1022,15 @@
       new IntConfOption("giraph.zkMaxSessionTimeout", MINUTES.toMillis(15),
           "ZooKeeper maximum session timeout");
 
+  /** ZooKeeper force sync */
+  BooleanConfOption ZOOKEEPER_FORCE_SYNC =
+      new BooleanConfOption("giraph.zKForceSync", false,
+          "ZooKeeper force sync");
+
+  /** ZooKeeper skip ACLs */
+  BooleanConfOption ZOOKEEPER_SKIP_ACL =
+      new BooleanConfOption("giraph.ZkSkipAcl", true, "ZooKeeper skip ACLs");
+
   /**
    * Whether to use SASL with DIGEST and Hadoop Job Tokens to authenticate
    * and authorize Netty BSP Clients to Servers.
diff --git a/giraph-core/src/main/java/org/apache/giraph/zk/ZooKeeperManager.java b/giraph-core/src/main/java/org/apache/giraph/zk/ZooKeeperManager.java
index c54e7b2..097172d 100644
--- a/giraph-core/src/main/java/org/apache/giraph/zk/ZooKeeperManager.java
+++ b/giraph-core/src/main/java/org/apache/giraph/zk/ZooKeeperManager.java
@@ -437,12 +437,20 @@
       LOG.info("generateZooKeeperConfigFile: Make directory of " +
           zkDirFile.getName() + " = " + mkDirRet);
     }
+    /** Set zookeeper system properties */
+    System.setProperty("zookeeper.snapCount",
+        Integer.toString(GiraphConstants.DEFAULT_ZOOKEEPER_SNAP_COUNT));
+    System.setProperty("zookeeper.forceSync",
+        GiraphConstants.ZOOKEEPER_FORCE_SYNC.get(conf) ? "yes" : "no");
+    System.setProperty("zookeeper.skipACL",
+        GiraphConstants.ZOOKEEPER_SKIP_ACL.get(conf) ? "yes" : "no");
 
     config.setDataDir(zkDir);
     config.setDataLogDir(zkDir);
     config.setClientPortAddress(new InetSocketAddress(zkBasePort));
     config.setMinSessionTimeout(conf.getZooKeeperMinSessionTimeout());
     config.setMaxSessionTimeout(conf.getZooKeeperMaxSessionTimeout());
+
   }
 
   /**