This is an automated email from the ASF dual-hosted git repository.

brandonwilliams pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/trunk by this push:
     new a497d43  Remove deprecated HintedHandOffManager
a497d43 is described below

commit a497d43e6ba7568defe0621e90c3451ec9204e1d
Author: Bereng <berenguerbl...@gmail.com>
AuthorDate: Tue Aug 25 11:45:51 2020 +0200

    Remove deprecated HintedHandOffManager
    
    Patch by Bereguer Blasi, reviewed by brandonwilliams for CASSANDRA-15939
---
 CHANGES.txt                                        |  1 +
 doc/source/operating/metrics.rst                   | 26 +-------
 .../apache/cassandra/db/HintedHandOffManager.java  | 76 ----------------------
 .../cassandra/db/HintedHandOffManagerMBean.java    | 50 --------------
 .../org/apache/cassandra/hints/HintsService.java   |  2 +-
 .../cassandra/metrics/HintedHandoffMetrics.java    |  2 +-
 .../org/apache/cassandra/service/StorageProxy.java |  2 -
 src/java/org/apache/cassandra/tools/NodeProbe.java | 25 +++----
 .../mock/nodetool/InternalNodeProbe.java           |  5 +-
 9 files changed, 16 insertions(+), 173 deletions(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index 415f699..a36c910 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 4.0-beta2
+ * Remove deprecated HintedHandOffManager (CASSANDRA-15939)
  * Prevent repair from overrunning compaction (CASSANDRA-15817)
  * fix cqlsh COPY functions in Python 3.8 on Mac (CASSANDRA-16053)
  * Strip comment blocks from cqlsh input before processing statements 
(CASSANDRA-15802)
diff --git a/doc/source/operating/metrics.rst b/doc/source/operating/metrics.rst
index 0053cbc..3c9cc7d 100644
--- a/doc/source/operating/metrics.rst
+++ b/doc/source/operating/metrics.rst
@@ -538,34 +538,10 @@ TotalHints                 Counter        Number of hint 
messages written to thi
 TotalHintsInProgress       Counter        Number of hints attemping to be sent 
currently.
 ========================== ============== ===========
 
-.. _handoff-metrics:
-
-HintedHandoff Metrics
-^^^^^^^^^^^^^^^^^^^^^
-
-Metrics specific to Hinted Handoff.  There are also some metrics related to 
hints tracked in ``Storage Metrics``
-
-These metrics include the peer endpoint **in the metric name**
-
-Reported name format:
-
-**Metric Name**
-    ``org.apache.cassandra.metrics.HintedHandOffManager.<MetricName>``
-
-**JMX MBean**
-    ``org.apache.cassandra.metrics:type=HintedHandOffManager 
name=<MetricName>``
-
-=========================== ============== ===========
-Name                        Type           Description
-=========================== ============== ===========
-Hints_created-<PeerIP>       Counter        Number of hints on disk for this 
peer.
-Hints_not_stored-<PeerIP>    Counter        Number of hints not stored for 
this peer, due to being down past the configured hint window.
-=========================== ============== ===========
-
 .. _hintsservice-metrics:
 
 HintsService Metrics
-^^^^^^^^^^^^^^^^^^^^^
+^^^^^^^^^^^^^^^^^^^^
 
 Metrics specific to the Hints delivery service.  There are also some metrics 
related to hints tracked in ``Storage Metrics``
 
diff --git a/src/java/org/apache/cassandra/db/HintedHandOffManager.java 
b/src/java/org/apache/cassandra/db/HintedHandOffManager.java
deleted file mode 100644
index e26f658..0000000
--- a/src/java/org/apache/cassandra/db/HintedHandOffManager.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding 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 the License.
- */
-package org.apache.cassandra.db;
-
-import java.util.List;
-
-import org.apache.cassandra.hints.HintsService;
-import org.apache.cassandra.utils.MBeanWrapper;
-
-/**
- * A proxy class that implement the deprecated legacy 
HintedHandoffManagerMBean interface.
- *
- * TODO: remove in 4.0.
- */
-@SuppressWarnings("deprecation")
-@Deprecated
-public final class HintedHandOffManager implements HintedHandOffManagerMBean
-{
-    public static final HintedHandOffManager instance = new 
HintedHandOffManager();
-
-    public static final String MBEAN_NAME = 
"org.apache.cassandra.db:type=HintedHandoffManager";
-
-    private HintedHandOffManager()
-    {
-    }
-
-    public void registerMBean()
-    {
-        MBeanWrapper.instance.registerMBean(this, MBEAN_NAME);
-    }
-
-    public void deleteHintsForEndpoint(String host)
-    {
-        HintsService.instance.deleteAllHintsForEndpoint(host);
-    }
-
-    public void truncateAllHints()
-    {
-        HintsService.instance.deleteAllHints();
-    }
-
-    // TODO
-    public List<String> listEndpointsPendingHints()
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    // TODO
-    public void scheduleHintDelivery(String host)
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    public void pauseHintsDelivery(boolean doPause)
-    {
-        if (doPause)
-            HintsService.instance.pauseDispatch();
-        else
-            HintsService.instance.resumeDispatch();
-    }
-}
diff --git a/src/java/org/apache/cassandra/db/HintedHandOffManagerMBean.java 
b/src/java/org/apache/cassandra/db/HintedHandOffManagerMBean.java
deleted file mode 100644
index 9ba425e..0000000
--- a/src/java/org/apache/cassandra/db/HintedHandOffManagerMBean.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding 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 the License.
- */
-package org.apache.cassandra.db;
-
-import java.net.UnknownHostException;
-import java.util.List;
-import java.util.concurrent.ExecutionException;
-
-@Deprecated
-public interface HintedHandOffManagerMBean
-{
-    /**
-     * Nuke all hints from this node to `ep`.
-     * @param host String rep. of endpoint address to delete hints for, either 
ip address ("127.0.0.1") or hostname
-     */
-    public void deleteHintsForEndpoint(final String host);
-
-    /**
-     *  Truncate all the hints
-     */
-    public void truncateAllHints() throws ExecutionException, 
InterruptedException;
-
-    /**
-     * List all the endpoints that this node has hints for.
-     * @return set of endpoints; as Strings
-     */
-    public List<String> listEndpointsPendingHints();
-
-    /** force hint delivery to an endpoint **/
-    public void scheduleHintDelivery(String host) throws UnknownHostException;
-
-    /** pause hints delivery process **/
-    public void pauseHintsDelivery(boolean b);
-}
-
diff --git a/src/java/org/apache/cassandra/hints/HintsService.java 
b/src/java/org/apache/cassandra/hints/HintsService.java
index 1fd2d1a..60de478 100644
--- a/src/java/org/apache/cassandra/hints/HintsService.java
+++ b/src/java/org/apache/cassandra/hints/HintsService.java
@@ -66,7 +66,7 @@ public final class HintsService implements HintsServiceMBean
 
     public static HintsService instance = new HintsService();
 
-    private static final String MBEAN_NAME = 
"org.apache.cassandra.hints:type=HintsService";
+    public static final String MBEAN_NAME = 
"org.apache.cassandra.hints:type=HintsService";
 
     private static final int MIN_BUFFER_SIZE = 32 << 20;
     static final ImmutableMap<String, Object> EMPTY_PARAMS = ImmutableMap.of();
diff --git a/src/java/org/apache/cassandra/metrics/HintedHandoffMetrics.java 
b/src/java/org/apache/cassandra/metrics/HintedHandoffMetrics.java
index 56888da..0261e8e 100644
--- a/src/java/org/apache/cassandra/metrics/HintedHandoffMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/HintedHandoffMetrics.java
@@ -40,7 +40,7 @@ public class HintedHandoffMetrics
 {
     private static final Logger logger = 
LoggerFactory.getLogger(HintedHandoffMetrics.class);
 
-    private static final MetricNameFactory factory = new 
DefaultNameFactory("HintedHandOffManager");
+    private static final MetricNameFactory factory = new 
DefaultNameFactory("HintsService");
 
     /** Total number of hints which are not stored, This is not a cache. */
     private final LoadingCache<InetAddressAndPort, DifferencingCounter> 
notStored = Caffeine.newBuilder()
diff --git a/src/java/org/apache/cassandra/service/StorageProxy.java 
b/src/java/org/apache/cassandra/service/StorageProxy.java
index a5a6e3c..4006e32 100644
--- a/src/java/org/apache/cassandra/service/StorageProxy.java
+++ b/src/java/org/apache/cassandra/service/StorageProxy.java
@@ -62,7 +62,6 @@ import org.apache.cassandra.db.ColumnFamilyStore;
 import org.apache.cassandra.db.ConsistencyLevel;
 import org.apache.cassandra.db.CounterMutation;
 import org.apache.cassandra.db.DecoratedKey;
-import org.apache.cassandra.db.HintedHandOffManager;
 import org.apache.cassandra.db.IMutation;
 import org.apache.cassandra.db.Keyspace;
 import org.apache.cassandra.db.Mutation;
@@ -211,7 +210,6 @@ public class StorageProxy implements StorageProxyMBean
     {
         MBeanWrapper.instance.registerMBean(instance, MBEAN_NAME);
         HintsService.instance.registerMBean();
-        HintedHandOffManager.instance.registerMBean();
 
         standardWritePerformer = (mutation, targets, responseHandler, 
localDataCenter) ->
         {
diff --git a/src/java/org/apache/cassandra/tools/NodeProbe.java 
b/src/java/org/apache/cassandra/tools/NodeProbe.java
index a7f4756..617da12 100644
--- a/src/java/org/apache/cassandra/tools/NodeProbe.java
+++ b/src/java/org/apache/cassandra/tools/NodeProbe.java
@@ -59,7 +59,6 @@ import org.apache.cassandra.batchlog.BatchlogManager;
 import org.apache.cassandra.batchlog.BatchlogManagerMBean;
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.db.ColumnFamilyStoreMBean;
-import org.apache.cassandra.db.HintedHandOffManagerMBean;
 import org.apache.cassandra.db.Keyspace;
 import org.apache.cassandra.db.compaction.CompactionManager;
 import org.apache.cassandra.db.compaction.CompactionManagerMBean;
@@ -67,7 +66,8 @@ import org.apache.cassandra.gms.FailureDetector;
 import org.apache.cassandra.gms.FailureDetectorMBean;
 import org.apache.cassandra.gms.Gossiper;
 import org.apache.cassandra.gms.GossiperMBean;
-import org.apache.cassandra.db.HintedHandOffManager;
+import org.apache.cassandra.hints.HintsService;
+import org.apache.cassandra.hints.HintsServiceMBean;
 import org.apache.cassandra.locator.DynamicEndpointSnitchMBean;
 import org.apache.cassandra.locator.EndpointSnitchInfoMBean;
 import org.apache.cassandra.metrics.CassandraMetricsRegistry;
@@ -130,7 +130,7 @@ public class NodeProbe implements AutoCloseable
     protected FailureDetectorMBean fdProxy;
     protected CacheServiceMBean cacheService;
     protected StorageProxyMBean spProxy;
-    protected HintedHandOffManagerMBean hhProxy;
+    protected HintsServiceMBean hsProxy;
     protected BatchlogManagerMBean bmProxy;
     protected ActiveRepairServiceMBean arsProxy;
     private boolean failed;
@@ -224,8 +224,8 @@ public class NodeProbe implements AutoCloseable
             cacheService = JMX.newMBeanProxy(mbeanServerConn, name, 
CacheServiceMBean.class);
             name = new ObjectName(StorageProxy.MBEAN_NAME);
             spProxy = JMX.newMBeanProxy(mbeanServerConn, name, 
StorageProxyMBean.class);
-            name = new ObjectName(HintedHandOffManager.MBEAN_NAME);
-            hhProxy = JMX.newMBeanProxy(mbeanServerConn, name, 
HintedHandOffManagerMBean.class);
+            name = new ObjectName(HintsService.MBEAN_NAME);
+            hsProxy = JMX.newMBeanProxy(mbeanServerConn, name, 
HintsServiceMBean.class);
             name = new ObjectName(GCInspector.MBEAN_NAME);
             gcProxy = JMX.newMBeanProxy(mbeanServerConn, name, 
GCInspectorMXBean.class);
             name = new ObjectName(Gossiper.MBEAN_NAME);
@@ -1010,29 +1010,22 @@ public class NodeProbe implements AutoCloseable
 
     public void pauseHintsDelivery()
     {
-        hhProxy.pauseHintsDelivery(true);
+        hsProxy.pauseDispatch();
     }
 
     public void resumeHintsDelivery()
     {
-        hhProxy.pauseHintsDelivery(false);
+        hsProxy.resumeDispatch();
     }
 
     public void truncateHints(final String host)
     {
-        hhProxy.deleteHintsForEndpoint(host);
+        hsProxy.deleteAllHintsForEndpoint(host);
     }
 
     public void truncateHints()
     {
-        try
-        {
-            hhProxy.truncateAllHints();
-        }
-        catch (ExecutionException | InterruptedException e)
-        {
-            throw new RuntimeException("Error while executing truncate hints", 
e);
-        }
+        hsProxy.deleteAllHints();
     }
 
     public void refreshSizeEstimates()
diff --git 
a/test/distributed/org/apache/cassandra/distributed/mock/nodetool/InternalNodeProbe.java
 
b/test/distributed/org/apache/cassandra/distributed/mock/nodetool/InternalNodeProbe.java
index 9ab264e..097206a 100644
--- 
a/test/distributed/org/apache/cassandra/distributed/mock/nodetool/InternalNodeProbe.java
+++ 
b/test/distributed/org/apache/cassandra/distributed/mock/nodetool/InternalNodeProbe.java
@@ -28,12 +28,12 @@ import com.google.common.collect.Multimap;
 import org.apache.cassandra.batchlog.BatchlogManager;
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.db.ColumnFamilyStoreMBean;
-import org.apache.cassandra.db.HintedHandOffManager;
 import org.apache.cassandra.db.Keyspace;
 import org.apache.cassandra.db.compaction.CompactionManager;
 import org.apache.cassandra.gms.FailureDetector;
 import org.apache.cassandra.gms.FailureDetectorMBean;
 import org.apache.cassandra.gms.Gossiper;
+import org.apache.cassandra.hints.HintsService;
 import org.apache.cassandra.locator.DynamicEndpointSnitchMBean;
 import org.apache.cassandra.locator.EndpointSnitchInfo;
 import org.apache.cassandra.locator.EndpointSnitchInfoMBean;
@@ -92,7 +92,8 @@ public class InternalNodeProbe extends NodeProbe
         fdProxy = (FailureDetectorMBean) FailureDetector.instance;
         cacheService = CacheService.instance;
         spProxy = StorageProxy.instance;
-        hhProxy = HintedHandOffManager.instance;
+        hsProxy = HintsService.instance;
+
         gcProxy = new GCInspector();
         gossProxy = Gossiper.instance;
         bmProxy = BatchlogManager.instance;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to