@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof MBMMessage)) return false; MBMMessage other = (MBMMessage) obj; if (state != other.state) return false; if (vertexID == null) { if (other.vertexID != null) return false; } else if (!vertexID.equals(other.vertexID)) return false; return true; }
public boolean equals(Object obj) { boolean isEqual = false; if (obj instanceof TextLong) { TextLong other = (TextLong)obj; isEqual = first.equals(other.first) && second.equals(other.second); } return isEqual; }
/** * Validate assigned Object(should Query instance) is the same * as this. * @param obj a object to be validated. * @return true when this and obj is identical contents * false when this and obj is different */ public final boolean equals(final Object obj) { if (obj == null) { return false; } if (!(obj instanceof Candidate)) { return false; } if ((this.size.get() == ((Candidate) obj).size.get()) && (this.id.equals(((Candidate) obj).id))) { return true; } return false; }
@Override public void map(final LongWritable key, BytesWritable value, final Mapper<LongWritable,BytesWritable,LongWritable,LongWritable>.Context context){ try { final TweetCountWordMap periodCountWordCount = IOUtils.read(new ByteArrayInputStream(value.getBytes()), TweetCountWordMap.class); if(!key.equals(CountTweetsInTimeperiod.Map.END_TIME)){ context.write(key, new LongWritable(periodCountWordCount.getNTweets())); } } catch (Exception e) { System.err.println("Couldnt read timeperiod: " + key); } } }
@Override public void map(final LongWritable key, BytesWritable value, final Mapper<LongWritable,BytesWritable,LongWritable,LongWritable>.Context context){ try { final TweetCountWordMap periodCountWordCount = IOUtils.read(new ByteArrayInputStream(value.getBytes()), TweetCountWordMap.class); if(!key.equals(CountTweetsInTimeperiod.Map.END_TIME)){ context.write(key, new LongWritable(periodCountWordCount.getNTweets())); } } catch (Exception e) { System.err.println("Couldnt read timeperiod: " + key); } } }
public void run() { for (int i = 0; i < count; i++) { try { LongWritable param = new LongWritable(RANDOM.nextLong()); LongWritable value = (LongWritable)client.call(param, server, null, null, 0, conf); if (!param.equals(value)) { LOG.fatal("Call failed!"); failed = true; break; } } catch (Exception e) { LOG.fatal("Caught: " + StringUtils.stringifyException(e)); failed = true; } } } }
@Override public boolean equals(Object o) { if (!(o instanceof BlockInfo)) { return false; } BlockInfo blkInfo = (BlockInfo) o; return blkInfo.getBlockId().equals(this.getBlockId()) && blkInfo.getBlockGenerationStamp().equals(this.getBlockGenerationStamp()) && blkInfo.getSize().equals(this.getSize()); }
Vertex<LongWritable, IntWritable, FloatWritable> vertex, Iterable<IntWritable> messages) throws IOException { if (vertex.getId().equals(new LongWritable(2))) { sendMessage(new LongWritable(1), new IntWritable(101)); sendMessage(new LongWritable(1), new IntWritable(102)); sendMessage(new LongWritable(1), new IntWritable(103)); if (!vertex.getId().equals(new LongWritable(1))) { vertex.voteToHalt(); } else {
Vertex<LongWritable, IntWritable, FloatWritable> vertex, Iterable<IntWritable> messages) throws IOException { if (vertex.getId().equals(new LongWritable(2))) { sendMessage(new LongWritable(1), new IntWritable(101)); sendMessage(new LongWritable(1), new IntWritable(102)); sendMessage(new LongWritable(1), new IntWritable(103)); if (!vertex.getId().equals(new LongWritable(1))) { vertex.voteToHalt(); } else {
@Override public void run() { for (int i = 0; i < count; i++) { try { LongWritable param = new LongWritable(RANDOM.nextLong()); LongWritable value = (LongWritable)client.call(param, server, null, null, 0, conf); if (!param.equals(value)) { LOG.fatal("Call failed!"); failed = true; break; } } catch (Exception e) { LOG.fatal("Caught: " + StringUtils.stringifyException(e)); failed = true; } } } }
@Override public void run() { for (int i = 0; i < count; i++) { try { LongWritable param = new LongWritable(RANDOM.nextLong()); LongWritable value = (LongWritable) client.call(param, serverAddress, null, null, 0, conf); if (!param.equals(value)) { LOG.fatal("Call failed!"); failed = true; break; } } catch (Exception e) { LOG.fatal("Caught : " + StringUtils.stringifyException(e)); failed = true; } } } }
@Override public void run() { for (int i = 0; i < count; i++) { try { LongWritable param = new LongWritable(RANDOM.nextLong()); @SuppressWarnings("deprecation") LongWritable value = (LongWritable) client.call(param, server); if (!param.equals(value)) { LOG.fatal("Call failed!"); failed = true; break; } } catch (Exception e) { LOG.fatal("Caught: " + StringUtils.stringifyException(e)); failed = true; } } } }
@Override public void run() { for (int i = 0; i < count; i++) { try { LongWritable param = new LongWritable(RANDOM.nextLong()); LongWritable value = (LongWritable)client.call(param, server, null, null, 0, conf); if (!param.equals(value)) { LOG.fatal("Call failed!"); failed = true; break; } } catch (Exception e) { LOG.fatal("Caught: " + StringUtils.stringifyException(e)); failed = true; } } } }
assertTrue("testArrayFileIteration error !!!", reader.key() == 7); assertTrue("testArrayFileIteration error !!!", nextWritable.equals(new LongWritable(7))); assertFalse("testArrayFileIteration error !!!", reader.seek(new LongWritable(SIZE + 5)));
assertTrue("testArrayFileIteration error !!!", reader.key() == 7); assertTrue("testArrayFileIteration error !!!", nextWritable.equals(new LongWritable(7))); assertFalse("testArrayFileIteration error !!!", reader.seek(new LongWritable(SIZE + 5)));