You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@accumulo.apache.org by Aaron Cordova <aa...@cordovas.org> on 2012/01/21 02:39:40 UTC

new combiners

Am I doing this right? I'm trying to enable the SummingOperator for all column families using 1.4.0. 

conn.tableOperations().create(name);
				
EnumSet<IteratorScope> scopes = EnumSet.allOf(IteratorScope.class);
Map<String,String> options = new HashMap<String, String>();
options.put("type", "STRING");

IteratorSetting its = new IteratorSetting(10, "weightSummer", "org.apache.accumulo.core.iterators.user.SummingCombiner", scopes, options);
Combiner.setCombineAllColumns(its, true);

conn.tableOperations().attachIterator(name, its);


Re: new combiners

Posted by John W Vines <jo...@ugov.gov>.
That looks correct to me. If you are seeing errors, there are 2 possibilities off the top of my head- combining all the columns will tell the combiner to run against each column family, NOT combine all elements in the table together. Alternatively, if you were seeing an without updating the code this afternoon, I suggest you update, rebuild, and try again due to https://issues.apache.org/jira/browse/ACCUMULO-338 .

John

----- Original Message -----
| From: "Aaron Cordova" <aa...@cordovas.org>
| To: accumulo-user@incubator.apache.org
| Sent: Friday, January 20, 2012 8:39:40 PM
| Subject: new combiners
| Am I doing this right? I'm trying to enable the SummingOperator for
| all column families using 1.4.0.
| 
| 
| 
| conn.tableOperations().create(name);
| 
| 
| 
| EnumSet<IteratorScope> scopes = EnumSet.allOf(IteratorScope. class );
| Map<String,String> options = new HashMap<String, String>();
| options.put( "type" , "STRING" );
| 
| 
| 
| IteratorSetting its = new IteratorSetting(10, "weightSummer" ,
| "org.apache.accumulo.core.iterators.user.SummingCombiner" , scopes,
| options);
| Combiner.setCombineAllColumns(its, true );
| 
| 
| 
| conn.tableOperations().attachIterator(name, its);

Re: new combiners

Posted by Aaron Cordova <aa...@cordovas.org>.
thanks all. The problem appears that, the tablet server is not recognizing the option and still looking for column families in the set of options, and finds none, throwing an error. I'll update the code, rebuild and try again.

Also - I did take the meaning of "all" to be to combine values together whose keys are identical up to the timestamp, and not to combine all values of all columns into one .. but the question did occur to me. I'm not sure how to make this clearer to the user except for in the documentation.

On Jan 20, 2012, at 10:58 PM, Billie J Rinaldi wrote:

> Instead of configuring the options map manually, you can use 
> SummingCombiner.setEncodingType(
>    iteratorSetting, 
>    SummingCombiner.Type.STRING);
> after you've created the IteratorSetting.
> 
> Billie


Re: new combiners

Posted by Billie J Rinaldi <bi...@ugov.gov>.
Instead of configuring the options map manually, you can use 
SummingCombiner.setEncodingType(
    iteratorSetting, 
    SummingCombiner.Type.STRING);
after you've created the IteratorSetting.

Billie