blob: a1886e5e4a26ca7504351513147cd1fe23bcf138 [file] [log] [blame]
---
title: get
---
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
Display an entry in a region.
**Availability:** Online. You must be connected in `gfsh` to a JMX Manager member to use this command.
**Syntax:**
``` pre
get --key=value --region=value [--key-class=value] [--value-class=value]
```
<a id="concept_837F6196CE334C8CA2CAFD34AB6EF869__table_ez2_s1h_2w"></a>
| Name | Description | Default Value |
|------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|
| <span class="keyword parmname">\\-\\-key </span> | *Required.* String or JSON text from which to create the key. For example: "`James`", "`100L`" and "`('id': 'l34s')`". |   |
| <span class="keyword parmname">&#8209;&#8209;region</span> | *Required.* Region from which to get the entry. |   |
| <span class="keyword parmname">\\-\\-key-class</span> | Fully qualified class name of the key's type. | The default is the key constraint for the current region or String. |
| <span class="keyword parmname">\\-\\-value-class</span> | Fully qualified class name of the value's type. | The default is the value constraint for the current region or String. |
| <span class="keyword parmname">\\-\\-load-on-cache-miss</span> | Explicitly enables or disables the use of any registered CacheLoaders on the specified Region when retrieving a value for the specified Key on Cache misses. | true (enabled) |
<span class="tablecap">Table 1. Get Parameters</span>
**Example Commands:**
``` pre
get --key=('id':'133abg124') --region=region1
// Retrieving when key type is a wrapper(primitive)/String
get --key=('133abg124') --region=/region1/region12 --value-class=data.ProfileDetails
get --key=('100L') --region=/region1/region12 --value-class=data.ProfileDetails
--key-class=java.lang.Long
```
**Sample Output:**
``` pre
gfsh>get --key=('123') --region=region1
Result : true
Key Class : java.lang.String
Key : ('123')
Value Class : java.lang.String
Value : ABC
```