[ 
http://jira.amdatu.org/jira/browse/AMDATUCASSANDRA-179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12950#comment-12950
 ] 

Ivo Ladage - van Doorn commented on AMDATUCASSANDRA-179:
--------------------------------------------------------

The InspectKeyspaceColumnFamilyThread inspects the Cassandra scheme each X 
seconds. As soon as it detected any change in the scheme with the last time it 
checked it, it loops over all keyspaces and registers a new CPM for this 
keyspace if is not yet available. This check is implemented as follows:

String filter = "(" + CassandraPersistenceManager.KEYSPACE_AWARE_KEY + "=" + 
keyspace + ")";
ServiceReference[] servRefs =
m_context.getAllServiceReferences(CassandraPersistenceManager.class.getName(), 
filter);
if (servRefs == null || servRefs.length == 0) {
  // No Cassandra persistence manager available for this keyspace, register it 
now
  m_pmFactory.createCassandraPersistenceManager(keyspace);
}

The CassandraPersistenceManager is however started asynchronously. So it is 
possible (and this is what happens) that the inspector thread triggers the 
above code snippet again before the previously registered service is started.
                
> HectorCassandraPersistenceManagerImpl service instantiated twice for each 
> tenant
> --------------------------------------------------------------------------------
>
>                 Key: AMDATUCASSANDRA-179
>                 URL: http://jira.amdatu.org/jira/browse/AMDATUCASSANDRA-179
>             Project: Amdatu Cassandra
>          Issue Type: Bug
>          Components: Cassandra client - Persistence Manager
>    Affects Versions: 0.2.2
>            Reporter: Ivo Ladage - van Doorn
>            Assignee: Ivo Ladage - van Doorn
>             Fix For: 0.2.3
>
>
> When adding a tenant, two new instances of the 
> HectorCassandraPersistenceManagerImpl service are created. After a little 
> investigation it seems to be caused by the fact that 
> InspectKeyspaceColumnFamilyThread invokes the onKeyspaceAdded twice.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
http://jira.amdatu.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
Amdatu-developers mailing list
[email protected]
http://lists.amdatu.org/mailman/listinfo/amdatu-developers

Reply via email to