Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-11683

Code refactor for StorageServiceMBean.forceRepair* methods

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Won't Fix
    • 2.1.x
    • None
    • None
    • Low

    Description

      For the class StorageServiceMBean, it has below methods,

      org/apache/cassandra/service/StorageServiceMBean.java
      public int forceRepairAsync(String keyspace, boolean isSequential, Collection<String> dataCenters, Collection<String> hosts,  boolean primaryRange, boolean repairedAt, String... columnFamilies) throws IOException;
      
      public int forceRepairRangeAsync(String beginToken, String endToken, String keyspaceName, boolean isSequential, Collection<String> dataCenters, Collection<String> hosts, boolean repairedAt, String... columnFamilies) throws IOException;
      
      public int forceRepairRangeAsync(String beginToken, String endToken, String keyspaceName, boolean isSequential, boolean isLocal, boolean repairedAt, String... columnFamilies);
      

      But in the implementation, the arguments are different from this MBean, please notice the last second argument, from repairedAt to fullRepair, and actually fullRepair is more clear for this API.

      org/apache/cassandra/service/StorageService.java
      public int forceRepairAsync(String keyspace, boolean isSequential, Collection<String> dataCenters, Collection<String> hosts, boolean primaryRange, boolean fullRepair, String... columnFamilies) throws IOException{}
      
      public int forceRepairRangeAsync(String beginToken, String endToken, String keyspaceName, boolean isSequential, Collection<String> dataCenters, Collection<String> hosts, boolean fullRepair, String... columnFamilies) throws IOException{}
      
      public int forceRepairRangeAsync(String beginToken, String endToken, String keyspaceName, boolean isSequential, Collection<String> dataCenters, Collection<String> hosts, boolean fullRepair, String... columnFamilies) throws IOException{}
      

      This will make developers confused, for example I met an issue that we didn't want to do a "full" repair but from the MBean I didn't know how to pass the argument.

      I will send out a patch soon, and please help to merge it if we want to fix this issue.

      Attachments

        Activity

          People

            Unassigned Unassigned
            peoplehlj Lijun Huang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: