Repository: incubator-gossip
Updated Branches:
  refs/heads/master 95e166770 -> 968571a56


GOSSIP-87 Unused workQueue in gossipCore


Project: http://git-wip-us.apache.org/repos/asf/incubator-gossip/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-gossip/commit/4572eed7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-gossip/tree/4572eed7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-gossip/diff/4572eed7

Branch: refs/heads/master
Commit: 4572eed73d9512bd3bfc26e1e80e3bcb8836582a
Parents: 95cce48
Author: pxsalehi <pxsal...@gmail.com>
Authored: Thu Aug 3 14:03:24 2017 +0200
Committer: pxsalehi <pxsal...@gmail.com>
Committed: Thu Aug 3 14:03:24 2017 +0200

----------------------------------------------------------------------
 .../java/org/apache/gossip/manager/GossipCore.java  | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-gossip/blob/4572eed7/gossip-base/src/main/java/org/apache/gossip/manager/GossipCore.java
----------------------------------------------------------------------
diff --git 
a/gossip-base/src/main/java/org/apache/gossip/manager/GossipCore.java 
b/gossip-base/src/main/java/org/apache/gossip/manager/GossipCore.java
index 4167664..e44302e 100644
--- a/gossip-base/src/main/java/org/apache/gossip/manager/GossipCore.java
+++ b/gossip-base/src/main/java/org/apache/gossip/manager/GossipCore.java
@@ -57,26 +57,24 @@ public class GossipCore implements GossipCoreConstants {
   private ConcurrentHashMap<String, LatchAndBase> requests;
   private final ConcurrentHashMap<String, ConcurrentHashMap<String, 
PerNodeDataMessage>> perNodeData;
   private final ConcurrentHashMap<String, SharedDataMessage> sharedData;
-  private final BlockingQueue<Runnable> workQueue;
   private final Meter messageSerdeException;
-  private final Meter tranmissionException;
-  private final Meter tranmissionSuccess;
+  private final Meter transmissionException;
+  private final Meter transmissionSuccess;
   private final DataEventManager eventManager;
   
   public GossipCore(GossipManager manager, MetricRegistry metrics){
     this.gossipManager = manager;
     requests = new ConcurrentHashMap<>();
-    workQueue = new ArrayBlockingQueue<>(1024);
     perNodeData = new ConcurrentHashMap<>();
     sharedData = new ConcurrentHashMap<>();
     eventManager = new DataEventManager(metrics);
-    metrics.register(WORKQUEUE_SIZE, (Gauge<Integer>)() -> workQueue.size());
+    metrics.register(WORKQUEUE_SIZE, (Gauge<Integer>)() -> 0);
     metrics.register(PER_NODE_DATA_SIZE, (Gauge<Integer>)() -> 
perNodeData.size());
     metrics.register(SHARED_DATA_SIZE, (Gauge<Integer>)() ->  
sharedData.size());
     metrics.register(REQUEST_SIZE, (Gauge<Integer>)() ->  requests.size());
     messageSerdeException = metrics.meter(MESSAGE_SERDE_EXCEPTION);
-    tranmissionException = metrics.meter(MESSAGE_TRANSMISSION_EXCEPTION);
-    tranmissionSuccess = metrics.meter(MESSAGE_TRANSMISSION_SUCCESS);
+    transmissionException = metrics.meter(MESSAGE_TRANSMISSION_EXCEPTION);
+    transmissionSuccess = metrics.meter(MESSAGE_TRANSMISSION_SUCCESS);
   }
 
   @SuppressWarnings({ "unchecked", "rawtypes" })
@@ -172,9 +170,9 @@ public class GossipCore implements GossipCoreConstants {
     }
     try {
       gossipManager.getTransportManager().send(uri, json_bytes);
-      tranmissionSuccess.mark();
+      transmissionSuccess.mark();
     } catch (IOException e) {
-      tranmissionException.mark();
+      transmissionException.mark();
       throw new RuntimeException(e);
     }
   }

Reply via email to