geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbar...@apache.org
Subject [geode] branch develop updated: GEODE-1897 Docs: configure eviction through gfsh (#1098)
Date Wed, 29 Nov 2017 20:01:28 GMT
This is an automated email from the ASF dual-hosted git repository.

dbarnes pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 41888fb  GEODE-1897 Docs:  configure eviction through gfsh (#1098)
41888fb is described below

commit 41888fb4fa28946d59c91bcb638e27755ec04f5c
Author: Dave Barnes <dbarnes@pivotal.io>
AuthorDate: Wed Nov 29 12:01:26 2017 -0800

    GEODE-1897 Docs:  configure eviction through gfsh (#1098)
    
    * GEODE-1897 Docs:  configure eviction through gfsh
---
 .../eviction/configuring_data_eviction.html.md.erb | 59 +++++++---------------
 .../gfsh/command-pages/create.html.md.erb          | 59 +++++++++++++++++++---
 2 files changed, 70 insertions(+), 48 deletions(-)

diff --git a/geode-docs/developing/eviction/configuring_data_eviction.html.md.erb b/geode-docs/developing/eviction/configuring_data_eviction.html.md.erb
index 530c22f..e477d6d 100644
--- a/geode-docs/developing/eviction/configuring_data_eviction.html.md.erb
+++ b/geode-docs/developing/eviction/configuring_data_eviction.html.md.erb
@@ -28,7 +28,7 @@ Configure data eviction as follows. You do not need to perform these steps
in th
 
 1.  Decide whether to evict based on:
     -   Entry count (useful if your entry sizes are relatively uniform).
-    -   Total bytes used. In partitioned regions, this is set using `local-max-memory`. In
non-partitioned, it is set in `eviction-attributes`.
+    -   Total bytes used. In partitioned regions, this is set using `local-max-memory`. In
non-partitioned regions, it is set in `eviction-attributes`.
     -   Percentage of application heap used. This uses the <%=vars.product_name%> resource
manager. When the manager determines that eviction is required, the manager orders the eviction
controller to start evicting from all regions where the eviction algorithm is set to `lru-heap-percentage`.
Eviction continues until the manager calls a halt. <%=vars.product_name%> evicts the
least recently used entry hosted by the member for the region. See [Managing Heap and Off-heap
Memory](../../man [...]
 
 2.  Decide what action to take when the limit is reached:
@@ -38,51 +38,26 @@ Configure data eviction as follows. You do not need to perform these steps
in th
 3.  Decide the maximum amount of data to allow in the member for the eviction measurement
indicated. This is the maximum for all storage for the region in the member. For partitioned
regions, this is the total for all buckets stored in the member for the region - including
any secondary buckets used for redundancy.
 4.  Decide whether to program a custom sizer for your region. If you are able to provide
such a class, it might be faster than the standard sizing done by <%=vars.product_name%>.
Your custom class must follow the guidelines for defining custom classes and, additionally,
must implement `org.apache.geode.cache.util.ObjectSizer`. See [Requirements for Using Custom
Classes in Data Caching](../../basic_config/data_entries_custom_classes/using_custom_classes.html).
 
-**Note:**
-You can also configure Regions using the gfsh command-line interface, however, you cannot
configure `eviction-attributes` using gfsh. See [Region Commands](../../tools_modules/gfsh/quick_ref_commands_by_area.html#topic_EF03119A40EE492984F3B6248596E1DD)
and [Disk Store Commands](../../tools_modules/gfsh/quick_ref_commands_by_area.html#topic_1ACC91B493EE446E89EC7DBFBBAE00EA).
-
-Examples:
-
-``` pre
-// Create an LRU memory eviction controller with max bytes of 1000 MB
-// Use a custom class for measuring the size of each object in the region 
-<region-attributes refid="REPLICATE"> 
-  <eviction-attributes> 
-    <lru-memory-size maximum="1000" action="overflow-to-disk"> 
-      <class-name>com.myLib.MySizer</class-name> 
-      <parameter name="name"> 
-        <string>Super Sizer</string> 
-      </parameter> 
-    </lru-memory-size> 
-  </eviction-attributes> 
-  </region-attributes>
-```
+**Examples:**
 
-``` pre
-// Create a memory eviction controller on a partitioned region with max bytes of 512 MB
-<region name="demoPR">
-  <region-attributes refid="PARTITION">
-    <partition-attributes local-max-memory="512" total-num-buckets="13"/>
-    <eviction-attributes>
-       <lru-memory-size action="local-destroy"/>
-       <class-name>org.apache.geode.cache.util.ObjectSizer
-       </class-name>
-    </eviction-attributes>
-  </region-attributes>
-</region>
-            
-```
+Create an LRU memory eviction controller with a maximum limit of 1000 MB. Use a custom class
for measuring the size of each object in the region:
 
-``` pre
-// Configure a partitioned region for heap LRU eviction. The resource manager controls the
limits. 
-<region-attributes refid="PARTITION_HEAP_LRU"> 
-</region-attributes>
 ```
+gfsh>create region --name=myRegion --type=REPLICATE --eviction-max-memory=1000 \
+--eviction-action=overflow-to-disk --eviction-object-sizer=com.myLib.MySizer
+```
+
+Create a memory eviction controller on a partitioned region with a maximum entry count of
512:
 
-``` pre
-Region currRegion = cache.createRegionFactory()
-    .setEvictionAttributes(EvictionAttributes.createLRUHeapAttributes(EvictionAction.LOCAL_DESTROY))
-    .create("root");
+```
+gfsh>create region --name=myRegion --type=PARTITION --eviction-entry-count=512 \
+--eviction-action=overflow-to-disk 
 ```
 
+To configure a partitioned region for heap LRU eviction, first configure the resource manager
on server startup, then create a region with eviction enabled:
 
+```
+gfsh>start server --name=Server1 --eviction-heap-percentage=80
+...
+gfsh>create region --type=PARTITION --eviction-enabled --eviction-action=overflow-to-disk
+```
diff --git a/geode-docs/tools_modules/gfsh/command-pages/create.html.md.erb b/geode-docs/tools_modules/gfsh/command-pages/create.html.md.erb
index 5d972ee..42dd7b4 100644
--- a/geode-docs/tools_modules/gfsh/command-pages/create.html.md.erb
+++ b/geode-docs/tools_modules/gfsh/command-pages/create.html.md.erb
@@ -752,7 +752,8 @@ See [Region Data Storage and Distribution](../../../developing/region_options/ch
     [--recovery-delay=value] [--redundant-copies=value]
     [--startup-recovery-delay=value] [--total-max-memory=value]
     [--total-num-buckets=value] [--compressor=value] [--off-heap(=value)]
-    [--partition-resolver=value]
+    [--partition-resolver=value] [--eviction-enabled] [--eviction-entry-count=value]
+    [--eviction-max-memory=value] [--eviction-action=value] [--eviction-object-sizer=value]
 ```
 
 **Parameters, create region:**
@@ -961,6 +962,48 @@ See [Region Data Storage and Distribution](../../../developing/region_options/ch
 <td><span class="keyword parmname">\-\-partition-resolver</span></td>
 <td>Specifies the full path to a custom partition resolver. To use the provided default
partition resolver, specify <code class="ph codeph">org.apache.geode.cache.util.StringPrefixPartitionResolver</code>.</td>
 <td></td>
+</tr>
+<tr>
+<td><span class="keyword parmname">\-\-eviction-enabled</span></td>
+<td>Enables eviction, where the eviction policy is controlled by the resource manager
based on heap percentage.</td>
+<td></td>
+</tr>
+<tr>
+<td><span class="keyword parmname">\-\-eviction-entry-count</span></td>
+<td>Enables eviction, where the eviction policy is based on the number of entries in
the region.</td>
+<td></td>
+</tr>
+<tr>
+<td><span class="keyword parmname">\-\-eviction-max-memory</span></td>
+<td>Enables eviction, where the eviction policy is based on the amount of memory consumed
by the region, specified in megabytes.</td>
+<td></td>
+</tr>
+<tr>
+<td><span class="keyword parmname">\-\-eviction-action</span></td>
+<td>Action to take when the eviction threshold is reached.
+<div class="p">
+<table>
+<tbody>
+<tr class="odd">
+<td>local-destroy</td>
+<td>Entry is destroyed locally. Use with caution - may lead to inconsistencies.</td>
+</tr>
+<tr class="even">
+<td>overflow-to-disk</td>
+<td>Entry is overflowed to disk. For partitioned regions, this provides the most reliable
read behavior across the region.</td>
+</tr>
+</tbody>
+</table>
+</div>
+</td>
+<td></td>
+</tr>
+<tr>
+<td><span class="keyword parmname">\-\-eviction-object-sizer</span></td>
+<td>Specifies your implementation of the ObjectSizer interface to measure the size
of objects in the region.
+The sizer applies only to heap and memory based eviction.</td>
+<td></td>
+</tr>
 </tbody>
 </table>
 
@@ -978,13 +1021,17 @@ create region --name=region2 --type=REPLICATE \
 org.apache.geode.examples.MyCacheListener2 \
 --group=Group1,Group2
 
-create region --name=region3 --type=PARTITION_PERSISTENT --redundant-copies=2 --total-max-memory=1000
\
---startup-recovery-delay=5 --total-num-buckets=100 --disk-store=DiskStore2 \
---cache-listener=org.apache.geode.examples.MyCacheListener3 \
+create region --name=region3 --type=PARTITION_PERSISTENT --redundant-copies=2 \
+--total-max-memory=1000 --startup-recovery-delay=5 --total-num-buckets=100 \
+--disk-store=DiskStore2 --cache-listener=org.apache.geode.examples.MyCacheListener3 \
 --group=Group2 
 
-create region --name=region4 --type=REPLICATE_PROXY --cache-listener=org.apache.geode.examples.MyCacheListener1

---group=Group1,Group2
+create region --name=region4 --type=REPLICATE_PROXY \
+--cache-listener=org.apache.geode.examples.MyCacheListener1 --group=Group1,Group2
+
+create region --name=myRegion --type=REPLICATE --eviction-max-memory=100 \
+--eviction-action=overflow-to-disk --eviction-object-sizer=my.company.geode.MySizer
+
 ```
 
 **Sample Output:**

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <commits@geode.apache.org>'].

Mime
View raw message