@@ -1760,6 +1760,12 @@ private static Op toZooKeeperOp(ZKWatcher zkw, ZKUtilOp op) throws UnsupportedOp
1760
1760
}
1761
1761
}
1762
1762
1763
+ // Static boolean for warning about useMulti because ideally there will be one warning per
1764
+ // process instance. It is fine if two threads end up racing on this for a bit. We do not
1765
+ // need to use an atomic type for this, that is overkill. The goal of reducing the number of
1766
+ // warnings from many to one or a few at startup is still achieved.
1767
+ private static boolean useMultiWarn = true ;
1768
+
1763
1769
/**
1764
1770
* Use ZooKeeper's multi-update functionality.
1765
1771
*
@@ -1780,14 +1786,16 @@ private static Op toZooKeeperOp(ZKWatcher zkw, ZKUtilOp op) throws UnsupportedOp
1780
1786
* @throws KeeperException if a ZooKeeper operation fails
1781
1787
*/
1782
1788
public static void multiOrSequential (ZKWatcher zkw , List <ZKUtilOp > ops ,
1783
- boolean runSequentialOnMultiFailure ) throws KeeperException {
1784
- if (zkw .getConfiguration ().get ("hbase.zookeeper.useMulti" ) != null ) {
1785
- LOG .warn ("hbase.zookeeper.useMulti is deprecated. Default to true always." );
1786
- }
1789
+ boolean runSequentialOnMultiFailure ) throws KeeperException {
1787
1790
if (ops == null ) {
1788
1791
return ;
1789
1792
}
1790
-
1793
+ if (useMultiWarn ) { // Only check and warn at first use
1794
+ if (zkw .getConfiguration ().get ("hbase.zookeeper.useMulti" ) != null ) {
1795
+ LOG .warn ("hbase.zookeeper.useMulti is deprecated. Default to true always." );
1796
+ }
1797
+ useMultiWarn = false ;
1798
+ }
1791
1799
List <Op > zkOps = new LinkedList <>();
1792
1800
for (ZKUtilOp op : ops ) {
1793
1801
zkOps .add (toZooKeeperOp (zkw , op ));
0 commit comments