/** * Adds some characteristics to the set merging them with the appropriate * existing characteristics if applicable * * @param characteristics */ public void add(CharacteristicWritable... characteristics) { for (CharacteristicWritable characteristic : characteristics) { this.add(characteristic); } }
/** * Adds some characteristics to the set merging them with the appropriate * existing characteristics if applicable * * @param characteristics */ public void add(CharacteristicWritable... characteristics) { for (CharacteristicWritable characteristic : characteristics) { this.add(characteristic); } }
@Override protected void reduce(CharacteristicSetWritable key, Iterable<CharacteristicSetWritable> values, Context context) throws IOException, InterruptedException { Iterator<CharacteristicSetWritable> iter = values.iterator(); CharacteristicSetWritable output = new CharacteristicSetWritable(0); if (this.tracing) { LOG.trace("Key = {}", key); } while (iter.hasNext()) { CharacteristicSetWritable set = iter.next(); if (this.tracing) { LOG.trace("Value = {}", set); } output.add(set); } context.write(output, NullWritable.get()); } }
/** * Adds the contents of the other characteristic set to this characteristic * set * * @param set * Characteristic set */ public void add(CharacteristicSetWritable set) { this.increment(set.getCount().get()); Iterator<CharacteristicWritable> iter = set.getCharacteristics(); while (iter.hasNext()) { this.add(iter.next()); } }
/** * Adds the contents of the other characteristic set to this characteristic * set * * @param set * Characteristic set */ public void add(CharacteristicSetWritable set) { this.increment(set.getCount().get()); Iterator<CharacteristicWritable> iter = set.getCharacteristics(); while (iter.hasNext()) { this.add(iter.next()); } }
CharacteristicSetWritable set = new CharacteristicSetWritable(); for (CharacteristicWritable c : cs) { set.add(c);
/** * Creates a set consisting of the given predicates * * @param predicates * Predicates * @return Set */ protected CharacteristicSetWritable createSet(MapReduceDriver<LongWritable, T, NodeWritable, T, CharacteristicSetWritable, NullWritable> driver, int occurrences, String... predicates) { CharacteristicSetWritable set = new CharacteristicSetWritable(); for (String predicateUri : predicates) { set.add(new CharacteristicWritable(NodeFactory.createURI(predicateUri))); } for (int i = 1; i <= occurrences; i++) { driver.addOutput(set, NullWritable.get()); } return set; }
/** * Creates a set consisting of the given predicates * * @param predicates * Predicates * @return Set */ protected CharacteristicSetWritable createSet( MapReduceDriver<CharacteristicSetWritable, CharacteristicSetWritable, CharacteristicSetWritable, CharacteristicSetWritable, CharacteristicSetWritable, NullWritable> driver, int inputOccurrences, int outputOccurrences, String... predicates) { CharacteristicSetWritable set = new CharacteristicSetWritable(); for (String predicateUri : predicates) { set.add(new CharacteristicWritable(NodeFactory.createURI(predicateUri))); } for (int i = 1; i <= inputOccurrences; i++) { driver.addInput(set, set); } for (int i = 1; i <= outputOccurrences; i++) { driver.addOutput(set, NullWritable.get()); } return set; }