public Object getNextElement() throws IOException { return readType( readToken() ); }
public Object getNextElement() throws IOException { return readType( readToken() ); }
@Override public int compare( HadoopTupleInputStream lhsStream, HadoopTupleInputStream rhsStream ) { try { InputStream lhs = lhsStream.getInputStream(); InputStream rhs = rhsStream.getInputStream(); if( !type.isPrimitive() ) { int lhsToken = lhsStream.readToken(); int rhsToken = rhsStream.readToken(); lhs = lhsToken == 0 ? null : lhs; rhs = rhsToken == 0 ? null : rhs; } return comparator.compare( lhs, rhs ); } catch( Exception exception ) { throw new CascadingException( "unable to compare Tuples, likely a CoGroup is being attempted on fields of " + "different types or custom comparators are incorrectly set on Fields", exception ); } } }
@Override public int compare( HadoopTupleInputStream lhsStream, HadoopTupleInputStream rhsStream ) { try { InputStream lhs = lhsStream.getInputStream(); InputStream rhs = rhsStream.getInputStream(); if( !type.isPrimitive() ) { int lhsToken = lhsStream.readToken(); int rhsToken = rhsStream.readToken(); lhs = lhsToken == 0 ? null : lhs; rhs = rhsToken == 0 ? null : rhs; } return comparator.compare( lhs, rhs ); } catch( Exception exception ) { throw new CascadingException( "unable to compare Tuples, likely a CoGroup is being attempted on fields of " + "different types or custom comparators are incorrectly set on Fields", exception ); } } }
@Override public int compare( HadoopTupleInputStream lhsStream, HadoopTupleInputStream rhsStream ) { try { // pop off element type, its assumed we know it as we have a stream comparator // to delegate too int lhsToken = lhsStream.readToken(); int rhsToken = rhsStream.readToken(); if( lhsToken == HadoopTupleOutputStream.WRITABLE_TOKEN ) lhsStream.readString(); if( rhsToken == HadoopTupleOutputStream.WRITABLE_TOKEN ) rhsStream.readString(); InputStream lhs = lhsToken == 0 ? null : lhsStream.getInputStream(); InputStream rhs = rhsToken == 0 ? null : rhsStream.getInputStream(); return comparator.compare( lhs, rhs ); } catch( Exception exception ) { throw new CascadingException( "unable to compare Tuples, likely a CoGroup is being attempted on fields of " + "different types or custom comparators are incorrectly set on Fields", exception ); } } }
@Override public int compare( HadoopTupleInputStream lhsStream, HadoopTupleInputStream rhsStream ) { try { // pop off element type, its assumed we know it as we have a stream comparator // to delegate too int lhsToken = lhsStream.readToken(); int rhsToken = rhsStream.readToken(); if( lhsToken == HadoopTupleOutputStream.WRITABLE_TOKEN ) lhsStream.readString(); if( rhsToken == HadoopTupleOutputStream.WRITABLE_TOKEN ) rhsStream.readString(); InputStream lhs = lhsToken == 0 ? null : lhsStream.getInputStream(); InputStream rhs = rhsToken == 0 ? null : rhsStream.getInputStream(); return comparator.compare( lhs, rhs ); } catch( Exception exception ) { throw new CascadingException( "unable to compare Tuples, likely a CoGroup is being attempted on fields of " + "different types or custom comparators are incorrectly set on Fields", exception ); } } }