public class HazelcastService extends BaseService implements com.hazelcast.core.EntryListener<org.dataone.service.types.v1.Identifier,org.dataone.service.types.v2.SystemMetadata>, com.hazelcast.core.MembershipListener, com.hazelcast.core.LifecycleListener, com.hazelcast.core.ItemListener<org.dataone.service.types.v1.Identifier>
_serviceName
Modifier and Type | Method and Description |
---|---|
protected void |
doRefresh()
Refresh the Hazelcast service by restarting it
|
void |
entryAdded(com.hazelcast.core.EntryEvent<org.dataone.service.types.v1.Identifier,org.dataone.service.types.v2.SystemMetadata> event)
Implement the EntryListener interface for Hazelcast, reponding to entry
added events in the hzSystemMetadata map.
|
void |
entryEvicted(com.hazelcast.core.EntryEvent<org.dataone.service.types.v1.Identifier,org.dataone.service.types.v2.SystemMetadata> event)
Implement the EntryListener interface for Hazelcast, reponding to entry
evicted events in the hzSystemMetadata map.
|
void |
entryRemoved(com.hazelcast.core.EntryEvent<org.dataone.service.types.v1.Identifier,org.dataone.service.types.v2.SystemMetadata> event)
Implement the EntryListener interface for Hazelcast, reponding to entry
removed events in the hzSystemMetadata map.
|
void |
entryUpdated(com.hazelcast.core.EntryEvent<org.dataone.service.types.v1.Identifier,org.dataone.service.types.v2.SystemMetadata> event)
Implement the EntryListener interface for Hazelcast, reponding to entry
updated events in the hzSystemMetadata map.
|
com.hazelcast.core.HazelcastInstance |
getHazelcastInstance() |
com.hazelcast.core.ISet<org.dataone.service.types.v1.Identifier> |
getIdentifiers()
Get the identifiers set
|
com.hazelcast.core.IMap<org.dataone.service.types.v1.Identifier,edu.ucsb.nceas.metacat.common.index.event.IndexEvent> |
getIndexEventMap()
Get the index event map
|
com.hazelcast.core.IMap<org.dataone.service.types.v1.Identifier,edu.ucsb.nceas.metacat.common.index.IndexTask> |
getIndexQueue()
Get the index queue
|
static HazelcastService |
getInstance()
Get the instance of the HazelcastService that has been instantiated,
or instantiate one if it has not been already.
|
java.util.concurrent.locks.Lock |
getLock(java.lang.String identifier) |
com.hazelcast.core.IMap<org.dataone.service.types.v1.Identifier,org.dataone.service.types.v2.SystemMetadata> |
getSystemMetadataMap()
Get the system metadata map
|
void |
init()
Initializes the Hazelcast service
|
void |
itemAdded(com.hazelcast.core.ItemEvent<org.dataone.service.types.v1.Identifier> event)
Respond to itemAdded events on the hzMissingIdentifiers Set.
|
void |
itemRemoved(com.hazelcast.core.ItemEvent<org.dataone.service.types.v1.Identifier> event)
Respond to itemRemoved events on the hzMissingIdentifiers Set
|
void |
memberAdded(com.hazelcast.core.MembershipEvent event)
When there is missing SystemMetadata on the local member,
we retrieve it from the shared map and add it to the local
backing store for safe keeping.
|
void |
memberRemoved(com.hazelcast.core.MembershipEvent event) |
boolean |
refreshable()
Indicate whether or not this service is refreshable.
|
void |
refreshSystemMetadataEntry(java.lang.String guid)
When Metacat changes the underlying store, we need to refresh the
in-memory representation of it.
|
void |
resynchInThread() |
void |
stateChanged(com.hazelcast.core.LifecycleEvent event)
In cases where this cluster is paused, we want to
check that the local store accurately reflects the shared
SystemMetadata map
|
void |
stop()
Stop the HazelcastService.
|
refresh
public static HazelcastService getInstance()
public void init() throws ServiceException
ServiceException
public com.hazelcast.core.IMap<org.dataone.service.types.v1.Identifier,org.dataone.service.types.v2.SystemMetadata> getSystemMetadataMap()
identifier
- - the identifier of the object as a stringpublic com.hazelcast.core.ISet<org.dataone.service.types.v1.Identifier> getIdentifiers()
public com.hazelcast.core.IMap<org.dataone.service.types.v1.Identifier,edu.ucsb.nceas.metacat.common.index.IndexTask> getIndexQueue()
public com.hazelcast.core.IMap<org.dataone.service.types.v1.Identifier,edu.ucsb.nceas.metacat.common.index.event.IndexEvent> getIndexEventMap()
public void refreshSystemMetadataEntry(java.lang.String guid)
guid
- public java.util.concurrent.locks.Lock getLock(java.lang.String identifier)
public boolean refreshable()
refreshable
in class BaseService
public void stop() throws ServiceException
stop
in class BaseService
ServiceException
public com.hazelcast.core.HazelcastInstance getHazelcastInstance()
protected void doRefresh() throws ServiceException
doRefresh
in class BaseService
ServiceException
public void entryAdded(com.hazelcast.core.EntryEvent<org.dataone.service.types.v1.Identifier,org.dataone.service.types.v2.SystemMetadata> event)
entryAdded
in interface com.hazelcast.core.EntryListener<org.dataone.service.types.v1.Identifier,org.dataone.service.types.v2.SystemMetadata>
event
- - The EntryEvent that occurredpublic void entryEvicted(com.hazelcast.core.EntryEvent<org.dataone.service.types.v1.Identifier,org.dataone.service.types.v2.SystemMetadata> event)
entryEvicted
in interface com.hazelcast.core.EntryListener<org.dataone.service.types.v1.Identifier,org.dataone.service.types.v2.SystemMetadata>
event
- - The EntryEvent that occurredpublic void entryRemoved(com.hazelcast.core.EntryEvent<org.dataone.service.types.v1.Identifier,org.dataone.service.types.v2.SystemMetadata> event)
entryRemoved
in interface com.hazelcast.core.EntryListener<org.dataone.service.types.v1.Identifier,org.dataone.service.types.v2.SystemMetadata>
event
- - The EntryEvent that occurredpublic void entryUpdated(com.hazelcast.core.EntryEvent<org.dataone.service.types.v1.Identifier,org.dataone.service.types.v2.SystemMetadata> event)
entryUpdated
in interface com.hazelcast.core.EntryListener<org.dataone.service.types.v1.Identifier,org.dataone.service.types.v2.SystemMetadata>
event
- - The EntryEvent that occurredpublic void resynchInThread()
public void memberAdded(com.hazelcast.core.MembershipEvent event)
memberAdded
in interface com.hazelcast.core.MembershipListener
public void memberRemoved(com.hazelcast.core.MembershipEvent event)
memberRemoved
in interface com.hazelcast.core.MembershipListener
public void stateChanged(com.hazelcast.core.LifecycleEvent event)
stateChanged
in interface com.hazelcast.core.LifecycleListener
event
- public void itemAdded(com.hazelcast.core.ItemEvent<org.dataone.service.types.v1.Identifier> event)
itemAdded
in interface com.hazelcast.core.ItemListener<org.dataone.service.types.v1.Identifier>
pid
- the identifier of the eventpublic void itemRemoved(com.hazelcast.core.ItemEvent<org.dataone.service.types.v1.Identifier> event)
itemRemoved
in interface com.hazelcast.core.ItemListener<org.dataone.service.types.v1.Identifier>
pid
- the identifier of the eventCopyright © 2020 Regents of the University of California. All Rights Reserved.