Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 581CD200B66 for ; Thu, 18 Aug 2016 15:09:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 56A93160ABF; Thu, 18 Aug 2016 13:09:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9EA0D160AAB for ; Thu, 18 Aug 2016 15:09:21 +0200 (CEST) Received: (qmail 49346 invoked by uid 500); 18 Aug 2016 13:09:20 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 49333 invoked by uid 99); 18 Aug 2016 13:09:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Aug 2016 13:09:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7C3C22C0003 for ; Thu, 18 Aug 2016 13:09:20 +0000 (UTC) Date: Thu, 18 Aug 2016 13:09:20 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-4329) Fix Streaming File Source Timestamps/Watermarks Handling MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 18 Aug 2016 13:09:22 -0000 [ https://issues.apache.org/jira/browse/FLINK-4329?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15426400#comment-15426400 ] ASF GitHub Bot commented on FLINK-4329: --------------------------------------- Github user rmetzger commented on a diff in the pull request: https://github.com/apache/flink/pull/2350#discussion_r75303846 --- Diff: flink-fs-tests/src/test/java/org/apache/flink/hdfstests/ContinuousFileMonitoringTest.java --- @@ -106,6 +109,140 @@ public static void destroyHDFS() { // TESTS @Test + public void testFileReadingOperatorWithIngestionTime() throws Exception { + Set filesCreated = new HashSet<>(); + Map expectedFileContents = new HashMap<>(); + for(int i = 0; i < NO_OF_FILES; i++) { + Tuple2 file = fillWithData(hdfsURI, "file", i, "This is test line."); + filesCreated.add(file.f0); + expectedFileContents.put(i, file.f1); + } + + TextInputFormat format = new TextInputFormat(new Path(hdfsURI)); + TypeInformation typeInfo = TypeExtractor.getInputFormatTypes(format); + + ContinuousFileReaderOperator reader = new ContinuousFileReaderOperator<>(format); + + StreamConfig streamConfig = new StreamConfig(new Configuration()); + streamConfig.setTimeCharacteristic(TimeCharacteristic.IngestionTime); + + ExecutionConfig executionConfig = new ExecutionConfig(); + executionConfig.setAutoWatermarkInterval(100); + + TestTimeServiceProvider timeServiceProvider = new TestTimeServiceProvider(); + OneInputStreamOperatorTestHarness tester = + new OneInputStreamOperatorTestHarness<>(reader, executionConfig, timeServiceProvider, streamConfig); + + reader.setOutputType(typeInfo, new ExecutionConfig()); + tester.open(); + + timeServiceProvider.setCurrentTime(0); + + long elementTimestamp = 201; + timeServiceProvider.setCurrentTime(elementTimestamp); + + // test that a watermark is actually emitted + Assert.assertTrue(tester.getOutput().size() == 1 && + tester.getOutput().peek() instanceof Watermark && + ((Watermark) tester.getOutput().peek()).getTimestamp() == 200); --- End diff -- You don't need to change it, but I think it's a good idea to test the conditions independently. This allows you to see which condition was false, based on the line number. > Fix Streaming File Source Timestamps/Watermarks Handling > -------------------------------------------------------- > > Key: FLINK-4329 > URL: https://issues.apache.org/jira/browse/FLINK-4329 > Project: Flink > Issue Type: Bug > Components: Streaming Connectors > Affects Versions: 1.1.0 > Reporter: Aljoscha Krettek > Assignee: Kostas Kloudas > Fix For: 1.1.1 > > > The {{ContinuousFileReaderOperator}} does not correctly deal with watermarks, i.e. they are just passed through. This means that when the {{ContinuousFileMonitoringFunction}} closes and emits a {{Long.MAX_VALUE}} that watermark can "overtake" the records that are to be emitted in the {{ContinuousFileReaderOperator}}. Together with the new "allowed lateness" setting in window operator this can lead to elements being dropped as late. > Also, {{ContinuousFileReaderOperator}} does not correctly assign ingestion timestamps since it is not technically a source but looks like one to the user. -- This message was sent by Atlassian JIRA (v6.3.4#6332)