Error Response
Description
This response type is returned when an error occurs with any command type.
Response
ErrorResponse | |||
Field Name | Data type | Description | Mandatory? |
---|---|---|---|
errorCode | Int | An Integer representing the error code for a specific error | Y |
errorMessage | String | A description of the error. | N |
Possible Errors
While each operation describes some errors particular to its execution, the following errors are fairly generic and can be seen in a wide variety of operations. This list is a possible super-set of errors that can be thrown and are applicable to all operations.
Error Code | Error Definition | Error Description |
---|---|---|
1000 | UNCLASSIFIED_FAILURE | This error will be thrown as a last resort if an exception cannot be classified. This error will then have to be investigated and correctly classified |
1100 | VALUE_ENCODING_ERROR | There was an error whilst encoding a data entry (key / value) |
1102 | UNSUPPORTED_OPERATION | The request isn't a valid server operation |
1201 | AUTHORIZATION_FAILED | The client doesn't have sufficient access rights to perform this operation |
1300 | LOW_MEMORY | Server does not have enough free memory to complete the operation |
Get
Description
Gets the value associated with a particular key in a particular region.
Request
GetRequest | |||
Field Name | Data type | Description | Mandatory? |
---|---|---|---|
regionName | String | The name of the region which is to be targeted | Y |
key | EncodedValue | The key that is to be looked up | Y |
Response
GetResponse | |||
Field Name | Data type | Description | Mandatory? |
---|---|---|---|
result | EncodedValue | The value matching the looked-up key | Y |
Expected behavior
If key is not found in the region, the result will not be populated.
For valid key, return value as EncodedValue
- If there is no region matching the regionName, a REGION_NOT_FOUND ErrorResponse will be returned
- If the provided key does not match the configured key-constraint on the region, a CONSTRAINT_VIOLATION ErrorResponse will be returned
Errors
Error Code | Error Definition | Error Description |
---|---|---|
2100 | REGION_NOT_FOUND | No Region exists for the name provided |
2000 | CONSTRAINT_VIOLATION | The key-constraint on the region has been violated and incompatible |
Put
Description
Adds a (key, value) pair to a region, replacing any existing entry for the key.
Request
PutRequest | |||
Field Name | Data type | Description | Mandatory? |
---|---|---|---|
regionName | String | The name of the region which is to be targeted | Y |
entry | Entry | A type containing (key, value) pair to be inserted into the region. | Y |
Response
A successful Put operaration will result in an empty PutResponse message. This is because there is no data that needs to be sent back, but a message is needed to indicate a complete operation.
PutResponse | |||
Field Name | Data type | Description | Mandatory? |
---|---|---|---|
Expected Behavior
- If an error is returned, any existing entry is left unmodified.
- If there is no region matching the regionName, a REGION_NOT_FOUND ErrorResponse will be returned
- If the provided key does not match the configured key-constraint on the region, a CONSTRAINT_VIOLATION ErrorResponse will be returned
Errors
Error Code | Error Definition | Error Description |
---|---|---|
2100 | REGION_NOT_FOUND | No Region exists for the name provided |
2000 | CONSTRAINT_VIOLATION | The key-constraint on the region has been violated and incompatible |
GetRegion
Description
Get a structure containing information about a region.
Request
GetRegionRequest | |||
Field Name | Data type | Description | Mandatory? |
---|---|---|---|
regionName | String | The name of the region to get information on | Y |
Response
GetRegionResponse | |||
Field Name | Data type | Description | Mandatory? |
---|---|---|---|
region | Region | A structure containing information on the region | Y |
Expected behavior
If there is no region matching the regionName, a REGION_NOT_FOUND ErrorResponse will be returned
Errors
Error Code | Error Definition | Error Description |
---|---|---|
2100 | REGION_NOT_FOUND | No Region exists for the name provided |
GetRegionNames
Description
Returns a list of regions available through this server.
Request
A GetRegionNamesRequest contains no extra data fields.
GetRegionNamesRequest | |||
Field Name | Data type | Description | Mandatory? |
---|---|---|---|
Response
GetRegionNamesResponse | ||||
Field Name | Data type | Description | Mandatory? | Repeated |
---|---|---|---|---|
regions | String | A list of the names of the regions that are available on the server. | Y | Y |
Expected behavior
This only gets the regions present on the target server. This may not be the set of all regions in the cluster, depending on how the servers are configured.
Errors
There are no errors particular to this operation.
Error Code | Error Definition | Error Description |
---|---|---|
Remove
Description
Remove an entry from a region.
Request
RemoveRequest | |||
Field Name | Data type | Description | Mandatory? |
---|---|---|---|
regionName | String | The name of the region to remove an entry from. | Y |
key | EncodedValue | The key of the entry to be removed. | Y |
Response
The presence of a remove response indicates the entry is not longer present in the region. The response contains no additional data fields.
RemoveResponse | ||||
Field Name | Data type | Description | Mandatory? | Repeated |
---|---|---|---|---|
Expected behavior
If the key is not present in the region, this operation will make no changes to the region. It will still return a RemoveResponse in this case.
Errors
Error Code | Error Definition | Error Description |
---|---|---|
2100 | REGION_NOT_FOUND | No region with the provided regionName exists. |
2000 | CONSTRAINT_VIOLATION | The type of value provided for the key doesn’t match the region’s constraints. |
RemoveAll
Description
Removes all of a list of entries from a region.
Request
RemoveAllRequest | ||||
Field Name | Data type | Description | Mandatory? | Repeated? |
---|---|---|---|---|
regionName | String | The name of the region to remove entries from. | Y | N |
key | EncodedValue | A list of keys who's entries should be removed. | Y | Y |
Response
RemoveAllResponse | ||||
Field Name | Data type | Description | Mandatory? | Repeated |
---|---|---|---|---|
failedKeys | KeyedErrorResponse | A list of keys that were not removed. | N | Y |
Expected behavior
If a key is not present in the region, this operation will ignore it and continue with the others.
If a RemoveAllResponse is returned with a list of failedKeys, any keys from the request not present in the response have been removed. If an empty list is returned, all keys were removed.
Any keys present in failedKeys will have their entry remain in the same state they were in prior to this operation.
If an error response is returned by this operation (instead of a RemoveAllResponse), all entries remain in the same state as prior to this operation.
Errors
Error Code | Error Definition | Error Description |
---|---|---|
2100 | REGION_NOT_FOUND | No region with the provided regionName exists. |
PutAll
Description
Put a collection of Entries into a region.
Request
PutAllRequest | ||||
Field Name | Data type | Description | Mandatory? | Repeated? |
---|---|---|---|---|
regionName | String | The name of the region to put entries into. | Y | N |
entries | Entry | A list of entries to add to the region. | Y | Y |
Response
PutAllResponse | ||||
Field Name | Data type | Description | Mandatory? | Repeated |
---|---|---|---|---|
failedKeys | KeyedErrorResponse | A list of keys that were not added. | N | Y |
Expected behavior
If a PutAllResponse is returned with a list of failedKeys, any keys from the request not present in the response were successfully added/updated.
Any keys present in failedKeys will have their entry remain in the same state they were in prior to this operation.
If an error response is returned by this operation (instead of a RemoveAllResponse), all entries remain in the same state as prior to this operation.
Errors
Error Code | Error Definition | Error Description |
---|---|---|
2100 | REGION_NOT_FOUND | No region with the provided regionName exists. |
GetAll
Description
Get a series of values from a region.
Request
GetAllRequest | ||||
Field Name | Data type | Description | Mandatory? | Repeated? |
---|---|---|---|---|
regionName | String | The name of the region to get entries from. | Y | N |
keys | EncodedValue | A list of keys to fetch values for. | Y | Y |
Response
GetAllResponse | ||||
Field Name | Data type | Description | Mandatory? | Repeated |
---|---|---|---|---|
entries | Entry | A list of looked up entries. | Y | Y |
failedKeys | KeyedErrorResponse | A list of keys which generated errors on lookup. | N | Y |
Expected behavior
If a GetAllResponse is returned and no entry is returned for a particular key, and that key is not present in the failedKeys, then no entry exists for that key in the region.
Errors
Error Code | Error Definition | Error Description |
---|---|---|
2100 | REGION_NOT_FOUND | No region with the provided regionName exists. |