/** * Compares using the target steps and copy, not the source. * That way, re-partitioning is always done in the same way. */ @Override public int compareTo( RowSet rowSet ) { lock.readLock().lock(); String target; try { target = remoteSlaveServerName + "." + destinationStepName + "." + destinationStepCopy.intValue(); } finally { lock.readLock().unlock(); } String comp = rowSet.getRemoteSlaveServerName() + "." + rowSet.getDestinationStepName() + "." + rowSet.getDestinationStepCopy(); return target.compareTo( comp ); }
/** * Finds the RowSet between two steps (or copies of steps). * * @param from the name of the "from" step * @param fromcopy the copy number of the "from" step * @param to the name of the "to" step * @param tocopy the copy number of the "to" step * @return the row set, or null if none found */ public RowSet findRowSet( String from, int fromcopy, String to, int tocopy ) { // Start with the transformation. for ( int i = 0; i < rowsets.size(); i++ ) { RowSet rs = rowsets.get( i ); if ( rs.getOriginStepName().equalsIgnoreCase( from ) && rs.getDestinationStepName().equalsIgnoreCase( to ) && rs .getOriginStepCopy() == fromcopy && rs.getDestinationStepCopy() == tocopy ) { return rs; } } return null; }
if ( rs.getOriginStepName().equalsIgnoreCase( from ) && rs.getDestinationStepName().equalsIgnoreCase( to ) && rs.getOriginStepCopy() == fromcopy && rs.getDestinationStepCopy() == tocopy ) { return rs;
if ( rs.getOriginStepName().equalsIgnoreCase( from ) && rs.getDestinationStepName().equalsIgnoreCase( to ) && rs.getOriginStepCopy() == fromcopy && rs.getDestinationStepCopy() == tocopy ) { return rs;
Mockito.when( rowSet.getDestinationStepName() ).thenReturn( "Validator" ); Mockito.when( rowSet.getOriginStepCopy() ).thenReturn( 0 ); Mockito.when( rowSet.getDestinationStepCopy() ).thenReturn( 0 ); Mockito.when( rowSet.getRow() ).thenReturn( new String[] { values } ).thenReturn( null ); Mockito.when( rowSet.isDone() ).thenReturn( true );
distribution.getPartition( outputRowSet.getRemoteSlaveServerName(), nextPartitionSchemaName, outputRowSet .getDestinationStepCopy() ); + outputRowSet.getRemoteSlaveServerName() + ", partition schema=" + nextStepPartitioningMeta.getPartitionSchema().getName() + ", copy=" + outputRowSet.getDestinationStepCopy() );