Skip to content

Commit

Permalink
resolve #82 use Integer instead of VIntWritable in hash tables in old…
Browse files Browse the repository at this point in the history
… SetDifference operator because this was problematic for rdfDiff
  • Loading branch information
paulhoule committed Dec 4, 2013
1 parent 2d5529e commit 4b8554d
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 37 deletions.
84 changes: 53 additions & 31 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@
public class SetDifferenceReducer<KeyType extends WritableComparable>
extends Reducer<TaggedItem<KeyType>,VIntWritable,KeyType,NullWritable> {

final static VIntWritable ONE=new VIntWritable(1);
final static VIntWritable TWO=new VIntWritable(2);

@Override
protected void reduce(TaggedItem<KeyType> key, Iterable<VIntWritable> values, Context context) throws IOException, InterruptedException {
Set<VIntWritable> that= Sets.newHashSet();
Iterables.addAll(that,values);
Set<Integer> that= Sets.newHashSet();
for(VIntWritable tag:values)
that.add(tag.get());

if(that.contains(ONE) & !that.contains(TWO)) {
if(that.contains(1) & !that.contains(2)) {
context.write(key.getKey(),null);
}
}
Expand Down

0 comments on commit 4b8554d

Please sign in to comment.