@Test( expected = IllegalArgumentException.class ) public void shouldNotCreatePartitionedStatefulRegionWithIncompatibleInputFields () { when( operatorDef0.getOperatorType() ).thenReturn( STATELESS ); when( operatorDef1.getOperatorType() ).thenReturn( PARTITIONED_STATEFUL ); when( operatorDef2.getOperatorType() ).thenReturn( PARTITIONED_STATEFUL ); when( operatorDef0.getInputPortCount() ).thenReturn( 1 ); when( operatorDef1.getInputPortCount() ).thenReturn( 1 ); when( operatorDef2.getInputPortCount() ).thenReturn( 2 ); final RuntimeSchemaField field0 = new RuntimeSchemaField( "key", Number.class ); final RuntimeSchemaField field1 = new RuntimeSchemaField( "key", Integer.class ); final RuntimeSchemaField field2 = new RuntimeSchemaField( "key", Number.class ); final PortRuntimeSchema operator0PortSchema0 = new PortRuntimeSchema( singletonList( field0 ) ); final PortRuntimeSchema operator1PortSchema0 = new PortRuntimeSchema( singletonList( field1 ) ); final PortRuntimeSchema operator2PortSchema0 = new PortRuntimeSchema( singletonList( field1 ) ); final PortRuntimeSchema operator2PortSchema1 = new PortRuntimeSchema( singletonList( field2 ) ); final OperatorRuntimeSchema operator0Schema = mock( OperatorRuntimeSchema.class ); final OperatorRuntimeSchema operator1Schema = mock( OperatorRuntimeSchema.class ); final OperatorRuntimeSchema operator2Schema = mock( OperatorRuntimeSchema.class ); when( operatorDef0.getSchema() ).thenReturn( operator0Schema ); when( operatorDef1.getSchema() ).thenReturn( operator1Schema ); when( operatorDef2.getSchema() ).thenReturn( operator2Schema ); when( operator0Schema.getInputPortCount() ).thenReturn( 1 ); when( operator0Schema.getInputSchema( 0 ) ).thenReturn( operator0PortSchema0 ); when( operator1Schema.getInputPortCount() ).thenReturn( 1 ); when( operator1Schema.getInputSchema( 0 ) ).thenReturn( operator1PortSchema0 ); when( operator2Schema.getInputPortCount() ).thenReturn( 2 ); when( operator2Schema.getInputSchema( 0 ) ).thenReturn( operator2PortSchema0 ); when( operator2Schema.getInputSchema( 1 ) ).thenReturn( operator2PortSchema1 ); when( operatorDef1.getPartitionFieldNames() ).thenReturn( singletonList( "key" ) ); when( operatorDef2.getPartitionFieldNames() ).thenReturn( singletonList( "key" ) ); new RegionDef( 0, PARTITIONED_STATEFUL, singletonList( "key" ), asList( operatorDef0, operatorDef1, operatorDef2 ) ); }
public List<String> getPartitionFieldNames () { return partitionFieldNames; }
RegionDef { public List<String> getPartitionFieldNames () { return partitionFieldNames; } }
RegionDef { public List<String> getPartitionFieldNames () { return partitionFieldNames; } RegionDef( final int regionId,
                       final OperatorType regionType,
                       final List<String> partitionFieldNames,
                       final List<OperatorDef> operators ); }
RegionDef { public List<String> getPartitionFieldNames () { return partitionFieldNames; } RegionDef( final int regionId,
                       final OperatorType regionType,
                       final List<String> partitionFieldNames,
                       final List<OperatorDef> operators ); int indexOf( final OperatorDef operator ); int getRegionId(); OperatorType getRegionType(); List<String> getPartitionFieldNames(); int getForwardedKeySize(); OperatorDef getOperator( final int index ); List<OperatorDef> getOperators(); int getOperatorCount(); boolean isSource(); @Override boolean equals( final Object o ); @Override int hashCode(); @Override String toString(); }
RegionDef { public List<String> getPartitionFieldNames () { return partitionFieldNames; } RegionDef( final int regionId,
                       final OperatorType regionType,
                       final List<String> partitionFieldNames,
                       final List<OperatorDef> operators ); int indexOf( final OperatorDef operator ); int getRegionId(); OperatorType getRegionType(); List<String> getPartitionFieldNames(); int getForwardedKeySize(); OperatorDef getOperator( final int index ); List<OperatorDef> getOperators(); int getOperatorCount(); boolean isSource(); @Override boolean equals( final Object o ); @Override int hashCode(); @Override String toString();  }