private Fields normalize( Fields fields ) { if( fields.equals( Fields.ALL ) ) fields = Fields.UNKNOWN; return fields; }
private Fields normalize( Fields fields ) { if( fields != null && fields.equals( Fields.ALL ) ) fields = Fields.UNKNOWN; return fields; }
@Override public boolean equals( Object object ) { if( this == object ) return true; if( !( object instanceof BaseOperation ) ) return false; BaseOperation that = (BaseOperation) object; if( numArgs != that.numArgs ) return false; if( fieldDeclaration != null ? !fieldDeclaration.equals( that.fieldDeclaration ) : that.fieldDeclaration != null ) return false; return true; }
@Override public boolean equals( Object object ) { if( this == object ) return true; if( object == null || getClass() != object.getClass() ) return false; Scheme scheme = (Scheme) object; if( numSinkParts != scheme.numSinkParts ) return false; if( sinkFields != null ? !sinkFields.equals( scheme.sinkFields ) : scheme.sinkFields != null ) return false; if( sourceFields != null ? !sourceFields.equals( scheme.sourceFields ) : scheme.sourceFields != null ) return false; return true; }
@Override public boolean equals( Object object ) { if( this == object ) return true; if( object == null || getClass() != object.getClass() ) return false; Stereotype that = (Stereotype) object; if( defaultProtocol != null ? !defaultProtocol.equals( that.defaultProtocol ) : that.defaultProtocol != null ) return false; if( fields != null ? !fields.equals( that.fields ) : that.fields != null ) return false; if( name != null ? !name.equals( that.name ) : that.name != null ) return false; if( staticSchemes != null ? !staticSchemes.equals( that.staticSchemes ) : that.staticSchemes != null ) return false; return true; }
@Override public boolean equals(Object obj) { if (obj instanceof DefinedTupleSerializer) { DefinedTupleSerializer other = (DefinedTupleSerializer) obj; return other.canEqual(this) && fields.equals(other.fields) && Arrays.equals(this.fieldSers, other.fieldSers); } else { return false; } }
@Override public boolean equals(Object object) { if (this == object) { return true; } if (object == null || getClass() != object.getClass()) { return false; } if (!super.equals(object)) { return false; } HBaseScheme that = (HBaseScheme) object; if (!Arrays.equals(familyNames, that.familyNames)) { return false; } if (keyField != null ? !keyField.equals(that.keyField) : that.keyField != null) { return false; } if (!Arrays.equals(valueFields, that.valueFields)) { return false; } return true; }
@Override public boolean equals( Object object ) { if( this == object ) return true; if( !( object instanceof TupleEntry ) ) return false; TupleEntry that = (TupleEntry) object; if( fields != null ? !fields.equals( that.fields ) : that.fields != null ) return false; // use comparators if in the this side fields instance if( tuple != null ? fields.compare( tuple, that.tuple ) != 0 : that.tuple != null ) return false; return true; }
@Override public boolean equals( Object object ) { if( this == object ) return true; if( !( object instanceof UnGroup ) ) return false; if( !super.equals( object ) ) return false; UnGroup unGroup = (UnGroup) object; if( size != unGroup.size ) return false; if( groupFieldSelector != null ? !groupFieldSelector.equals( unGroup.groupFieldSelector ) : unGroup.groupFieldSelector != null ) return false; if( !Arrays.equals( resultFieldSelectors, unGroup.resultFieldSelectors ) ) return false; return true; }
/** * Method isSymmetrical returns {@code true} if the sink fields equal the source fields. That is, this * scheme sources the same fields as it sinks. * * @return the symmetrical (type boolean) of this Scheme object. */ public boolean isSymmetrical() { return getSourceFields().equals( Fields.UNKNOWN ) && getSinkFields().equals( Fields.ALL ) || getSinkFields().equals( getSourceFields() ); }
protected void presentSourceFieldsInternal( Fields fields ) { if( getSourceFields().equals( Fields.UNKNOWN ) ) setSourceFields( fields ); }
protected void presentSinkFieldsInternal( Fields fields ) { if( getSinkFields().equals( Fields.ALL ) ) setSinkFields( fields ); }
@Override protected void collect(TupleEntry tupleEntry) throws IOException { if (!tupleEntry.getFields().equals(getDeclaredFields())) { throw new IllegalArgumentException("Collected fields != declared fields: " + tupleEntry.getFields() + ", " + getDeclaredFields()); } collected.add(new TupleEntry(tupleEntry)); } };
@Override public String toString() { if( getSinkFields().equals( getSourceFields() ) ) return getClass().getSimpleName() + "[" + getSourceFields().print() + "]"; else return getClass().getSimpleName() + "[" + getSourceFields().print() + "->" + getSinkFields().print() + "]"; }
@Override public void sinkPrepare( FlowProcess<? extends Configuration> flowProcess, SinkCall<Object[], OutputCollector> sinkCall ) throws IOException { Fields found = sinkCall.getOutgoingEntry().getFields(); if( !found.equals( expectedFields ) ) throw new RuntimeException( "fields to not match, expect: " + expectedFields + ", found: " + found ); super.sinkPrepare( flowProcess, sinkCall ); }
@Override public void sink( FlowProcess<? extends Configuration> flowProcess, SinkCall<Object[], OutputCollector> sinkCall ) throws IOException { Fields found = sinkCall.getOutgoingEntry().getFields(); if( !found.equals( expectedFields ) ) throw new RuntimeException( "fields to not match, expect: " + expectedFields + ", found: " + found ); super.sink( flowProcess, sinkCall ); } }
@Override public void sinkPrepare( FlowProcess<? extends Configuration> flowProcess, SinkCall<Object[], OutputCollector> sinkCall ) throws IOException { Fields found = sinkCall.getOutgoingEntry().getFields(); if( !found.equals( expectedFields ) ) throw new RuntimeException( "fields to not match, expect: " + expectedFields + ", found: " + found ); super.sinkPrepare( flowProcess, sinkCall ); }
@Override public void sink( FlowProcess<? extends Configuration> flowProcess, SinkCall<Object[], OutputCollector> sinkCall ) throws IOException { Fields found = sinkCall.getOutgoingEntry().getFields(); if( !found.equals( expectedFields ) ) throw new RuntimeException( "fields to not match, expect: " + expectedFields + ", found: " + found ); super.sink( flowProcess, sinkCall ); } }
/** * Method add inserts the given {@link TupleEntry} into the outgoing stream. Note the method {@link #add(Tuple)} is * more efficient as it simply calls {@link TupleEntry#getTuple()}; * <p> * See {@link cascading.tuple.TupleEntryCollector} on when and how to re-use a Tuple instance. * * @param tupleEntry of type TupleEntry */ public void add( TupleEntry tupleEntry ) { Fields expectedFields = this.tupleEntry.getFields(); TupleEntry outgoingEntry = this.tupleEntry; if( expectedFields.isUnknown() || expectedFields.equals( tupleEntry.getFields() ) ) outgoingEntry = tupleEntry; else outgoingEntry.setTuple( selectTupleFrom( tupleEntry, expectedFields ) ); safeCollect( outgoingEntry ); }
public void start( FlowProcess flowProcess, AggregatorCall aggregatorCall ) { if( groupFields == null ) return; if( !groupFields.equals( aggregatorCall.getGroup().getFields() ) ) throw new RuntimeException( "fields do not match: " + groupFields.print() + " != " + aggregatorCall.getGroup().getFields().print() ); }