get

Get values from the current region. get will populate local cache if entries don't exist already. Get values from the current region using the enumerated keys. You need to use 'ls -k' first to get the list of enumerated keys.


gfsh:/Orders>get -k 1-5                 
	
Error: No keys obtained. Execute 'ls -k' first to obtain the keys
	
gfsh:/Orders>ls -k                      
	
Row  Id  CustProdId
---  --  ----------
1    9   CUST10401_ELEX302
2    4   CUST13541_HSHD201
3    1   CUST96874_HSHD101
4    8   CUST34571_ELEX203
5    2   CUST13541_HSHD101
6    12  CUST34571_ELEX304
	
	 Fetch size: 6
   Returned: 6/6
	      Class: data.OrderKey
Partitioned region local dataset retrieval. The actual size maybe larger.
elapsed (msec): 15
	
gfsh:/Orders>get -k 1-5
	
Row  Id  CustProdId        | Id  Time                          Quantity  ProductId  CustomerId  Discount
---  --  ----------        | --  ----                          --------  ---------  ----------  --------
1    9   CUST10401_ELEX302 | 9   Fri Sep 04 10:22:03 IST 2009  7         ELEX302    CUST10401   0.1
2    4   CUST13541_HSHD201 | 4   Wed Jul 06 15:22:03 IST 2011  5         HSHD201    CUST13541   0.4
3    1   CUST96874_HSHD101 | 1   Fri Apr 10 00:00:00 IST 2009  10        HSHD101    CUST96874   0.5
4    8   CUST34571_ELEX203 | 8   Sat Jun 05 23:22:03 IST 2010  9         ELEX203    CUST34571   0.2
5    2   CUST13541_HSHD101 | 2   Sun Jun 12 23:22:03 IST 2011  9         HSHD102    CUST13541   0.2
	
	  Key Class: data.OrderKey
Value Class: data.Order
elapsed (msec): 0
	
gfsh:/Orders>get -k 1 4-6   
	
Row  Id  CustProdId        | Id  Time                          Quantity  ProductId  CustomerId  Discount
---  --  ----------        | --  ----                          --------  ---------  ----------  --------
1    9   CUST10401_ELEX302 | 9   Fri Sep 04 10:22:03 IST 2009  7         ELEX302    CUST10401   0.1
2    8   CUST34571_ELEX203 | 8   Sat Jun 05 23:22:03 IST 2010  9         ELEX203    CUST34571   0.2
3    2   CUST13541_HSHD101 | 2   Sun Jun 12 23:22:03 IST 2011  9         HSHD102    CUST13541   0.2
4    12  CUST34571_ELEX304 | 12  Thu Jan 13 21:22:03 IST 2011  53        ELEX304    CUST34571   5.0
	
   Key Class: data.OrderKey
Value Class: data.Order
elapsed (msec): 1
	

Using query predicate. This command uses key objects to retrieve data. Hence, if the key is a custom object, you need to specify value for all fields. Refer to example below. The key is defined by class OrderKey which has two fields: Id and CustProdId.

	
gfsh:/Orders>get Id='8'
	
Key not found.
	
gfsh:/Orders>get CustProdId='CUST34571_ELEX203'
	
Key not found.
	
gfsh:/Orders>get Id='8' and CustProdId='1CUST34571_ELEX203'
	
Key not found.
	
gfsh:/Orders>get Id='8' and CustProdId='CUST34571_ELEX203' 
	
Row  Id  CustProdId        | Id  Time                          Quantity  ProductId  CustomerId  Discount
---  --  ----------        | --  ----                          --------  ---------  ----------  --------
1    8   CUST34571_ELEX203 | 8   Sat Jun 05 23:22:03 IST 2010  9         ELEX203    CUST34571   0.2
	
  Key Class: data.OrderKey
Value Class: data.Order
elapsed (msec): 0