Hitachi

In-Memory Data Grid Hitachi Elastic Application Data Store


18.2.8 Store interface

Organization of this subsection

(1) Description

This interface manipulates data during execution of a user function.

(2) Interface name

com.hitachi.software.xeads.func.store.Store

(3) List of methods

The following table lists and describes the methods provided by the Store interface:

Method name

Description

createKey()

Creates an instance indicating a key that can be manipulated in the cache.

createValue()

Serializes a specified value and creates a value instance that can be manipulated in the cache.

createGroup()

Creates an instance indicating a group that can be manipulated in the cache.

[Deprecated] getGroup()

[Deprecated] Acquires an instance needed to manipulate a group specified on the EADS client when the user function is executed.

[Deprecated] getGroup() (group name specification)

[Deprecated] Acquires an instance needed to manipulate a specified group.

containsKey() (Key interface specification)

Acquires a value indicating whether the value associated with a specified key is stored in the cache.

[Deprecated] containsKey() (character string specification)

[Deprecated] Acquires a value indicating whether the value associated with a specified key is stored in the cache.

put()

Stores a value by associating it with a key.

create()

Stores a value by associating it with a key only when a new key is stored.

update()

Updates a stored value to a specified value.

replace()

Compares the value associated with a specified key to the value (comparativeValue) specified as a condition, and updates the value if the values match.

get()

Acquires the value associated with a specified key.

remove()

Deletes a specified key and the value associated with that key.

getLastUpdateTime()

Acquires the last time the value associated with a specified key was updated.

getKeyCount()

Acquires the total number of keys stored in the cache.

getGroupCount()

Acquires the number of groups in the highest hierarchy of all groups to which the keys stored in the cache belong.

getGroupNames()

Acquires a list of group names in the highest hierarchy of all groups to which the keys stored in the cache belong.

The group names are listed in ascending order based on their ASCII code values.

[Deprecated] getGroupNameSet()

[Deprecated] Acquires a list of group names in the highest hierarchy in the cache in ascending order based on their ASCII code values.

getEHeapUsageSize() (Key interface specification)

Acquires the size (in bytes) of the explicit heap being used to store values.

getEHeapUsageSize() (Group interface specification)

Acquires the size (in bytes) of the explicit heap being used to store values for the keys that belong to a specified group.

getDiskUsageSize() (Key interface specification)

Acquires the amount (in bytes) of disk space being used to store values.

getDiskUsageSize() (Group interface specification)

Acquires the amount (in bytes) of disk space being used to store values for keys that belong to a specified group.

calcEHeapUsageSize()

Calculates the size (in bytes) of the explicit heap used if a specified value is stored.

calcDiskUsageSize()

Calculates the amount (in bytes) of disk space used if a value is stored.

(4) createKey()

(a) Description

This method creates an instance indicating a key that can be manipulated in the cache.

(b) Format

public Key createKey(String key)
              throws EADsStoreException

(c) Parameters

key

Specifies the key that is indicated in the created instance.

For details about the data that can be specified, see 15.2.2(1) Data types that can be specified as keys.

If the specified key is not subject to processing by the Store interface, an error results.

(d) Return value

The method returns a Key instance.

(e) Exceptions

  • UserOperationException (illegal user operation)

  • InternalServerException (EADS server internal error)

  • EADsStoreException (unexpected error)

(5) createValue()

(a) Description

This method serializes a specified value and creates a value instance that can be manipulated in the cache.

(b) Format

public Value createValue(Object value)
                  throws EADsStoreException

(c) Parameters

value

Specifies the value that is indicated in the created instance.

For details about the data that can be specified, see 15.2.2(3) Data types that can be specified as values.

This parameter is invalid in the following cases:

  • null is specified.

  • The specified object cannot be serialized.

(d) Return value

The method returns an instance in which the Value interface is implemented.

(e) Exceptions

  • UserOperationException (illegal user operation)

  • EADsStoreException (unexpected error)

(6) createGroup()

(a) Description

This method creates an instance indicating a group that can be manipulated in the cache.

(b) Format

public Group createGroup(String groupName)
                  throws EADsStoreException

(c) Parameters

groupName

Specifies the group name of the group that is indicated in the created instance.

For details about the data that can be specified, see 15.2.2(2) Data that can be specified as group names.

Note that if the specified group name is not subject to processing by the Store interface, an error results.

(d) Return value

This method returns the instance needed for accessing the specified group.

(e) Exceptions

  • UserOperationException (illegal user operation)

  • InternalServerException (EADS server internal error)

  • EADsStoreException (unexpected error)

(7) [Deprecated] getGroup()

Reference note

This method is deprecated. Instead, use the getKeyOrGroupName() of the ClientInfo interface and createGroup() of the Store interface.

(a) Description

This method acquires an instance needed to manipulate a group specified on the EADS client when the user function is executed.

(b) Format

public Group getGroup()

(c) Return value

This method returns the instance needed to manipulate the group specified on the EADS client when the user function is executed.

If no group was specified on the EADS client, the method returns null.

(8) [Deprecated] getGroup() (group name specification)

Reference note

This method is deprecated. Instead, use the createGroup() of the Store interface.

(a) Description

This method acquires an instance needed to manipulate a specified group.

(b) Format

public Group getGroup(String groupName)
               throws EADsStoreException

(c) Parameters

groupName

Specifies a group name.

For details about the data that can be specified, see 15.2.2(2) Data that can be specified as group names.

This parameter is invalid in the following case:

  • The specified group name is not subject to processing by the Store interface.

(d) Return value

This method returns an instance needed to manipulate the specified group.

(e) Exceptions

  • UserOperationException (illegal user operation)

  • InternalServerException (EADS server internal error)

  • EADsStoreException(unexpected error)

(9) containsKey() (Key interface specification)

(a) Description

This method acquires a value indicating whether the value associated with a specified key is stored in the cache.

(b) Format

public boolean containsKey(Key key)
                    throws EADsStoreException

(c) Parameters

key

Specifies the key of the Key interface that is associated with the value.

This parameter is invalid in the following cases:

  • null is specified.

  • The specified object of the Key interface is invalid.

  • The specified key is not subject to processing by the Store interface.

(d) Return value

This method returns a value indicating whether the value associated with the specified key is stored in the cache.

true

The value is stored in the cache.

false

The value is not stored in the cache.

(e) Exceptions

  • UserOperationException (illegal user operation)

  • InternalServerException (EADS server internal error)

  • EADsStoreException (unexpected error)

(10) [Deprecated] containsKey() (character string specification)

Reference note

This method is deprecated. Instead, use the containsKey() (Key interface specification) of the Store interface.

(a) Description

This method acquires a value indicating whether the value associated with a specified key is stored in the cache.

(b) Format

public boolean containsKey(String key)
                    throws EADsStoreException

(c) Parameters

key

Specifies a key to be checked.

For details about the data that can be specified, see 15.2.2(1) Data types that can be specified as keys.

If the specified key is not subject to processing by the Store interface, an error results.

(d) Return value

This method returns a value indicating whether the value associated with the specified key is stored in the cache.

true

The value is stored in the cache.

false

The value is not stored in the cache.

(e) Exceptions

  • UserOperationException (illegal user operation)

  • InternalServerException (EADS server internal error)

  • EADsStoreException (unexpected error)

(11) put()

(a) Description

This method stores a value by associating it with a key.

If a value is already stored, the existing value will be updated to the specified value.

(b) Format

public void put(Key key, Value value)
         throws EADsStoreException

(c) Parameters

key

Specifies a key of the Key interface that is to be associated with a value.

This parameter is invalid in the following cases:

  • null is specified.

  • The specified object of the Key interface is invalid.

  • The specified key is not subject to processing by the Store interface.

value

Specifies a Value interface value to be stored.

This parameter is invalid in the following cases:

  • null is specified.

  • The specified object of the Value interface is invalid.

(d) Exceptions

  • UserOperationException (illegal user operation)

  • InternalServerException (EADS server internal error)

  • EADsStoreException (unexpected error)

(12) create()

(a) Description

This method stores a value by associating it with a key only when a new key is stored.

If a value has already been stored, the method returns EADsStoreException.

(b) Format

public void create(Key key, Value value)
            throws EADsStoreException

(c) Parameters

key

Specifies a key of the Key interface that is to be associated with a value.

This parameter is invalid in the following cases:

  • null is specified.

  • The specified object of the Key interface is invalid.

  • The specified key is not subject to processing by the Store interface.

value

Specifies a value to be stored.

This parameter is invalid in the following cases:

  • null is specified.

  • The specified object of the Value interface is invalid.

(d) Exceptions

  • UserOperationException (illegal user operation)

  • InternalServerException (EADS server internal error)

  • EADsStoreException (unexpected error)

(13) update()

(a) Description

This method stores a value by associating it with a key only when the specified key is already stored (the value is updated).

If no value is stored, the method returns EADsStoreException.

(b) Format

public void update(Key key, Value value)
            throws EADsStoreException

(c) Parameters

key

Specifies a key of the Key interface that is to be associated with the value to be stored.

This parameter is invalid in the following cases:

  • null is specified.

  • The specified object of the Key interface is invalid.

  • The specified key is not subject to processing by the Store interface.

value

Specifies a Value interface value to be stored.

This parameter is invalid in the following cases:

  • null is specified.

  • The specified object of the Value interface is invalid.

(d) Exceptions

  • UserOperationException (illegal user operation)

  • InternalServerException (EADS server internal error)

  • EADsStoreException (unexpected error)

(14) replace()

(a) Description

This method compares the value associated with a specified key to the value (comparativeValue) specified as a condition, and updates the value if the values match.

The method returns EADsStoreException in the following cases:

  • A value is stored, but it does not match the value (comparativeValue) specified as the condition.

  • No value is stored.

(b) Format

public void replace(Key key, Value value, Value comparativeValue)
             throws EADsStoreException

(c) Parameters

key

Specifies the key of the Key interface that is associated with the value to be stored.

This parameter is invalid in the following cases:

  • null is specified.

  • The specified object of the Key interface is invalid.

  • The specified key is not subject to processing by the Store interface.

value

Specifies a Value interface value to be stored.

This parameter is invalid in the following cases:

  • null is specified.

  • The specified object of the Value interface is invalid.

comparativeValue

Specifies a Value interface value to be compared.

This parameter is invalid in the following cases:

  • null is specified.

  • The specified object of the Value interface is invalid.

(d) Exceptions

  • UserOperationException (illegal user operation)

  • InternalServerException (EADS server internal error)

  • EADsStoreException (unexpected error)

(15) get()

(a) Description

This method acquires the value associated with a specified key.

(b) Format

public Value get(Key key)
          throws EADsStoreException

(c) Parameters

key

Specifies the key of the Key interface that is associated with the value to be acquired.

This parameter is invalid in the following cases:

  • null is specified.

  • The specified object of the Key interface is invalid.

  • The specified key is not subject to processing by the Store interface.

(d) Return value

This method returns the value associated with the specified key.

If no value is associated with the specified key, the method returns null.

(e) Exceptions

  • UserOperationException (illegal user operation)

  • InternalServerException (EADS server internal error)

  • EADsStoreException (unexpected error)

(16) remove()

(a) Description

This method deletes a specified key and the value associated with that key.

(b) Format

public void remove(Key key)
            throws EADsStoreException

(c) Parameters

key

Specifies the key of the Key interface that is associated with the value to be deleted.

This parameter is invalid in the following cases:

  • null is specified.

  • The specified object of the Key interface is invalid.

  • The specified key is not subject to processing by the Store interface.

(d) Exceptions

  • UserOperationException (illegal user operation)

  • InternalServerException (EADS server internal error)

  • EADsStoreException (unexpected error)

(17) getLastUpdateTime()

(a) Description

This method acquires the last time the value associated with a specified key was updated.

(b) Format

public long getLastUpdateTime(Key key)
                       throws EADsStoreException

(c) Parameters

key

Specifies the key of the Key interface that is associated with the value.

This parameter is invalid in the following cases:

  • null is specified.

  • The specified object of the Key interface is invalid.

  • The specified key is not subject to processing by the Store interface.

(d) Return value

This method returns the last data update time (absolute time in milliseconds from 1970-01-01 at 00:00:00 (UTC)).

(e) Exceptions

  • UserOperationException (illegal user operation)

  • InternalServerException (EADS server internal error)

  • EADsStoreException (unexpected error)

(18) getKeyCount()

(a) Description

This method acquires the total number of keys stored in the cache.

Because keys and values have a one-to-one correspondence, the acquired number of keys corresponds to the number of values stored in the cache.

(b) Format

public int getKeyCount()
                throws EADsStoreException

(c) Return value

This method returns the total number of keys stored in the cache.

(d) Exceptions

  • InternalServerException (EADS server internal error)

  • EADsStoreException (unexpected error)

(19) getGroupCount()

(a) Description

This method acquires the number of groups in the highest hierarchy of all groups to which the keys stored in the cache belong.

(b) Format

public int getGroupCount()
                  throws EADsStoreException

(c) Return value

This method returns the number of groups in the highest hierarchy of all groups to which the keys stored in the cache belong.

(d) Exceptions

  • InternalServerException (EADS server internal error)

  • EADsStoreException (unexpected error)

(20) getGroupNames()

(a) Description

This method acquires a list of group names in the highest hierarchy of all groups to which the keys stored in the cache belong.

The group names are listed in ascending order based on their ASCII code values.

(b) Format

public String[] getGroupNames()
                       throws EADsStoreException

(c) Return value

This method returns a list of group names in the highest hierarchy of all the groups to which the keys stored in the cache belong.

(d) Exceptions

  • InternalServerException (EADS server internal error)

  • EADsStoreException (unexpected error)

(21) [Deprecated] getGroupNameSet()

Reference note

This method is deprecated. Instead, use getGroupNames() of the Store interface.

(a) Description

This method acquires a list of group names in the highest hierarchy in the cache in ascending order based on their ASCII code values.

(b) Format

public java.util.Set<String> getGroupNameSet()
                            throws EADsStoreException

(c) Return value

This method returns a list of group names in the highest hierarchy in the cache (in ascending order based on their ASCII code values).

(d) Exceptions

  • EADsStoreException(unexpected error)

(22) getEHeapUsageSize() (Key interface specification)

(a) Description

This method acquires the size (in bytes) of the explicit heap being used to store values.

(b) Format

public long getEHeapUsageSize(Key key)
                       throws EADsStoreException

(c) Parameters

key

Specifies a key of the Key interface that is associated with the values.

This parameter is invalid in the following cases:

  • null is specified.

  • The specified object of the Key interface is invalid.

  • The specified key is not subject to processing by the Store interface.

(d) Return value

This method returns the size (in bytes) of the explicit heap being used to store values.

(e) Exceptions

  • UserOperationException (illegal user operation)

  • InternalServerException (EADS server internal error)

  • EADsStoreException (unexpected error)

(23) getEHeapUsageSize() (Group interface specification)

(a) Description

This method acquires the size (in bytes) of the explicit heap being used to store values for the keys that belong to a specified group.

(b) Format

public long getEHeapUsageSize(Group group)
                       throws EADsStoreException

(c) Parameters

group

Specifies the group name of the Group interface to which the key belongs.

This parameter is invalid in the following cases:

  • null is specified.

  • The specified object of the Group interface is invalid.

  • The specified key is not subject to processing by the Store interface.

(d) Return value

This method returns the size (in bytes) of the explicit heap being used to store values for the keys that belong to the specified group.

(e) Exceptions

  • UserOperationException (illegal user operation)

  • InternalServerException (EADS server internal error)

  • EADsStoreException (unexpected error)

(24) getDiskUsageSize() (Key interface specification)

(a) Description

This method acquires the amount (in bytes) of disk space being used to store values.

(b) Format

public long getDiskUsageSize(Key key)
                      throws EADsStoreException

(c) Parameters

key

Specifies a key of the Key interface that is associated with the values.

This parameter is invalid in the following cases:

  • null is specified.

  • The specified object of the Key interface is invalid.

  • The specified key is not subject to processing by the Store interface.

(d) Return value

This method returns the amount (in bytes) of disk space being used to store values.

(e) Exceptions

  • UserOperationException (illegal user operation)

  • InternalServerException (EADS server internal error)

  • EADsStoreException (unexpected error)

(25) getDiskUsageSize() (Group interface specification)

(a) Description

This method acquires the amount (in bytes) of disk space being used to store values for keys that belong to a specified group.

(b) Format

public long getEHeapUsageSize(Group group)
                       throws EADsStoreException

(c) Parameters

group

Specifies a group name of the Group interface to which keys belong.

This parameter is invalid in the following cases:

  • null is specified.

  • The specified object of the Group interface is invalid.

  • The specified group is not subject to processing by the Store interface.

(d) Return value

This method returns the amount (in bytes) of disk space being used to store values for keys that belong to the specified group.

(e) Exceptions

  • UserOperationException (illegal user operation)

  • InternalServerException (EADS server internal error)

  • EADsStoreException (unexpected error)

(26) calcEHeapUsageSize()

(a) Description

This method calculates the size (in bytes) of the explicit heap used if a specified value is stored.

(b) Format

public long calcEHeapUsageSize(Value value)
                        throws EADsStoreException

(c) Parameters

value

Specifies a Value interface value that was stored.

This parameter is invalid in the following cases:

  • null is specified.

  • The specified object of the Value interface is invalid.

(d) Return value

This method returns the size (in bytes) of the explicit heap used if the specified value is stored.

(e) Exceptions

  • UserOperationException (illegal user operation)

  • InternalServerException (EADS server internal error)

  • EADsStoreException (unexpected error)

(27) calcDiskUsageSize()

(a) Description

This method calculates the amount (in bytes) of disk space used if a specified value is stored.

(b) Format

public long calcDiskUsageSize(Key key, Value value)
                              throws EADsStoreException

(c) Parameters

key

Specifies the key of the Key interface that is associated with a value.

This parameter is invalid in the following cases:

  • null is specified.

  • The specified object of the Value interface is invalid.

value

Specifies a Value interface value that was stored.

This parameter is invalid in the following cases:

  • null is specified.

  • The specified object of the Value interface is invalid.

(d) Return value

This method returns the amount of disk space used if the specified value is stored.

(e) Exceptions

  • UserOperationException (illegal user operation)

  • InternalServerException (EADS server internal error)

  • EADsStoreException (unexpected error)