edu.ucsb.nceas.metacat.dataone.hazelcast

## Class ObjectPathMap

- java.lang.Object
- - edu.ucsb.nceas.metacat.dataone.hazelcast.ObjectPathMap

- All Implemented Interfaces:
    com.hazelcast.core.MapLoader<org.dataone.service.types.v1.Identifier,java.lang.String>

      public class ObjectPathMap
      extends java.lang.Object
      implements com.hazelcast.core.MapLoader<org.dataone.service.types.v1.Identifier,java.lang.String>

  MapLoader implementation for a hazelcast hzObjectPath. This class is called when the IMap get methods needs to refresh against the persistent data-store. The use case for this class is to communicate the filepath between JVMs on the same machine, specifically between the metacat instance and the d1_indexer. d1_indexer will get Identifiers from elsewhere, but use this class to get the paths to their associated files. The getAllKeys() method will return null in a live setting, to avoid possibly expensive preloading
  Author:
    rnahf

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ObjectPathMap()` creates an ObjectPathMap

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `load(org.dataone.service.types.v1.Identifier key)` Implementation of hazelcast MapLoader interface method.
    `java.util.Map<org.dataone.service.types.v1.Identifier,java.lang.String>` | `loadAll(java.util.Collection<org.dataone.service.types.v1.Identifier> identifiers)` Implementation of hazelcast MapLoader interface method.
    `java.util.Set<org.dataone.service.types.v1.Identifier>` | `loadAllKeys()` Return the full set of guids in the local metacat repository as dataone Identifiers.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ObjectPathMap

          public ObjectPathMap()

      creates an ObjectPathMap

  - ### Method Detail

    - #### load

          public java.lang.String load(org.dataone.service.types.v1.Identifier key)

      Implementation of hazelcast MapLoader interface method. For the provided Identifier (as key), returns the path to the document on the local filesystem. Returns null if it can't create the path.
      Specified by:
        `load` in interface `com.hazelcast.core.MapLoader<org.dataone.service.types.v1.Identifier,java.lang.String>`

    - #### loadAll

          public java.util.Map<org.dataone.service.types.v1.Identifier,java.lang.String> loadAll(java.util.Collection<org.dataone.service.types.v1.Identifier> identifiers)

      Implementation of hazelcast MapLoader interface method. This method loads mappings for all Identifiers in the parameters. Any Identifier not found is not included in the resulting map.
      Specified by:
        `loadAll` in interface `com.hazelcast.core.MapLoader<org.dataone.service.types.v1.Identifier,java.lang.String>`

    - #### loadAllKeys

          public java.util.Set<org.dataone.service.types.v1.Identifier> loadAllKeys()

      Return the full set of guids in the local metacat repository as dataone Identifiers. (Hazelcast allows avoiding pre-loading by returning NULL, so will do this to avoid pre-loading a very long list unnecessarily)
      Specified by:
        `loadAllKeys` in interface `com.hazelcast.core.MapLoader<org.dataone.service.types.v1.Identifier,java.lang.String>`

Copyright © 2020 Regents of the University of California. All Rights Reserved.