Change isNodeAuthorized() to query the hzSystemMetadata map rather than the hzPendingreplicationTasks map. The latter isn't needed for authorization since the ReplicationStatus for each Replica in SystemMetadata lists the status of the replica and can be queried.
Add getNodesMap() to return the hzNodes map from the process cluster. Remove getPendingReplicationTasks since that structure is being removed. Add minor documentation.
lookup latest system metadata update date for use in synchronizing CN-CN when an offline nodes comes back online
changed the key type from Identifier to String for ObjectPathMap. (need a Comparable key).
rework this to be MN->MN replication. Should be fleshed out more.
throw RuntimeExceptions when store() methods throw declared exceptions -- we want callers to put() to be alerted if there are errors.
move CNReplicationTask to the hazelcast package
do not throw exception when checking for system metadata - boolean return is good.use ReplicationStatus.valueOf() instead of convert()
implicit success for setting accessPolicy - trust that the MapStore persists the updated system metadata
check if system metadata exists rather than just the id mapping (before creating the entry)
treat access rules atomically - do not group them together otherwise the intent is subverted
only "save" to the shared system metadata map - not directly to the table store.
do not send <systemMetadata> with the <docInfo> replication information - this is handled by the Hazelcast shared map
rely on Hazelcast to store the SystemMetadata locally for the node. Entry event listeners store the shared system metadata on their local node when alerted. TODO: remove old replication code that included system metadata xml when replicating scimeta and data
move bulk of the Hazelcast code into HazelcastService from CNodeService so that it is centrall located - easier to manage and configure
verify that the sysmeta checksum value matches the computed checksum value when calling create()https://redmine.dataone.org/issues/1795
include sysmeta for uploaded BIN data that comes through the legacy Metacat servlet API
check for null pointers when adding system metadata/creating records during cn.create()
removing unneeded class (never used)
cleaned up mock tests on hzObjectPathMap. split out code for mocking a datastore into MockObjectPathMap.
initialize Hazelcast from the custom configuration when initializing the Metacat service.
handle entryAdded and entryUpdated the same - update the entry if it exists, otherwise create it
handle entryAdded (to hzSystemMetadata) to store sysmeta to local store when it is not already present
make isScienceMetadata() method public/static to be called throughout Metacat
only create ObjectFormatId when we actually have the parameter (downstream we rely on it being null or not when constructing the query)
add code to handle new entry when it is not on the local member of the sysmeta cluster
clean up imports - randome quicktime package had been included
comment out processCluster connections that use hzClient until that is finalized
use HashMap, HashSet instead of the Tree* classes that require Identifier objects implement Comparable
configuring hazelcast tests
do not add obsoletes and obsoletedBy elements if their values are null (jibx chokes on the emptiness)
use both guid and docid when creating access row - then either mechanism can be used when retrieving the access rules
check for null session before looking at subject
further refactoring and start of unit tests for hazelcast elements
use pending replication task queue to check if node is authorized for replication. moved from old ReplicationService code
save system metadata and/or science metadata and/or ORE objects to the local CN if needed.
small code cleanup - removed unused instantiations of DBUtils.
fixed logic wrt localID and docid. Implemented new method in IdentifierManager to getAllGUIDs from identifier table for implementation of loadAllKeys in ObjectPathMapLoader.
further development of ObjectPathMapLoader.
new class for refreshing the hazelcast map with metacat. Initial commit.
check session != null before checking authorization
Add stub methods in CNodeService that implement the Hazelcast EntryListener interface: entryAdded(), entryRemoved(), entryUpdated(), and entryEvicted(). Add a listener to the hzSystemMetadata map so the CNodeService can respond to those events and create appropriate CNReplicationTask objects for distributed execution across the CN cluster. Again, stubs only so far.
Minor cleanup - tabs to spaces.
Enable CNodeService to access 1) the hzNodes map defined in the DataONE process cluster by becoming a Hazelcast client (hzClient) to that cluster and 2) the hzSystemMetadata map defined in the DataONE storage cluster by becoming a member to that cluster (using direct Hazelcast calls). Added fields for maintaining the DataONE cluster properties.
Add in the Hazelcast Id generation namespace and an IdGenerator instance for task ids. Hazelcast will produce cluster-wide unique ids for the "task-ids" namespace, to be used when creating CNreplicationTask objects.
Add a CNReplicationTask class that will be submitted to the CN storage cluster when there are changes to the object store involving system metadata, science metadata, and resource maps. When a new entry is added to the hzSystemMetadata map, a new data, science metadata, or resource map was added to the VO, and all CN cluster members need to be updated with the object and it's system metadata. This task is executed on each CN to replicate the information. If the event is an update to an existing system metadata entry, it may only involve a change to system metadata, or may involve a change to science metadata as well. The task will return with the PID of the object replicated, be it a sysmeta, scimeta, or resource object. Locking of the PID will be handled by the task.
Catch D1nodeService up to the DataONE 0.6.4 schema where there is no ObjectFormat.isScienceMetadata() method, but rather ObjectFormat.getFormatType() where type is currently one of 'DATA, 'METADATA', or 'RESOURCE'.
Modify HazelcastService to read configuration information from an on-disk file (not from a jar file). Added init() to start up the service (was calling doRefresh() before. We still need to decide if this is a refreshable service.
move HazelcastService to D1 package
Adding a HazelcastService for Metacat to enable Metacat as a Hazelcast cluster member in DataONE. This will require the hazelcast.xml configuration file used for the DataONE cluster to be on the Metacat classpath.
changes for schema update (d1_common)
do not parse from last slash ("/") to the end when processing the request uri - otherwise things like format ids (text/csv) will be handled incorrectly.https://redmine.dataone.org/issues/1773
added HazelCast MapStore and MapLoader implementation for SystemMetadata
use InvalidRequest when the PID is not found. https://redmine.dataone.org/issues/1768
use Permission.REPLICATE not EXECUTE
check with the CN if replication is allowed for the object in question for getReplica()
add getReplica() implementation. same as get() but with different logging. seems silly, but maybe I missed something important that distinguishes this method.
Update MetacatPopulator to use the DataONE 0.6.4 schema and types.
Update classes to use the DataONE 0.6.4 schema and types. Major changes involve using BigInteger vs long in SystemMetadata.size, and using ObjectFormatIdentifier rather than Object format.
Insert system metadata after the data object is inserted.
Fix bug in updateSystemMetadataFields() where guid is set from the wrong parameter in the prepared SQL statement.
latest D1 jars - changes include:updateSystemMetadata() impl for CNnew identifier methods (generate is its own method)removal of the resourceMap pointer from system metadata
remove ORE mapping from system metadata
Update the d1 common java jar to include the changes to BaseException, and update MNodeService.synchronizationFailed() to use the BaseException.getNodeId() method to report which node the exception came from.
include obsoletes and obsoletedBy for system metadatarepurpose the "provenance" table as the ORE mapping table for system metadata
use correct enum method
refactor Constants
use NodelistUtil
remove ServiceTypeUtil - replace with TypeMarshaller
use new "v1" types from DataONE
remove CrudService -- replaced by MNodeService and CNodeService
handle more than "contains" searchmode when using the path index for querieshttp://bugzilla.ecoinformatics.org/show_bug.cgi?id=5443
-handle NotFound object format when generating system metadata-improve EML DML for null entity/attribute elements
use the ObjectFormat Id (not toString()) to check against the configured science metadata formats
Return the new pid (not the obsoleted pid) on update(), and set the correct system metadata.
In D1NodeService.getLogRecords(), don't pass in null start and count params - set them to the defaults (0 and 1000).
MNResourceHandler.getObject() was making a call to ObjectFormat.getFmtid() when an object format was null. Check that it is not null before trying getFmtid().
In MNodeService.getCapabilities(), update the properties to match those in metacat.properties. Flesh out the NodeHealth object, adding NodeState, Ping, and Status information. Flesh out the Synchronization object information, but for now, use mock values. TODO: This should be determined from configuration and on-the-fly information.
In MNodeService.getCapabilities(), set the synchronization and replication properties of the node.
In MNodeService.getCapabilities(), set the serviceAvailable for each service supported.
In MNodeService.getCapabilities(), set the serviceVersion for each service supported.
check reservation before create/update
Use D1 properties to set node values, and add the 'WAR VERSION' back into the node name for deployments.
add hasReservation() method (NotImplemented, however)
use objectFormatIdentifier for listObjects()remove provisional system metadata indicator - Metacat will not implement reserveIdentifier()
use correct log name for the class
consistently construct username/groups for MetacatHandler calls - also consistently call isAuthorized
provisional replicate() implementation -- does not check if the session's subject is "allowed" to do this.the test also requires 2 servers -- right now it attempts to replicate with itself which will fail because of duplicate IDs
provisional version of getOperationStatistics() -- not clear if we are meant to aggregate by hour or by day
provisional getCapabilities() implementation. Much of the synchronization information and node health is omitted.
simplify the get() method -- no need to use temp files for this operation
implement d1 paging for the log record results
Reverting the resultset order in querySystemMetadata(). Thanks Ben.
Because of the new 'provisional' column, the resultset field order in querySystemMetadata() was out of order. Changed the order to reflect the new table column order.
save systemmetadata when create() is called
allow very minimal system metadata for provisional entries (CN.reserveIdentifier)
Fix a NullPointerException issue when the SubjectList in a Session is null.
Add the missing URL delimiter when building the D1 base service URL.
allow the test to read the OFL docid