Class Annotations
The GigaSpaces API supports class level decorations with POJOs. These can be specified via annotations on the space class source itself for all class instances.
GigaSpaces provides the ability to obtain and modify class metadata of objects stored in the Space Where GigaSpaces data is stored. It is the logical cache that holds data objects in memory and might also hold them in layered in tiering. Data is hosted from multiple SoRs, consolidated as a unified data model. during runtime.
Persistence
Syntax | persist |
Argument | boolean |
Default | false |
Description | When a space is defined as persistent, a "true' value for this annotation persists objects of this type. |
Example:
@SpaceClass(persist=true)
public class Person {
//
}
Include Properties
Syntax | includeProperties |
Argument | IncludeProperties |
Default | IncludeProperties.IMPLICIT |
Description | IncludeProperties.IMPLICIT takes into account all POJO Plain Old Java Object.
A regular Java object with no special restrictions other than those forced by the Java Language Specification and does not require any classpath. fields – even if a get method is not declared with a @SpaceProperty annotation, it is taken into account as a space field.IncludeProperties.EXPLICIT takes into account only the get methods which are declared with a @SpaceProperty annotation. |
Example:
@SpaceClass(includeProperties=IncludeProperties.EXPLICIT)
public class Person {
//
}
FIFO Support
Syntax | fifoSupport |
Argument | FifoSupport |
Default | FifoSupport.NOT_SET |
Description | To enable FIFO FIFO is an acronym for first in, first out, a method for organizing the manipulation of a data structure where the oldest entry, or "head" of the queue, is processed first. operations, set this attribute to FifoSupport.OPERATION |
Example:
@SpaceClass(fifoSupport=FifoSupport.OPERATION)
public class Person {
//
}
Inherit Index
Syntax | inheritIndexes |
Argument | boolean |
Default | true |
Description | Whether to use the class indexes list only, or to also include the superclass' indexes. If the class does not define indexes, superclass indexes are used. Options: - false – class indexes only.- true – class indexes and superclass indexes. |
Example:
@SpaceClass(inheritIndexes=false)
public class Person {
//
}
Storage Type
Syntax | storageType |
Argument | StorageType |
Default | StorageType.OBJECT |
Description | To determine a default storage type for each non primitive property for which a (field level) storage type was not defined. |
Example:
@SpaceClass(storageType=StorageType.BINARY)
public class Person {
//
}
Replication
Syntax | replicate |
Argument | boolean |
Default | true |
Description | When running in a partial replication mode, a false value for this property will not replicates all objects from this class type to the replica space or backup space.} |
Example:
@SpaceClass(replicate=false)
public class Person {
//
}
Compound Index
Syntax | CompoundSpaceIndexes CompoundSpaceIndex paths |
Argument(s) | string |
Values | attribute name(s) |
Description | Indexes can be defined for multiple attributes of a class |
Example:
@CompoundSpaceIndexes({ @CompoundSpaceIndex(paths = { "firstName", "lastName" }) })
@SpaceClass
public class User {
private Long id;
private String firstName;
private String lastName;
private Double balance;
private Double creditLimit;
private EAccountStatus status;
private Address address;
private String[] comment;
}
Blobstore
Syntax | blobstoreEnabled |
Argument | boolean |
Default | true |
Description | By default any Space Data Type is blobStore enabled. When decorating the space class with its meta data you may turn off the blobStore behavior using the @SpaceClass blobStore annotation or gs.xml blobStore tag. |
Example:
@SpaceClass(blobstoreEnabled = false)
public class Person {
.......
}
Memoryxtend
Change Code without Restarts
Syntax | SupportCodeChange id= |
Argument | string |
Default | "" |
Description | Changing execution code without restarting the data grid |
Example:
@SupportCodeChange(id="1")
public class DynamicTask implements Task<Integer> {
@Override
public Integer execute() throws Exception {
return new Integer(1);
}
}