You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by bi...@apache.org on 2012/01/06 17:10:09 UTC
svn commit: r1228245 - in /incubator/accumulo/trunk: ./
docs/examples/README.filter src/core/ src/server/
Author: billie
Date: Fri Jan 6 16:10:08 2012
New Revision: 1228245
URL: http://svn.apache.org/viewvc?rev=1228245&view=rev
Log:
ACCUMULO-275 rewrote README.filter - merged to trunk
Modified:
incubator/accumulo/trunk/ (props changed)
incubator/accumulo/trunk/docs/examples/README.filter
incubator/accumulo/trunk/src/core/ (props changed)
incubator/accumulo/trunk/src/server/ (props changed)
Propchange: incubator/accumulo/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan 6 16:10:08 2012
@@ -1,3 +1,3 @@
/incubator/accumulo/branches/1.3:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215,1227231,1227611
/incubator/accumulo/branches/1.3.5rc:1209938
-/incubator/accumulo/branches/1.4:1201902-1222706,1225007,1227202,1227216,1227289,1227611-1227612,1227650,1227767,1228203
+/incubator/accumulo/branches/1.4:1201902-1222706,1225007,1227202,1227216,1227289,1227611-1227612,1227650,1227767,1228203,1228242
Modified: incubator/accumulo/trunk/docs/examples/README.filter
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/docs/examples/README.filter?rev=1228245&r1=1228244&r2=1228245&view=diff
==============================================================================
--- incubator/accumulo/trunk/docs/examples/README.filter (original)
+++ incubator/accumulo/trunk/docs/examples/README.filter Fri Jan 6 16:10:08 2012
@@ -17,32 +17,31 @@ Notice: Licensed to the Apache Softwa
under the License.
This is a simple filter example. It uses the AgeOffFilter that is provided as
-part of the core package org.apache.accumulo.core.iterators.filter. Filters are used by
-the FilteringIterator to select desired key/value pairs (or weed out undesired
-ones). Filters implement the org.apache.accumulo.core.iterators.iterators.filter.Filter interface which
-contains a method accept(Key k, Value v). This method returns true if the key,
-value pair are to be delivered and false if they are to be ignored.
+part of the core package org.apache.accumulo.core.iterators.user. Filters are
+iterators that select desired key/value pairs (or weed out undesired ones).
+Filters extend the org.apache.accumulo.core.iterators.iterators.Filter class
+and must implement a method accept(Key k, Value v). This method returns true
+if the key/value pair are to be delivered and false if they are to be ignored.
+Filter takes a "negate" parameter which defaults to false. If set to true, the
+return value of the accept method is negated, so that key/value pairs accepted
+by the method are omitted by the Filter.
username@instance> createtable filtertest
- username@instance filtertest> setiter -t filtertest -scan -p 10 -n myfilter -filter
- FilteringIterator uses Filters to accept or reject key/value pairs
- ----------> entering options: <filterPriorityNumber> <ageoff|regex|filterClass>
- ----------> set org.apache.accumulo.core.iterators.FilteringIterator option (<name> <value>, hit enter to skip): 0 ageoff
- ----------> set org.apache.accumulo.core.iterators.FilteringIterator option (<name> <value>, hit enter to skip):
+ username@instance filtertest> setiter -t filtertest -scan -p 10 -n myfilter -ageoff
AgeOffFilter removes entries with timestamps more than <ttl> milliseconds old
- ----------> set org.apache.accumulo.core.iterators.filter.AgeOffFilter parameter currentTime, if set, use the given value as the absolute time in milliseconds as the current time of day:
- ----------> set org.apache.accumulo.core.iterators.filter.AgeOffFilter parameter ttl, time to live (milliseconds): 30000
- username@instance filtertest>
-
+ ----------> set AgeOffFilter parameter negate, default false keeps k/v that pass accept method, true rejects k/v that pass accept method:
+ ----------> set AgeOffFilter parameter ttl, time to live (milliseconds): 30000
+ ----------> set AgeOffFilter parameter currentTime, if set, use the given value as the absolute time in milliseconds as the current time of day:
username@instance filtertest> scan
username@instance filtertest> insert foo a b c
username@instance filtertest> scan
- foo a:b [] c
+ foo a:b [] c
+ username@instance filtertest>
... wait 30 seconds ...
username@instance filtertest> scan
- username@instance filtertest>
+ username@instance filtertest>
Note the absence of the entry inserted more than 30 seconds ago. Since the
scope was set to "scan", this means the entry is still in Accumulo, but is
@@ -50,56 +49,62 @@ being filtered out at query time. To de
the ages of their timestamps, AgeOffFilters should be set up for the "minc"
and "majc" scopes, as well.
-To force an ageoff in the persisted data, after setting up the ageoff iterator
+To force an ageoff of the persisted data, after setting up the ageoff iterator
on the "minc" and "majc" scopes you can flush and compact your table. This will
happen automatically as a background operation on any table that is being
-actively written to, but these are the commands to force compaction:
+actively written to, but can also be requested in the shell.
- username@instance filtertest> setiter -t filtertest -scan -minc -majc -p 10 -n myfilter -filter
- FilteringIterator uses Filters to accept or reject key/value pairs
- ----------> entering options: <filterPriorityNumber> <ageoff|regex|filterClass>
- ----------> set org.apache.accumulo.core.iterators.FilteringIterator option (<name> <value>, hit enter to skip): 0 ageoff
- ----------> set org.apache.accumulo.core.iterators.FilteringIterator option (<name> <value>, hit enter to skip):
+The first setiter command used the special -ageoff flag to specify the
+AgeOffFilter, but any Filter can be configured by using the -class flag. The
+following commands show how to enable the AgeOffFilter for the minc and majc
+scopes using the -class flag, then flush and compact the table.
+
+ username@instance filtertest> setiter -t filtertest -minc -majc -p 10 -n myfilter -class org.apache.accumulo.core.iterators.user.AgeOffFilter
AgeOffFilter removes entries with timestamps more than <ttl> milliseconds old
- ----------> set org.apache.accumulo.core.iterators.filter.AgeOffFilter parameter currentTime, if set, use the given value as the absolute time in milliseconds as the current time of day:
- ----------> set org.apache.accumulo.core.iterators.filter.AgeOffFilter parameter ttl, time to live (milliseconds): 30000
- username@instance filtertest>
-
- username@instance filtertest> flush -t filtertest
- 08 11:13:55,745 [shell.Shell] INFO : Flush of table filtertest initiated...
- username@instance filtertest> compact -t filtertest
- 08 11:14:10,800 [shell.Shell] INFO : Compaction of table filtertest scheduled for 20110208111410EST
- username@instance filtertest>
+ ----------> set AgeOffFilter parameter negate, default false keeps k/v that pass accept method, true rejects k/v that pass accept method:
+ ----------> set AgeOffFilter parameter ttl, time to live (milliseconds): 30000
+ ----------> set AgeOffFilter parameter currentTime, if set, use the given value as the absolute time in milliseconds as the current time of day:
+ username@instance filtertest> flush
+ 06 10:42:24,806 [shell.Shell] INFO : Flush of table filtertest initiated...
+ username@instance filtertest> compact
+ 06 10:42:36,781 [shell.Shell] INFO : Compaction of table filtertest started for given range
+ username@instance filtertest> flush -t filtertest -w
+ 06 10:42:52,881 [shell.Shell] INFO : Flush of table filtertest completed.
+ username@instance filtertest> compact -t filtertest -w
+ 06 10:43:00,632 [shell.Shell] INFO : Compacting table ...
+ 06 10:43:01,307 [shell.Shell] INFO : Compaction of table filtertest completed for given range
+ username@instance filtertest>
-After the compaction runs, the newly created files will not contain any data that should be aged off, and the
-Accumulo garbage collector will remove the old files.
+By default, flush and compact execute in the background, but with the -w flag
+they will wait to return until the operation has completed. Both are
+demonstrated above, though only one call to each would be necessary. A
+specific table can be specified with -t.
+
+After the compaction runs, the newly created files will not contain any data
+that should have been aged off, and the Accumulo garbage collector will remove
+the old files.
-To see the iterator settings for a table, use:
+To see the iterator settings for a table, use config.
username@instance filtertest> config -t filtertest -f iterator
- ---------+------------------------------------------+----------------------------------------------------------
- SCOPE | NAME | VALUE
- ---------+------------------------------------------+----------------------------------------------------------
- table | table.iterator.majc.myfilter .............. | 10,org.apache.accumulo.core.iterators.FilteringIterator
- table | table.iterator.majc.myfilter.opt.0 ........ | org.apache.accumulo.core.iterators.filter.AgeOffFilter
- table | table.iterator.majc.myfilter.opt.0.ttl .... | 30000
- table | table.iterator.majc.vers .................. | 20,org.apache.accumulo.core.iterators.VersioningIterator
+ ---------+---------------------------------------------+---------------------------------------------------------------------------
+ SCOPE | NAME | VALUE
+ ---------+---------------------------------------------+---------------------------------------------------------------------------
+ table | table.iterator.majc.myfilter .............. | 10,org.apache.accumulo.core.iterators.user.AgeOffFilter
+ table | table.iterator.majc.myfilter.opt.ttl ...... | 30000
+ table | table.iterator.majc.vers .................. | 20,org.apache.accumulo.core.iterators.user.VersioningIterator
table | table.iterator.majc.vers.opt.maxVersions .. | 1
- table | table.iterator.minc.myfilter .............. | 10,org.apache.accumulo.core.iterators.FilteringIterator
- table | table.iterator.minc.myfilter.opt.0 ........ | org.apache.accumulo.core.iterators.filter.AgeOffFilter
- table | table.iterator.minc.myfilter.opt.0.ttl .... | 30000
- table | table.iterator.minc.vers .................. | 20,org.apache.accumulo.core.iterators.VersioningIterator
+ table | table.iterator.minc.myfilter .............. | 10,org.apache.accumulo.core.iterators.user.AgeOffFilter
+ table | table.iterator.minc.myfilter.opt.ttl ...... | 30000
+ table | table.iterator.minc.vers .................. | 20,org.apache.accumulo.core.iterators.user.VersioningIterator
table | table.iterator.minc.vers.opt.maxVersions .. | 1
- table | table.iterator.scan.myfilter .............. | 10,org.apache.accumulo.core.iterators.FilteringIterator
- table | table.iterator.scan.myfilter.opt.0 ........ | org.apache.accumulo.core.iterators.filter.AgeOffFilter
- table | table.iterator.scan.myfilter.opt.0.ttl .... | 30000
- table | table.iterator.scan.vers .................. | 20,org.apache.accumulo.core.iterators.VersioningIterator
+ table | table.iterator.scan.myfilter .............. | 10,org.apache.accumulo.core.iterators.user.AgeOffFilter
+ table | table.iterator.scan.myfilter.opt.ttl ...... | 30000
+ table | table.iterator.scan.vers .................. | 20,org.apache.accumulo.core.iterators.user.VersioningIterator
table | table.iterator.scan.vers.opt.maxVersions .. | 1
- ---------+------------------------------------------+----------------------------------------------------------
+ ---------+---------------------------------------------+---------------------------------------------------------------------------
username@instance filtertest>
-If you would like to apply multiple filters, this can be done using a single
-iterator. Just continue adding entries during the
-"set org.apache.accumulo.core.iterators.FilteringIterator option" step.
-Make sure to order the filterPriorityNumbers in the order you would like
-the filters to be applied.
+When setting new iterators, make sure to order their priority numbers
+(specified with -p) in the order you would like the iterators to be applied.
+Also, each iterator must have a unique name and priority within each scope.
Propchange: incubator/accumulo/trunk/src/core/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan 6 16:10:08 2012
@@ -1,3 +1,3 @@
-/incubator/accumulo/branches/1.3/src/core:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215
/incubator/accumulo/branches/1.3.5rc/src/core:1209938
-/incubator/accumulo/branches/1.4/src/core:1201902-1227271,1227611-1227612,1227650,1227767,1228203
+/incubator/accumulo/branches/1.3/src/core:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215
+/incubator/accumulo/branches/1.4/src/core:1201902-1227271,1227611-1227612,1227650,1227767,1228203,1228242
Propchange: incubator/accumulo/trunk/src/server/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan 6 16:10:08 2012
@@ -1,3 +1,3 @@
-/incubator/accumulo/branches/1.3/src/server:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215,1227231,1227611
/incubator/accumulo/branches/1.3.5rc/src/server:1209938
-/incubator/accumulo/branches/1.4/src/server:1201902-1227690,1228203
+/incubator/accumulo/branches/1.3/src/server:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215,1227231,1227611
+/incubator/accumulo/branches/1.4/src/server:1201902-1227690,1228203,1228242