fluo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] keith-turner closed pull request #1048: Fixed some compiler warnings
Date Fri, 07 Sep 2018 20:58:02 GMT
keith-turner closed pull request #1048: Fixed some compiler warnings
URL: https://github.com/apache/fluo/pull/1048
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/modules/core/src/main/java/org/apache/fluo/core/impl/SharedBatchWriter.java b/modules/core/src/main/java/org/apache/fluo/core/impl/SharedBatchWriter.java
index 012f2d3c..1f2d6bf7 100644
--- a/modules/core/src/main/java/org/apache/fluo/core/impl/SharedBatchWriter.java
+++ b/modules/core/src/main/java/org/apache/fluo/core/impl/SharedBatchWriter.java
@@ -4,9 +4,9 @@
  * 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
@@ -15,7 +15,6 @@
 
 package org.apache.fluo.core.impl;
 
-import java.lang.Thread.UncaughtExceptionHandler;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
diff --git a/modules/core/src/main/java/org/apache/fluo/core/impl/TimestampTracker.java b/modules/core/src/main/java/org/apache/fluo/core/impl/TimestampTracker.java
index 7354d4e4..7f5b78eb 100644
--- a/modules/core/src/main/java/org/apache/fluo/core/impl/TimestampTracker.java
+++ b/modules/core/src/main/java/org/apache/fluo/core/impl/TimestampTracker.java
@@ -4,9 +4,9 @@
  * 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
@@ -25,12 +25,12 @@
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Preconditions;
-import org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode;
-import org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode.Mode;
+import org.apache.curator.framework.recipes.nodes.PersistentNode;
 import org.apache.fluo.accumulo.util.LongUtil;
 import org.apache.fluo.accumulo.util.ZookeeperPath;
 import org.apache.fluo.core.oracle.Stamp;
 import org.apache.fluo.core.util.CuratorUtil;
+import org.apache.zookeeper.CreateMode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -44,7 +44,7 @@
   private volatile long zkTimestamp = -1;
   private final Environment env;
   private final SortedSet<Long> timestamps = new TreeSet<>();
-  private volatile PersistentEphemeralNode node = null;
+  private volatile PersistentNode node = null;
   private final TransactorID tid;
   private final Timer timer;
 
@@ -176,7 +176,7 @@ private Stamp getTimestamp() {
 
   private void createZkNode(long ts) {
     Preconditions.checkState(node == null, "expected node to be null");
-    node = new PersistentEphemeralNode(env.getSharedResources().getCurator(), Mode.EPHEMERAL,
+    node = new PersistentNode(env.getSharedResources().getCurator(), CreateMode.EPHEMERAL,
false,
         getNodePath(), LongUtil.toByteArray(ts));
     CuratorUtil.startAndWait(node, 10);
     zkTimestamp = ts;
diff --git a/modules/core/src/main/java/org/apache/fluo/core/impl/TransactorCache.java b/modules/core/src/main/java/org/apache/fluo/core/impl/TransactorCache.java
index 17105a92..878b2f05 100644
--- a/modules/core/src/main/java/org/apache/fluo/core/impl/TransactorCache.java
+++ b/modules/core/src/main/java/org/apache/fluo/core/impl/TransactorCache.java
@@ -4,9 +4,9 @@
  * 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
@@ -16,7 +16,6 @@
 package org.apache.fluo.core.impl;
 
 import java.io.IOException;
-import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicLong;
diff --git a/modules/core/src/main/java/org/apache/fluo/core/impl/TransactorNode.java b/modules/core/src/main/java/org/apache/fluo/core/impl/TransactorNode.java
index f04288de..0838e334 100644
--- a/modules/core/src/main/java/org/apache/fluo/core/impl/TransactorNode.java
+++ b/modules/core/src/main/java/org/apache/fluo/core/impl/TransactorNode.java
@@ -4,9 +4,9 @@
  * 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
@@ -18,11 +18,11 @@
 import java.io.IOException;
 
 import com.google.common.annotations.VisibleForTesting;
-import org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode;
-import org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode.Mode;
+import org.apache.curator.framework.recipes.nodes.PersistentNode;
 import org.apache.fluo.accumulo.util.LongUtil;
 import org.apache.fluo.accumulo.util.ZookeeperPath;
 import org.apache.fluo.core.util.CuratorUtil;
+import org.apache.zookeeper.CreateMode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -38,20 +38,20 @@
 
   private static final Logger log = LoggerFactory.getLogger(TransactorNode.class);
   private Environment env;
-  private PersistentEphemeralNode node;
+  private PersistentNode node;
   private TransactorID tid;
   private TrStatus status;
 
   /**
    * Creates a transactor node using given transactor id
-   * 
+   *
    * @param env Environment
    * @param tid Transactor ID used to create node
    */
   public TransactorNode(Environment env, TransactorID tid) {
     this.env = env;
     this.tid = tid;
-    node = new PersistentEphemeralNode(env.getSharedResources().getCurator(), Mode.EPHEMERAL,
+    node = new PersistentNode(env.getSharedResources().getCurator(), CreateMode.EPHEMERAL,
false,
         getNodePath(), tid.toString().getBytes());
     CuratorUtil.startAndWait(node, 10);
     status = TrStatus.OPEN;
@@ -59,7 +59,7 @@ public TransactorNode(Environment env, TransactorID tid) {
 
   /**
    * Creates a transactor node using new transactor ID
-   * 
+   *
    * @param env Environment
    */
   public TransactorNode(Environment env) {
diff --git a/modules/core/src/main/java/org/apache/fluo/core/impl/VisibilityCache.java b/modules/core/src/main/java/org/apache/fluo/core/impl/VisibilityCache.java
index 8cbcde34..f93f7314 100644
--- a/modules/core/src/main/java/org/apache/fluo/core/impl/VisibilityCache.java
+++ b/modules/core/src/main/java/org/apache/fluo/core/impl/VisibilityCache.java
@@ -4,9 +4,9 @@
  * 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
@@ -16,7 +16,6 @@
 package org.apache.fluo.core.impl;
 
 import java.util.Set;
-import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 
diff --git a/modules/core/src/main/java/org/apache/fluo/core/impl/scanner/ScannerBuilderImpl.java
b/modules/core/src/main/java/org/apache/fluo/core/impl/scanner/ScannerBuilderImpl.java
index b6f4c6f5..420fb738 100644
--- a/modules/core/src/main/java/org/apache/fluo/core/impl/scanner/ScannerBuilderImpl.java
+++ b/modules/core/src/main/java/org/apache/fluo/core/impl/scanner/ScannerBuilderImpl.java
@@ -4,9 +4,9 @@
  * 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
@@ -22,7 +22,6 @@
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableSet;
 import org.apache.fluo.api.client.scanner.CellScanner;
-import org.apache.fluo.api.client.scanner.RowScanner;
 import org.apache.fluo.api.client.scanner.RowScannerBuilder;
 import org.apache.fluo.api.client.scanner.ScannerBuilder;
 import org.apache.fluo.api.data.Column;
diff --git a/modules/core/src/main/java/org/apache/fluo/core/log/TracingScannerBuilder.java
b/modules/core/src/main/java/org/apache/fluo/core/log/TracingScannerBuilder.java
index e0a9d8ae..ad1cc0c9 100644
--- a/modules/core/src/main/java/org/apache/fluo/core/log/TracingScannerBuilder.java
+++ b/modules/core/src/main/java/org/apache/fluo/core/log/TracingScannerBuilder.java
@@ -4,9 +4,9 @@
  * 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
@@ -21,7 +21,6 @@
 
 import com.google.common.collect.ImmutableSet;
 import org.apache.fluo.api.client.scanner.CellScanner;
-import org.apache.fluo.api.client.scanner.RowScanner;
 import org.apache.fluo.api.client.scanner.RowScannerBuilder;
 import org.apache.fluo.api.client.scanner.ScannerBuilder;
 import org.apache.fluo.api.config.FluoConfiguration;
diff --git a/modules/core/src/main/java/org/apache/fluo/core/util/CuratorUtil.java b/modules/core/src/main/java/org/apache/fluo/core/util/CuratorUtil.java
index ffaad60f..07db1b86 100644
--- a/modules/core/src/main/java/org/apache/fluo/core/util/CuratorUtil.java
+++ b/modules/core/src/main/java/org/apache/fluo/core/util/CuratorUtil.java
@@ -25,8 +25,7 @@
 import org.apache.curator.framework.api.ACLProvider;
 import org.apache.curator.framework.recipes.cache.ChildData;
 import org.apache.curator.framework.recipes.cache.NodeCache;
-import org.apache.curator.framework.recipes.cache.NodeCacheListener;
-import org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode;
+import org.apache.curator.framework.recipes.nodes.PersistentNode;
 import org.apache.curator.retry.ExponentialBackoffRetry;
 import org.apache.fluo.accumulo.util.ZookeeperPath;
 import org.apache.fluo.accumulo.util.ZookeeperUtil;
@@ -161,7 +160,7 @@ public static boolean putData(CuratorFramework curator, String zPath,
byte[] dat
    * @param node Node to start
    * @param maxWaitSec Maximum time in seconds to wait
    */
-  public static void startAndWait(PersistentEphemeralNode node, int maxWaitSec) {
+  public static void startAndWait(PersistentNode node, int maxWaitSec) {
     node.start();
     int waitTime = 0;
     try {
diff --git a/modules/core/src/main/java/org/apache/fluo/core/worker/finder/hash/PartitionManager.java
b/modules/core/src/main/java/org/apache/fluo/core/worker/finder/hash/PartitionManager.java
index 89647f68..e106d085 100644
--- a/modules/core/src/main/java/org/apache/fluo/core/worker/finder/hash/PartitionManager.java
+++ b/modules/core/src/main/java/org/apache/fluo/core/worker/finder/hash/PartitionManager.java
@@ -4,9 +4,9 @@
  * 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
@@ -38,8 +38,7 @@
 import org.apache.curator.framework.recipes.cache.PathChildrenCache.StartMode;
 import org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent;
 import org.apache.curator.framework.recipes.cache.PathChildrenCacheListener;
-import org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode;
-import org.apache.curator.framework.recipes.nodes.PersistentEphemeralNode.Mode;
+import org.apache.curator.framework.recipes.nodes.PersistentNode;
 import org.apache.curator.utils.ZKPaths;
 import org.apache.fluo.accumulo.iterators.NotificationHashFilter;
 import org.apache.fluo.accumulo.util.NotificationUtil;
@@ -50,6 +49,7 @@
 import org.apache.fluo.core.impl.Notification;
 import org.apache.fluo.core.util.ByteUtil;
 import org.apache.fluo.core.util.FluoThreadFactory;
+import org.apache.zookeeper.CreateMode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -74,7 +74,7 @@
   public static final String ZK_FINDER_PREFIX = "f-";
 
   private final PathChildrenCache childrenCache;
-  private final PersistentEphemeralNode myESNode;
+  private final PersistentNode myESNode;
   private final int groupSize;
   private long paritionSetTime;
   private PartitionInfo partitionInfo;
@@ -279,7 +279,7 @@ public void run() {
       groupSize = env.getConfiguration().getInt(FluoConfigurationImpl.WORKER_PARTITION_GROUP_SIZE,
           FluoConfigurationImpl.WORKER_PARTITION_GROUP_SIZE_DEFAULT);
 
-      myESNode = new PersistentEphemeralNode(curator, Mode.EPHEMERAL_SEQUENTIAL,
+      myESNode = new PersistentNode(curator, CreateMode.EPHEMERAL_SEQUENTIAL, false,
           ZookeeperPath.FINDERS + "/" + ZK_FINDER_PREFIX, ("" + groupSize).getBytes(UTF_8));
       myESNode.start();
       myESNode.waitForInitialCreate(1, TimeUnit.MINUTES);


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message