richardstartin commented on a change in pull request #8364: URL: https://github.com/apache/pinot/pull/8364#discussion_r829480330
########## File path: pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/creator/TransformPipelineTest.java ########## @@ -25,18 +25,16 @@ import org.testng.Assert; import org.testng.annotations.Test; -import static org.apache.pinot.core.data.manager.realtime.Fixtures.*; Review comment: removing this static import doesn't improve this class ########## File path: pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/impl/SegmentIndexCreationDriverImpl.java ########## @@ -212,40 +209,23 @@ public void build() _recordReader.rewind(); LOGGER.info("Start building IndexCreator!"); GenericRow reuse = new GenericRow(); + TransformPipeline.Result reusedResult = new TransformPipeline.Result(); while (_recordReader.hasNext()) { long recordReadStartTime = System.currentTimeMillis(); long recordReadStopTime; long indexStopTime; reuse.clear(); GenericRow decodedRow = _recordReader.next(reuse); - if (_complexTypeTransformer != null) { - // TODO: consolidate complex type transformer into composite type transformer - decodedRow = _complexTypeTransformer.transform(decodedRow); - } - if (decodedRow.getValue(GenericRow.MULTIPLE_RECORDS_KEY) != null) { - recordReadStopTime = System.currentTimeMillis(); - _totalRecordReadTime += (recordReadStopTime - recordReadStartTime); - for (Object singleRow : (Collection) decodedRow.getValue(GenericRow.MULTIPLE_RECORDS_KEY)) { - recordReadStartTime = System.currentTimeMillis(); - GenericRow transformedRow = _recordTransformer.transform((GenericRow) singleRow); - recordReadStopTime = System.currentTimeMillis(); - _totalRecordReadTime += (recordReadStopTime - recordReadStartTime); - if (transformedRow != null && IngestionUtils.shouldIngestRow(transformedRow)) { - _indexCreator.indexRow(transformedRow); - indexStopTime = System.currentTimeMillis(); - _totalIndexTime += (indexStopTime - recordReadStopTime); - } - } - } else { - GenericRow transformedRow = _recordTransformer.transform(decodedRow); - recordReadStopTime = System.currentTimeMillis(); - _totalRecordReadTime += (recordReadStopTime - recordReadStartTime); - if (transformedRow != null && IngestionUtils.shouldIngestRow(transformedRow)) { - _indexCreator.indexRow(transformedRow); - indexStopTime = System.currentTimeMillis(); - _totalIndexTime += (indexStopTime - recordReadStopTime); - } + recordReadStartTime = System.currentTimeMillis(); + _transformPipeline.processRow(decodedRow, reusedResult); Review comment: 👍🏻 ########## File path: pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/Fixtures.java ########## @@ -35,8 +33,8 @@ private Fixtures() { public static final int MAX_ROWS_IN_SEGMENT = 250000; public static final long MAX_TIME_FOR_SEGMENT_CLOSE_MS = 64368000L; public static final String TOPIC_NAME = "someTopic"; - public static final String CONSUMER_FACTORY_CLASS = FakeStreamConsumerFactory.class.getName(); - public static final String MESSAGE_DECODER_CLASS = FakeStreamMessageDecoder.class.getName(); + public static final String CONSUMER_FACTORY_CLASS = "some.consumer.factory.class"; + public static final String MESSAGE_DECODER_CLASS = "some.message.decoder.class"; Review comment: why does this need to change? ########## File path: pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/creator/TransformPipelineTest.java ########## @@ -25,18 +25,16 @@ import org.testng.Assert; import org.testng.annotations.Test; -import static org.apache.pinot.core.data.manager.realtime.Fixtures.*; Review comment: I'm not too keen on automatic IDE actions, this and others are completely unrelated to the change in this PR which will clutter up the git history ########## File path: pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/creator/Fixtures.java ########## @@ -67,8 +65,8 @@ private Fixtures() { + " \"stream.fakeStream.broker.list\":\"broker:7777\"," + " \"stream.fakeStream.consumer.prop.auto.offset.reset\":\"smallest\"," + " \"stream.fakeStream.consumer.type\":\"simple\"," - + " \"stream.fakeStream.consumer.factory.class.name\":\"" + CONSUMER_FACTORY_CLASS + "\"," - + " \"stream.fakeStream.decoder.class.name\":\"" + MESSAGE_DECODER_CLASS + "\"," + + " \"stream.fakeStream.consumer.factory.class.name\":\"" + CONSUMER_FACTORY_CLASS_FORMATTER + "\"," + + " \"stream.fakeStream.decoder.class.name\":\"" + MESSAGE_DECODER_CLASS_FORMATTER + "\"," Review comment: Just embed the "%s" directly here? ```java public static final String CONSUMER_FACTORY_CLASS_FORMATTER = "%s"; public static final String MESSAGE_DECODER_CLASS_FORMATTER = "%s"; ``` looks weird -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org