|
Initial Cache LoadWhen the space is started, restarted or cleaned, the system can initially fill the space with entries that are likely to be required by the application. You can specify the data to be used by the LifeCycleManager and the SpaceFilter. The CacheLoader.loadAll or, if implemented, the CacheFactory.iterator methods are called when the space is started. The CacheQuery argument encapsulates an IGSEntry that has as part of its class name java.lang.object. This interface can be used to load the space with data to speed up later operations. The space is not available for clients until the data load process has been completed.
Count OperationThe scope of IJSpace.count() and IMap.Size() is the data stored within the space. These methods do not take into account the data stored within the underlying data source. Recursive CallsThe CacheLoader/Store should avoid calling the space to avoid deadlock and internal thread pool exhaustion. UID GenerationThe space embeds a unique identifier to each Entry (UID). This UID is used implicitly when performing update operations, and read/take operations based on UID. The following describes the various options to determine the UID or the Object Class field to be used as the basis for the Entry UID. You should ensure that the field to be used as the basis for the UID holds a unique value per object. When trying to write into the space or loading an object that has an UID that already exists within the space the operation is rejected with the exception: com.j_spaces.core.client.EntryAlreadyInSpaceException. UID Generation for POJO and Entry ObjectsYou can use configuration files, annotations or API to determine the Entry's UID.
The above search order means that configuration files override Annotations, and Annotations override API. UID for POJO ObjectsWhen using JavaSpace API with POJO objects, the following options determine the field to be used as the basis for the UID.
UID for Entry ObjectsWhen using JavaSpace API with Entry objects, the rules are same as for POJO objects with the additional option to define the field name to be used as the basis for the UID generation: the first indexed field – i.e. the first element, of the array returned from the public static String[] __getSpaceIndexedFields() __ method. The ClientUIDHandler can be used with classes extends MetaDataEntry or implement IMetaDataEntry to explicitly determine the Entry UID. When no field is defined to be the basis for the Entry UID, the UID is generated by the space using sequencer mechanism, which could lead to inconsistent behavior.
|
Wiki Content Tree
Your Feedback Needed!
We need your help to improve this wiki site. If you have any suggestions or corrections, write to us at techw@gigaspaces.com. Please provide a link to the wiki page you are referring to.
Add Comment