test_class.file: flink-contrib/flink-storm/src/test/java/org/apache/flink/storm/api/FlinkOutputFieldsDeclarerTest.java
test_class.identifier: FlinkOutputFieldsDeclarerTest
test_class.superclass: extends AbstractTest
test_case.body: @Test
  	public void testGetGroupingFieldIndexes() {
  		final int numberOfAttributes = 5 + this.r.nextInt(20);
  		final String[] attributes = new String[numberOfAttributes];
  		for (int i = 0; i < numberOfAttributes; ++i) {
  			attributes[i] = "a" + i;
  		}
  
  		final FlinkOutputFieldsDeclarer declarer = new FlinkOutputFieldsDeclarer();
  		declarer.declare(new Fields(attributes));
  
  		final int numberOfKeys = 1 + this.r.nextInt(24);
  		final LinkedList<String> groupingFields = new LinkedList<String>();
  		final boolean[] indexes = new boolean[numberOfAttributes];
  
  		for (int i = 0; i < numberOfAttributes; ++i) {
  			if (this.r.nextInt(25) < numberOfKeys) {
  				groupingFields.add(attributes[i]);
  				indexes[i] = true;
  			} else {
  				indexes[i] = false;
  			}
  		}
  
  		final int[] expectedResult = new int[groupingFields.size()];
  		int j = 0;
  		for (int i = 0; i < numberOfAttributes; ++i) {
  			if (indexes[i]) {
  				expectedResult[j++] = i;
  			}
  		}
  
  		final int[] result = declarer.getGroupingFieldIndexes(Utils.DEFAULT_STREAM_ID,
  				groupingFields);
  
  		Assert.assertEquals(expectedResult.length, result.length);
  		for (int i = 0; i < expectedResult.length; ++i) {
  			Assert.assertEquals(expectedResult[i], result[i]);
  		}
  	}
test_case.class_method_signature: FlinkOutputFieldsDeclarerTest.testGetGroupingFieldIndexes()
test_case.full_signature: @Test public void testGetGroupingFieldIndexes()
test_case.identifier: testGetGroupingFieldIndexes
test_case.invocations: nextInt declare nextInt nextInt add size getGroupingFieldIndexes assertEquals assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetGroupingFieldIndexes()
focal_class.declarator: outputStreams = new HashMap<String, Fields>()
focal_class.modifier: final
focal_class.original_string: final HashMap<String, Fields> outputStreams = new HashMap<String, Fields>();
focal_class.type: HashMap<String, Fields>
focal_class.var_name: outputStreams
focal_class.file: flink-contrib/flink-storm/src/main/java/org/apache/flink/storm/api/FlinkOutputFieldsDeclarer.java
focal_class.identifier: FlinkOutputFieldsDeclarer
focal_class.interfaces: implements OutputFieldsDeclarer
focal_class.class_method_signature: FlinkOutputFieldsDeclarer.declare(final Fields fields)
focal_class.full_signature: @Override public void declare(final Fields fields)
focal_class.identifier: declare
focal_class.modifiers: @Override public
focal_class.parameters: (final Fields fields)
focal_class.return: void
focal_class.signature: void declare(final Fields fields)
focal_class.class_method_signature: FlinkOutputFieldsDeclarer.declare(final boolean direct, final Fields fields)
focal_class.full_signature: @Override public void declare(final boolean direct, final Fields fields)
focal_class.identifier: declare
focal_class.modifiers: @Override public
focal_class.parameters: (final boolean direct, final Fields fields)
focal_class.return: void
focal_class.signature: void declare(final boolean direct, final Fields fields)
focal_class.class_method_signature: FlinkOutputFieldsDeclarer.declareStream(final String streamId, final Fields fields)
focal_class.full_signature: @Override public void declareStream(final String streamId, final Fields fields)
focal_class.identifier: declareStream
focal_class.modifiers: @Override public
focal_class.parameters: (final String streamId, final Fields fields)
focal_class.return: void
focal_class.signature: void declareStream(final String streamId, final Fields fields)
focal_class.class_method_signature: FlinkOutputFieldsDeclarer.declareStream(final String streamId, final boolean direct, final Fields fields)
focal_class.full_signature: @Override public void declareStream(final String streamId, final boolean direct, final Fields fields)
focal_class.identifier: declareStream
focal_class.modifiers: @Override public
focal_class.parameters: (final String streamId, final boolean direct, final Fields fields)
focal_class.return: void
focal_class.signature: void declareStream(final String streamId, final boolean direct, final Fields fields)
focal_class.class_method_signature: FlinkOutputFieldsDeclarer.getOutputType(final String streamId)
focal_class.full_signature:  TypeInformation<Tuple> getOutputType(final String streamId)
focal_class.identifier: getOutputType
focal_class.parameters: (final String streamId)
focal_class.return: TypeInformation<Tuple>
focal_class.signature: TypeInformation<Tuple> getOutputType(final String streamId)
focal_class.class_method_signature: FlinkOutputFieldsDeclarer.getGroupingFieldIndexes(final String streamId, final List<String> groupingFields)
focal_class.full_signature:  int[] getGroupingFieldIndexes(final String streamId, final List<String> groupingFields)
focal_class.identifier: getGroupingFieldIndexes
focal_class.parameters: (final String streamId, final List<String> groupingFields)
focal_class.return: int[]
focal_class.signature: int[] getGroupingFieldIndexes(final String streamId, final List<String> groupingFields)
focal_method.body: int[] getGroupingFieldIndexes(final String streamId, final List<String> groupingFields) {
  		final int[] fieldIndexes = new int[groupingFields.size()];
  
  		for (int i = 0; i < fieldIndexes.length; ++i) {
  			fieldIndexes[i] = this.outputStreams.get(streamId).fieldIndex(groupingFields.get(i));
  		}
  
  		return fieldIndexes;
  	}
focal_method.class_method_signature: FlinkOutputFieldsDeclarer.getGroupingFieldIndexes(final String streamId, final List<String> groupingFields)
focal_method.full_signature:  int[] getGroupingFieldIndexes(final String streamId, final List<String> groupingFields)
focal_method.identifier: getGroupingFieldIndexes
focal_method.invocations: size fieldIndex get get
focal_method.parameters: (final String streamId, final List<String> groupingFields)
focal_method.return: int[]
focal_method.signature: int[] getGroupingFieldIndexes(final String streamId, final List<String> groupingFields)