You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Eben Hewitt <eb...@gmail.com> on 2010/05/08 18:37:26 UTC

AntiEntropyService Singleton

Hi Everyone
Thanks for your all of your terrific work. I have a question about
org/apache/cassandra/service/AntiEntropyService.java. It's declared as a
Singleton with this line and comment:

 // singleton enforcement
    public static final AntiEntropyService instance = new
AntiEntropyService();

But the constructor is protected, not private:

 protected AntiEntropyService()
    {
        naturalRepairs = new ConcurrentHashMap<CFPair, Long>();
        trees = new HashMap<CFPair, ExpiringMap<InetAddress, TreePair>>();
    }

Is there a particular special reason for that, since it's not "enforced" as
stated? Or should it just be declared private?

Thanks!
Eben

-- 
"In science there are no 'depths'; there is surface everywhere."
--Rudolph Carnap

RE: AntiEntropyService Singleton

Posted by Stu Hood <st...@rackspace.com>.
You're right, it should be private. But... I don't think it is worth opening a ticket for.

-----Original Message-----
From: "Eben Hewitt" <eb...@gmail.com>
Sent: Saturday, May 8, 2010 11:37am
To: user@cassandra.apache.org
Subject: AntiEntropyService Singleton

Hi Everyone
Thanks for your all of your terrific work. I have a question about
org/apache/cassandra/service/AntiEntropyService.java. It's declared as a
Singleton with this line and comment:

 // singleton enforcement
    public static final AntiEntropyService instance = new
AntiEntropyService();

But the constructor is protected, not private:

 protected AntiEntropyService()
    {
        naturalRepairs = new ConcurrentHashMap<CFPair, Long>();
        trees = new HashMap<CFPair, ExpiringMap<InetAddress, TreePair>>();
    }

Is there a particular special reason for that, since it's not "enforced" as
stated? Or should it just be declared private?

Thanks!
Eben

-- 
"In science there are no 'depths'; there is surface everywhere."
--Rudolph Carnap