# IMPORTANT: Source Code Access
**Local source files are not present.** Your workspace does not contain source code. You **MUST** use Sourcegraph MCP tools to discover, read, and understand code before making any changes.
**Target Repositories (version-pinned mirrors):**
- `github.com/sg-evals/camel--1006f047` — use `repo:^github.com/sg-evals/camel--1006f047$` filter
- `github.com/sg-evals/flink--0cc95fcc` — use `repo:^github.com/sg-evals/flink--0cc95fcc$` filter
- `github.com/sg-evals/kafka--0753c489` — use `repo:^github.com/sg-evals/kafka--0753c489$` filter
Scope ALL keyword_search/nls_search queries to these repos.
Use the repo name as the `repo` parameter for read_file/go_to_definition/find_references.
## Required Workflow
1. **Search first** — Use MCP tools to find relevant files and understand existing patterns
2. **Read remotely** — Use `sg_read_file` to read full file contents from Sourcegraph
3. **Edit locally** — Use Edit, Write, and Bash to create or modify files in your working directory
4. **Verify locally** — Run tests with Bash to check your changes
5. **Produce answer.json** — After completing your edits, also write `/workspace/answer.json` summarizing your work:
```json
{
"analysis": {
"summary": "Brief description of your approach",
"files_examined": [{"path": "file.ext", "description": "..."}],
"reasoning": "Detailed explanation or analysis"
},
"changes": [
{"file": "path.ext", "description": "...", "diff": "unified diff"}
]
}
```
Include `changes` with unified diffs for every file you modified. For analysis-only tasks, omit `changes` and focus on `analysis`.
## Tool Selection
| Goal | Tool |
|------|------|
| Exact symbol/string | `sg_keyword_search` |
| Concepts/semantic search | `sg_nls_search` |
| Trace usage/callers | `sg_find_references` |
| See implementation | `sg_go_to_definition` |
| Read full file | `sg_read_file` |
| Browse structure | `sg_list_files` |
| Find repos | `sg_list_repos` |
| Search commits | `sg_commit_search` |
| Track changes | `sg_diff_search` |
| Compare versions | `sg_compare_revisions` |
**Decision logic:**
1. Know the exact symbol? → `sg_keyword_search`
2. Know the concept, not the name? → `sg_nls_search`
3. Need definition of a symbol? → `sg_go_to_definition`
4. Need all callers/references? → `sg_find_references`
5. Need full file content? → `sg_read_file`
## Scoping (Always Do This)
```
repo:^github.com/ORG/REPO$ # Exact repo (preferred)
repo:github.com/ORG/ # All repos in org
file:.*\.ts$ # TypeScript only
file:src/api/ # Specific directory
```
Start narrow. Expand only if results are empty.
## Efficiency Rules
- Chain searches logically: search → read → references → definition
- Don't re-search for the same pattern; use results from prior calls
- Prefer `sg_keyword_search` over `sg_nls_search` when you have exact terms
- Read 2-3 related files before synthesising, rather than one at a time
- Don't read 20+ remote files without writing code — once you understand the pattern, start implementing
## If Stuck
If MCP search returns no results:
1. Broaden the search query (synonyms, partial identifiers)
2. Try `sg_nls_search` for semantic matching
3. Use `sg_list_files` to browse the directory structure
4. Use `sg_list_repos` to verify the repository name
---
**Sourcegraph Repositories:** `github.com/sg-evals/camel--1006f047`, `github.com/sg-evals/flink--0cc95fcc`, `github.com/sg-evals/kafka--0753c489`
# IMPORTANT: Source Code Access
**Local source files are not present.** Your workspace does not contain source code. You **MUST** use Sourcegraph MCP tools to discover, read, and understand code before making any changes.
**Target Repositories (version-pinned mirrors):**
- `github.com/sg-evals/camel--1006f047` — use `repo:^github.com/sg-evals/camel--1006f047$` filter
- `github.com/sg-evals/flink--0cc95fcc` — use `repo:^github.com/sg-evals/flink--0cc95fcc$` filter
- `github.com/sg-evals/kafka--0753c489` — use `repo:^github.com/sg-evals/kafka--0753c489$` filter
Scope ALL keyword_search/nls_search queries to these repos.
Use the repo name as the `repo` parameter for read_file/go_to_definition/find_references.
## Required Workflow
1. **Search first** — Use MCP tools to find relevant files and understand existing patterns
2. **Read remotely** — Use `sg_read_file` to read full file contents from Sourcegraph
3. **Edit locally** — Use Edit, Write, and Bash to create or modify files in your working directory
4. **Verify locally** — Run tests with Bash to check your changes
## Tool Selection
| Goal | Tool |
|------|------|
| Exact symbol/string | `sg_keyword_search` |
| Concepts/semantic search | `sg_nls_search` |
| Trace usage/callers | `sg_find_references` |
| See implementation | `sg_go_to_definition` |
| Read full file | `sg_read_file` |
| Browse structure | `sg_list_files` |
| Find repos | `sg_list_repos` |
| Search commits | `sg_commit_search` |
| Track changes | `sg_diff_search` |
| Compare versions | `sg_compare_revisions` |
**Decision logic:**
1. Know the exact symbol? → `sg_keyword_search`
2. Know the concept, not the name? → `sg_nls_search`
3. Need definition of a symbol? → `sg_go_to_definition`
4. Need all callers/references? → `sg_find_references`
5. Need full file content? → `sg_read_file`
## Scoping (Always Do This)
```
repo:^github.com/ORG/REPO$ # Exact repo (preferred)
repo:github.com/ORG/ # All repos in org
file:.*\.ts$ # TypeScript only
file:src/api/ # Specific directory
```
Start narrow. Expand only if results are empty.
## Efficiency Rules
- Chain searches logically: search → read → references → definition
- Don't re-search for the same pattern; use results from prior calls
- Prefer `sg_keyword_search` over `sg_nls_search` when you have exact terms
- Read 2-3 related files before synthesising, rather than one at a time
- Don't read 20+ remote files without writing code — once you understand the pattern, start implementing
## If Stuck
If MCP search returns no results:
1. Broaden the search query (synonyms, partial identifiers)
2. Try `sg_nls_search` for semantic matching
3. Use `sg_list_files` to browse the directory structure
4. Use `sg_list_repos` to verify the repository name
---
**Sourcegraph Repositories:** `github.com/sg-evals/camel--1006f047`, `github.com/sg-evals/flink--0cc95fcc`, `github.com/sg-evals/kafka--0753c489`
# Flink DataStream API Deprecation Markers
## Your Task
Find all Java source files in apache/flink under flink-streaming-java/src/ that contain @Deprecated annotations on DataStream API classes or methods. For each deprecated class, identify the class name and the recommended replacement (noted in the deprecation javadoc). Focus on deprecated source functions, sink functions, timestamp extractors, and I/O format classes.
## Context
You are working on a codebase task involving repos from the migration domain.
## Available Resources
The local `/workspace/` directory contains: sg-evals/kafka--0753c489, sg-evals/flink--0cc95fcc, sg-evals/camel--1006f047.
## Output Format
Create a file at `/workspace/answer.json` with your findings in the following structure:
```json
{
"files": [
{"repo": "org/repo-name", "path": "relative/path/to/file.go"}
],
"symbols": [
{"repo": "org/repo-name", "path": "relative/path/to/file.go", "symbol": "SymbolName"}
],
"chain": [
{"repo": "org/repo-name", "path": "relative/path/to/file.go", "symbol": "FunctionName"}
],
"text": "Narrative explanation of your findings, citing repos and file paths."
}
```
Include only the fields relevant to this task. Your answer is evaluated against a closed-world oracle — completeness matters.
## Evaluation
Your answer will be scored on:
- **File recall and precision**: Did you find all relevant files?
## COVERAGE REQUIREMENTS — Do Not Write answer.json Too Early
Before writing `answer.json`, you **must** verify coverage across all major
subsystems named in the task.
**Minimum workflow:**
1. **Enumerate** — Search for all relevant directories and files across the codebase.
2. **Read** — Read representative implementation files for each subsystem.
3. **Extract** — Extract the key symbols required by the task (not just file paths).
4. **Gap check** — List any providers, services, or middleware layers mentioned in
the task that are NOT yet backed by a concrete file read. If any gaps exist,
search for them before proceeding.
5. **Only then** write `answer.json`.
Do not stop after finding a plausible initial set of paths. The task rewards
**broad, complete coverage** of required files and symbols.
## PRE-TEST SANITY CHECK
Before running tests, perform this check:
1. List every file you have modified or created.
2. For each file, state in one sentence why it is necessary for the task.
3. If any file is unrelated to the stated task, **do not write it** (or revert
if already written).
Use MCP for discovery and confirmation. Use local repo state only for narrow
patching logic. Do not use `sg_read_file` output as a template to copy wholesale
into the workspace.
| Tool | Calls |
|---|---|
mcp__sourcegraph__sg_list_files | 13 |
mcp__sourcegraph__sg_keyword_search | 9 |
mcp__sourcegraph__sg_read_file | 9 |
ToolSearch | 2 |
Write | 1 |
| # | Timestamp | Type | Subtype | Tool | Text |
|---|---|---|---|---|---|
| 1 | - | system | init | - | |
| 2 | - | system | thinking_tokens | - | |
| 3 | - | system | thinking_tokens | - | |
| 4 | - | system | thinking_tokens | - | |
| 5 | - | assistant | text | - | I'll search for deprecated DataStream API classes and methods in the Flink repository's flink-streaming-java/src/ directory. |
| 6 | - | assistant | tool_use | ToolSearch | |
| 7 | 2026-06-12T16:13:05.838Z | user | tool_result | ToolSearch | {"matches": ["mcp__sourcegraph__sg_keyword_search", "mcp__sourcegraph__sg_list_files"], "query": "select:mcp__sourcegraph__sg_keyword_search,mcp__sourcegraph__sg_list_files", "total_deferred_tools": 33} |
| 8 | - | system | thinking_tokens | - | |
| 9 | - | system | thinking_tokens | - | |
| 10 | - | system | thinking_tokens | - | |
| 11 | - | assistant | tool_use | mcp__sourcegraph__sg_list_files | |
| 12 | 2026-06-12T16:13:09.079Z | user | tool_result | mcp__sourcegraph__sg_list_files | {"text":"flink-streaming-java/src/main/\nflink-streaming-java/src/test/\n"} |
| 13 | - | assistant | tool_use | mcp__sourcegraph__sg_keyword_search | |
| 14 | 2026-06-12T16:13:09.753Z | user | tool_result | mcp__sourcegraph__sg_keyword_search | {"text":"# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextInputFormat.java\n32: *\n33: * @deprecated If you want to read/write data from/to text file, please use FLIP-27 FileSource and\n34: * Sink-V2 FlinkSink. This class should be removed if we drop the supports for read/write via\n35: \n36: */\n37: @Deprecated\n38: @PublicEvolving\n39: \n\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextOutputFormat.java\n36: *\n37: * @deprecated If you want to read/write data from/to text file, please use FLIP-27 FileSource and\n38: * Sink-V2 FlinkSink. This class should be removed if we drop all supports for {@link\n39: \n41: */\n42: @Deprecated\n43: @PublicEvolving\n44: \n\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/StreamTaskTestHarness.java\n97: *\n98: * @deprecated Please use {@link StreamTaskMailboxTestHarness} and {@link\n99: * StreamTaskMailboxTestHarnessBuilder}. Do not add new code using this test harness.\n100: \n100: */\n101: @Deprecated\n102: public class StreamTaskTestHarness<OUT> {\n103: \n\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/DiscardingSink.java\n27: * @param <T> The type of elements received by the sink.\n28: * @deprecated This interface will be removed in future versions. Use the new {@link\n29: * org.apache.flink.streaming.api.functions.sink.v2.DiscardingSink} interface instead.\n30: \n\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/OneInputStreamTaskTestHarness.java\n52: *\n53: * @deprecated Please use {@link StreamTaskMailboxTestHarness} and {@link\n54: * StreamTaskMailboxTestHarnessBuilder}. Do not add new code using this test harness.\n55: \n55: */\n56: @Deprecated\n57: public class OneInputStreamTaskTestHarness<IN, OUT> extends StreamTaskTestHarness<OUT> {\n58: \n\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/TwoInputStreamTaskTestHarness.java\n52: *\n53: * @deprecated Please use {@link StreamTaskMailboxTestHarness} and {@link\n54: * StreamTaskMailboxTestHarnessBuilder}. Do not add new code using this test harness.\n55: \n55: */\n56: @Deprecated\n57: public class TwoInputStreamTaskTestHarness<IN1, IN2, OUT> extends StreamTaskTestHarness<OUT> {\n58: \n\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/DataGeneratorSource.java\n36: *\n37: * @deprecated Use {@code org.apache.flink.connector.datagen.source.DataGeneratorSource} instead.\n38: */\n39: \n\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/TwoPhaseCommitSinkFunction.java\n71: * TwoPhaseCommitSinkFunction} instance. Context is created once\n72: * @deprecated This interface will be removed in future versions. Use the new {@link\n73: * org.apache.flink.api.connector.sink2.Sink} interface instead.\n74: \n\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/AscendingTimestampExtractor.java\n36: */\n37: @Deprecated\n38: @PublicEvolving\n39: \n\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/legacy/StreamingFileSink.java\n97: * @param <IN> Type of the elements emitted by this sink\n98: * @deprecated Use {@link org.apache.flink.connector.file.sink.FileSink} instead.\n99: */\n100: \n"} |
| 15 | - | system | thinking_tokens | - | |
| 16 | - | system | thinking_tokens | - | |
| 17 | - | system | thinking_tokens | - | |
| 18 | - | system | thinking_tokens | - | |
| 19 | - | system | thinking_tokens | - | |
| 20 | - | assistant | text | - | Good initial results. Let me search more broadly across the relevant subdirectories. |
| 21 | - | assistant | tool_use | mcp__sourcegraph__sg_list_files | |
| 22 | 2026-06-12T16:13:13.797Z | user | tool_result | mcp__sourcegraph__sg_list_files | {"text":"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/lineage/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/windowing/\n"} |
| 23 | - | assistant | tool_use | mcp__sourcegraph__sg_keyword_search | |
| 24 | 2026-06-12T16:13:14.415Z | user | tool_result | mcp__sourcegraph__sg_keyword_search | {"text":"# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextInputFormat.java\n32: *\n33: * @deprecated If you want to read/write data from/to text file, please use FLIP-27 FileSource and\n34: * Sink-V2 FlinkSink. This class should be removed if we drop the supports for read/write via\n35: * input/output format in DataStream api.\n36: */\n37: @Deprecated\n38: @PublicEvolving\n39: \n"} |
| 25 | - | system | thinking_tokens | - | |
| 26 | - | system | thinking_tokens | - | |
| 27 | - | assistant | tool_use | mcp__sourcegraph__sg_list_files | |
| 28 | 2026-06-12T16:13:17.299Z | user | tool_result | mcp__sourcegraph__sg_list_files | {"text":"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/async/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/co/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/windowing/\n"} |
| 29 | - | assistant | tool_use | mcp__sourcegraph__sg_list_files | |
| 30 | 2026-06-12T16:13:17.966Z | user | tool_result | mcp__sourcegraph__sg_list_files | {"text":"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/\n"} |
| 31 | - | assistant | tool_use | mcp__sourcegraph__sg_list_files | |
| 32 | 2026-06-12T16:13:20.966Z | user | tool_result | mcp__sourcegraph__sg_list_files | {"text":"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/v2/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/PrintSink.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/SinkContextUtil.java\n"} |
| 33 | - | assistant | tool_use | mcp__sourcegraph__sg_list_files | |
| 34 | 2026-06-12T16:13:21.434Z | user | tool_result | mcp__sourcegraph__sg_list_files | {"text":"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/SerializedCheckpointData.java\n"} |
| 35 | - | assistant | tool_use | mcp__sourcegraph__sg_list_files | |
| 36 | 2026-06-12T16:13:22.445Z | user | tool_result | mcp__sourcegraph__sg_list_files | {"text":"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/AscendingTimestampExtractor.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/BoundedOutOfOrdernessTimestampExtractor.java\n"} |
| 37 | - | assistant | tool_use | mcp__sourcegraph__sg_list_files | |
| 38 | 2026-06-12T16:13:22.895Z | user | tool_result | mcp__sourcegraph__sg_list_files | {"text":"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/CollectionInputFormat.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextInputFormat.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextOutputFormat.java\n"} |
| 39 | - | assistant | tool_use | mcp__sourcegraph__sg_list_files | |
| 40 | 2026-06-12T16:13:26.811Z | user | tool_result | mcp__sourcegraph__sg_list_files | {"text":"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/DiscardingSink.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/TwoPhaseCommitSinkFunction.java\n"} |
| 41 | - | assistant | tool_use | mcp__sourcegraph__sg_list_files | |
| 42 | 2026-06-12T16:13:27.196Z | user | tool_result | mcp__sourcegraph__sg_list_files | {"text":"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/DataGenerator.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/DataGeneratorSource.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/RandomGenerator.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/SequenceGenerator.java\n"} |
| 43 | - | assistant | tool_use | mcp__sourcegraph__sg_list_files | |
| 44 | 2026-06-12T16:13:27.866Z | user | tool_result | mcp__sourcegraph__sg_list_files | {"text":"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/legacy/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/Bucket.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/BucketFactory.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/BucketLifeCycleListener.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/BucketState.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/BucketStateSerializer.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/Buckets.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/DefaultBucketFactoryImpl.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/FileLifeCycleListener.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/StreamingFileSinkHelper.java\n"} |
| 45 | - | system | thinking_tokens | - | |
| 46 | - | system | thinking_tokens | - | |
| 47 | - | system | thinking_tokens | - | |
| 48 | - | assistant | tool_use | mcp__sourcegraph__sg_list_files | |
| 49 | 2026-06-12T16:13:31.164Z | user | tool_result | mcp__sourcegraph__sg_list_files | {"text":"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/legacy/StreamingFileSink.java\n"} |
| 50 | - | assistant | tool_use | ToolSearch | |
| 51 | 2026-06-12T16:13:31.298Z | user | tool_result | ToolSearch | {"matches": ["mcp__sourcegraph__sg_read_file"], "query": "select:mcp__sourcegraph__sg_read_file", "total_deferred_tools": 33} |
| 52 | - | system | thinking_tokens | - | |
| 53 | - | system | thinking_tokens | - | |
| 54 | - | system | thinking_tokens | - | |
| 55 | - | system | thinking_tokens | - | |
| 56 | - | assistant | text | - | Now let me read all the relevant deprecated files in parallel. |
| 57 | - | assistant | tool_use | mcp__sourcegraph__sg_read_file | |
| 58 | 2026-06-12T16:13:35.793Z | user | tool_result | mcp__sourcegraph__sg_read_file | {"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/flink--0cc95fcc@031d3d0222a9018b36760a0fecf913a2359ae37c/-/blob/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/AscendingTimestampExtractor.java\n1: /*\n2: * Licensed to the Apache Software Foundation (ASF) under one\n3: * or more contributor license agreements. See the NOTICE file\n4: * distributed with this work for additional information\n5: * regarding copyright ownership. The ASF licenses this file\n6: * to you under the Apache License, Version 2.0 (the\n7: * \"License\"); you may not use this file except in compliance\n8: * with the License. You may obtain a copy of the License at\n9: *\n10: * http://www.apache.org/licenses/LICENSE-2.0\n11: *\n12: * Unless required by applicable law or agreed to in writing, software\n13: * distributed under the License is distributed on an \"AS IS\" BASIS,\n14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n15: * See the License for the specific language governing permissions and\n16: * limitations under the License.\n17: */\n18: \n19: package org.apache.flink.streaming.api.functions.timestamps;\n20: \n21: import org.apache.flink.annotation.PublicEvolving;\n22: import org.apache.flink.streaming.api.watermark.Watermark;\n23: import org.apache.flink.streaming.runtime.operators.util.WatermarkStrategyWithPeriodicWatermarks;\n24: \n25: import org.slf4j.Logger;\n26: import org.slf4j.LoggerFactory;\n27: \n28: import static java.util.Objects.requireNonNull;\n29: \n30: /**\n31: * A timestamp assigner and watermark generator for streams where timestamps are monotonously\n32: * ascending. In this case, the local watermarks for the streams are easy to generate, because they\n33: * strictly follow the timestamps.\n34: *\n35: * @param <T> The type of the elements that this function can extract timestamps from\n36: */\n37: @Deprecated\n38: @PublicEvolving\n39: public abstract class AscendingTimestampExtractor<T>\n40: implements WatermarkStrategyWithPeriodicWatermarks<T> {\n41: \n42: private static final long serialVersionUID = 1L;\n43: \n44: /** The current timestamp. */\n45: private long currentTimestamp = Long.MIN_VALUE;\n46: \n47: /** Handler that is called when timestamp monotony is violated. */\n48: private MonotonyViolationHandler violationHandler = new LoggingHandler();\n49: \n50: /**\n51: * Extracts the timestamp from the given element. The timestamp must be monotonically\n52: * increasing.\n53: *\n54: * @param element The element that the timestamp is extracted from.\n55: * @return The new timestamp.\n56: */\n57: public abstract long extractAscendingTimestamp(T element);\n58: \n59: /**\n60: * Sets the handler for violations to the ascending timestamp order.\n61: *\n62: * @param handler The violation handler to use.\n63: * @return This extractor.\n64: */\n65: public AscendingTimestampExtractor<T> withViolationHandler(MonotonyViolationHandler handler) {\n66: this.violationHandler = requireNonNull(handler);\n67: return this;\n68: }\n69: \n70: // ------------------------------------------------------------------------\n71: \n72: @Override\n73: public final long extractTimestamp(T element, long elementPrevTimestamp) {\n74: final long newTimestamp = extractAscendingTimestamp(element);\n75: if (newTimestamp >= this.currentTimestamp) {\n76: this.currentTimestamp = newTimestamp;\n77: return newTimestamp;\n78: } else {\n79: violationHandler.handleViolation(newTimestamp, this.currentTimestamp);\n80: return newTimestamp;\n81: }\n82: }\n83: \n84: @Override\n85: public final Watermark getCurrentWatermark() {\n86: return new Watermark(\n87: currentTimestamp == Long.MIN_VALUE ? Long.MIN_VALUE : currentTimestamp... |
| 59 | - | assistant | tool_use | mcp__sourcegraph__sg_read_file | |
| 60 | 2026-06-12T16:13:36.743Z | user | tool_result | mcp__sourcegraph__sg_read_file | {"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/flink--0cc95fcc@031d3d0222a9018b36760a0fecf913a2359ae37c/-/blob/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/BoundedOutOfOrdernessTimestampExtractor.java\n1: /*\n2: * Licensed to the Apache Software Foundation (ASF) under one\n3: * or more contributor license agreements. See the NOTICE file\n4: * distributed with this work for additional information\n5: * regarding copyright ownership. The ASF licenses this file\n6: * to you under the Apache License, Version 2.0 (the\n7: * \"License\"); you may not use this file except in compliance\n8: * with the License. You may obtain a copy of the License at\n9: *\n10: * http://www.apache.org/licenses/LICENSE-2.0\n11: *\n12: * Unless required by applicable law or agreed to in writing, software\n13: * distributed under the License is distributed on an \"AS IS\" BASIS,\n14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n15: * See the License for the specific language governing permissions and\n16: * limitations under the License.\n17: */\n18: \n19: package org.apache.flink.streaming.api.functions.timestamps;\n20: \n21: import org.apache.flink.streaming.api.watermark.Watermark;\n22: import org.apache.flink.streaming.runtime.operators.util.WatermarkStrategyWithPeriodicWatermarks;\n23: \n24: import java.time.Duration;\n25: \n26: /**\n27: * This is a {@link WatermarkStrategyWithPeriodicWatermarks} used to emit Watermarks that lag behind\n28: * the element with the maximum timestamp (in event time) seen so far by a fixed amount of time,\n29: * <code>\n30: * t_late</code>. This can help reduce the number of elements that are ignored due to lateness when\n31: * computing the final result for a given window, in the case where we know that elements arrive no\n32: * later than <code>t_late</code> units of time after the watermark that signals that the system\n33: * event-time has advanced past their (event-time) timestamp.\n34: */\n35: public abstract class BoundedOutOfOrdernessTimestampExtractor<T>\n36: implements WatermarkStrategyWithPeriodicWatermarks<T> {\n37: \n38: private static final long serialVersionUID = 1L;\n39: \n40: /** The current maximum timestamp seen so far. */\n41: private long currentMaxTimestamp;\n42: \n43: /** The timestamp of the last emitted watermark. */\n44: private long lastEmittedWatermark = Long.MIN_VALUE;\n45: \n46: /**\n47: * The (fixed) interval between the maximum seen timestamp seen in the records and that of the\n48: * watermark to be emitted.\n49: */\n50: private final long maxOutOfOrderness;\n51: \n52: public BoundedOutOfOrdernessTimestampExtractor(Duration maxOutOfOrderness) {\n53: if (maxOutOfOrderness.isNegative()) {\n54: throw new IllegalArgumentException(\n55: String.format(\n56: \"Tried to set the maximum allowed lateness to %s. This parameter cannot be negative.\",\n57: maxOutOfOrderness));\n58: }\n59: \n60: this.maxOutOfOrderness = maxOutOfOrderness.toMillis();\n61: this.currentMaxTimestamp = Long.MIN_VALUE + this.maxOutOfOrderness;\n62: }\n63: \n64: public long getMaxOutOfOrdernessInMillis() {\n65: return maxOutOfOrderness;\n66: }\n67: \n68: /**\n69: * Extracts the timestamp from the given element.\n70: *\n71: * @param element The element that the timestamp is extracted from.\n72: * @return The new timestamp.\n73: */\n74: public abstract long extractTimestamp(T element);\n75: \n76: @Override\n77: public final Watermark getCurrentWatermark() {\n78: // this guarantees that the watermark never goes backwards.\n79: long potentialWM = currentMaxTimestamp - maxOutOfOrderness;\n80: if (potentialWM >= lastEmittedWatermark) {\n81: lastEmi... |
| 61 | - | assistant | tool_use | mcp__sourcegraph__sg_read_file | |
| 62 | 2026-06-12T16:13:37.675Z | user | tool_result | mcp__sourcegraph__sg_read_file | {"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/flink--0cc95fcc@031d3d0222a9018b36760a0fecf913a2359ae37c/-/blob/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextInputFormat.java\n1: /*\n2: * Licensed to the Apache Software Foundation (ASF) under one\n3: * or more contributor license agreements. See the NOTICE file\n4: * distributed with this work for additional information\n5: * regarding copyright ownership. The ASF licenses this file\n6: * to you under the Apache License, Version 2.0 (the\n7: * \"License\"); you may not use this file except in compliance\n8: * with the License. You may obtain a copy of the License at\n9: *\n10: * http://www.apache.org/licenses/LICENSE-2.0\n11: *\n12: * Unless required by applicable law or agreed to in writing, software\n13: * distributed under the License is distributed on an \"AS IS\" BASIS,\n14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n15: * See the License for the specific language governing permissions and\n16: * limitations under the License.\n17: */\n18: \n19: package org.apache.flink.streaming.api.legacy.io;\n20: \n21: import org.apache.flink.annotation.PublicEvolving;\n22: import org.apache.flink.api.common.io.DelimitedInputFormat;\n23: import org.apache.flink.configuration.Configuration;\n24: import org.apache.flink.core.fs.Path;\n25: \n26: import java.io.IOException;\n27: import java.nio.charset.Charset;\n28: import java.util.Arrays;\n29: \n30: /**\n31: * Input Format that reads text files. Each line results in another element.\n32: *\n33: * @deprecated If you want to read/write data from/to text file, please use FLIP-27 FileSource and\n34: * Sink-V2 FlinkSink. This class should be removed if we drop the supports for read/write via\n35: * input/output format in DataStream api.\n36: */\n37: @Deprecated\n38: @PublicEvolving\n39: public class TextInputFormat extends DelimitedInputFormat<String> {\n40: \n41: private static final long serialVersionUID = 1L;\n42: \n43: /** Code of \\r, used to remove \\r from a line when the line ends with \\r\\n. */\n44: private static final byte CARRIAGE_RETURN = (byte) '\\r';\n45: \n46: /** Code of \\n, used to identify if \\n is used as delimiter. */\n47: private static final byte NEW_LINE = (byte) '\\n';\n48: \n49: /** The name of the charset to use for decoding. */\n50: private String charsetName = \"UTF-8\";\n51: \n52: // --------------------------------------------------------------------------------------------\n53: \n54: public TextInputFormat(Path filePath) {\n55: super(filePath, null);\n56: }\n57: \n58: // --------------------------------------------------------------------------------------------\n59: \n60: public String getCharsetName() {\n61: return charsetName;\n62: }\n63: \n64: public void setCharsetName(String charsetName) {\n65: if (charsetName == null) {\n66: throw new IllegalArgumentException(\"Charset must not be null.\");\n67: }\n68: \n69: this.charsetName = charsetName;\n70: }\n71: \n72: // --------------------------------------------------------------------------------------------\n73: \n74: @Override\n75: public void configure(Configuration parameters) {\n76: super.configure(parameters);\n77: \n78: if (charsetName == null || !Charset.isSupported(charsetName)) {\n79: throw new RuntimeException(\"Unsupported charset: \" + charsetName);\n80: }\n81: }\n82: \n83: // --------------------------------------------------------------------------------------------\n84: \n85: @Override\n86: public String readRecord(String reusable, byte[] bytes, int offset, int numBytes)\n87: throws IOException {\n88: // Check if \\n is used as delimiter and the end of this line is a \\r, then remove \\r from\n89: // the line\n90: if ... |
| 63 | - | assistant | tool_use | mcp__sourcegraph__sg_read_file | |
| 64 | 2026-06-12T16:13:38.657Z | user | tool_result | mcp__sourcegraph__sg_read_file | {"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/flink--0cc95fcc@031d3d0222a9018b36760a0fecf913a2359ae37c/-/blob/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextOutputFormat.java\n1: /*\n2: * Licensed to the Apache Software Foundation (ASF) under one\n3: * or more contributor license agreements. See the NOTICE file\n4: * distributed with this work for additional information\n5: * regarding copyright ownership. The ASF licenses this file\n6: * to you under the Apache License, Version 2.0 (the\n7: * \"License\"); you may not use this file except in compliance\n8: * with the License. You may obtain a copy of the License at\n9: *\n10: * http://www.apache.org/licenses/LICENSE-2.0\n11: *\n12: * Unless required by applicable law or agreed to in writing, software\n13: * distributed under the License is distributed on an \"AS IS\" BASIS,\n14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n15: * See the License for the specific language governing permissions and\n16: * limitations under the License.\n17: */\n18: \n19: package org.apache.flink.streaming.api.legacy.io;\n20: \n21: import org.apache.flink.annotation.PublicEvolving;\n22: import org.apache.flink.api.common.io.FileOutputFormat;\n23: import org.apache.flink.core.fs.Path;\n24: \n25: import java.io.IOException;\n26: import java.io.Serializable;\n27: import java.nio.charset.Charset;\n28: import java.nio.charset.IllegalCharsetNameException;\n29: import java.nio.charset.UnsupportedCharsetException;\n30: \n31: /**\n32: * A {@link FileOutputFormat} that writes objects to a text file.\n33: *\n34: * <p>Objects are converted to Strings using either {@link Object#toString()} or a {@link\n35: * TextFormatter}.\n36: *\n37: * @deprecated If you want to read/write data from/to text file, please use FLIP-27 FileSource and\n38: * Sink-V2 FlinkSink. This class should be removed if we drop all supports for {@link\n39: * org.apache.flink.api.common.io.InputFormat} and {@link\n40: * org.apache.flink.api.common.io.OutputFormat}\n41: */\n42: @Deprecated\n43: @PublicEvolving\n44: public class TextOutputFormat<T> extends FileOutputFormat<T> {\n45: \n46: private static final long serialVersionUID = 1L;\n47: \n48: private static final int NEWLINE = '\\n';\n49: \n50: private String charsetName;\n51: \n52: // --------------------------------------------------------------------------------------------\n53: \n54: /**\n55: * Formatter that transforms values into their {@link String} representations.\n56: *\n57: * @param <IN> type of input elements\n58: */\n59: @PublicEvolving\n60: public interface TextFormatter<IN> extends Serializable {\n61: String format(IN value);\n62: }\n63: \n64: public TextOutputFormat(Path outputPath) {\n65: this(outputPath, \"UTF-8\");\n66: }\n67: \n68: public TextOutputFormat(Path outputPath, String charset) {\n69: super(outputPath);\n70: this.charsetName = charset;\n71: }\n72: \n73: public String getCharsetName() {\n74: return charsetName;\n75: }\n76: \n77: public void setCharsetName(String charsetName)\n78: throws IllegalCharsetNameException, UnsupportedCharsetException {\n79: if (charsetName == null) {\n80: throw new NullPointerException();\n81: }\n82: \n83: if (!Charset.isSupported(charsetName)) {\n84: throw new UnsupportedCharsetException(\n85: \"The charset \" + charsetName + \" is not supported.\");\n86: }\n87: \n88: this.charsetName = charsetName;\n89: }\n90: \n91: // --------------------------------------------------------------------------------------------\n92: \n93: @Override\n94: public void writeRecord(T record) throws IOException {\n95: byte[] bytes = record.toString().getBytes(charsetName);\n96: this.stream... |
| 65 | - | assistant | tool_use | mcp__sourcegraph__sg_read_file | |
| 66 | 2026-06-12T16:13:39.642Z | user | tool_result | mcp__sourcegraph__sg_read_file | {"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/flink--0cc95fcc@031d3d0222a9018b36760a0fecf913a2359ae37c/-/blob/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/DiscardingSink.java\n1: /*\n2: * Licensed to the Apache Software Foundation (ASF) under one\n3: * or more contributor license agreements. See the NOTICE file\n4: * distributed with this work for additional information\n5: * regarding copyright ownership. The ASF licenses this file\n6: * to you under the Apache License, Version 2.0 (the\n7: * \"License\"); you may not use this file except in compliance\n8: * with the License. You may obtain a copy of the License at\n9: *\n10: * http://www.apache.org/licenses/LICENSE-2.0\n11: *\n12: * Unless required by applicable law or agreed to in writing, software\n13: * distributed under the License is distributed on an \"AS IS\" BASIS,\n14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n15: * See the License for the specific language governing permissions and\n16: * limitations under the License.\n17: */\n18: \n19: package org.apache.flink.streaming.api.functions.sink.legacy;\n20: \n21: import org.apache.flink.annotation.Internal;\n22: import org.apache.flink.api.common.SupportsConcurrentExecutionAttempts;\n23: \n24: /**\n25: * A stream sink that ignores all elements.\n26: *\n27: * @param <T> The type of elements received by the sink.\n28: * @deprecated This interface will be removed in future versions. Use the new {@link\n29: * org.apache.flink.streaming.api.functions.sink.v2.DiscardingSink} interface instead.\n30: */\n31: @Internal\n32: public class DiscardingSink<T> implements SinkFunction<T>, SupportsConcurrentExecutionAttempts {\n33: \n34: private static final long serialVersionUID = 1L;\n35: \n36: @Override\n37: public void invoke(T value) {}\n38: }\n39: "} |
| 67 | - | assistant | tool_use | mcp__sourcegraph__sg_read_file | |
| 68 | 2026-06-12T16:13:40.648Z | user | tool_result | mcp__sourcegraph__sg_read_file | {"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/flink--0cc95fcc@031d3d0222a9018b36760a0fecf913a2359ae37c/-/blob/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/TwoPhaseCommitSinkFunction.java\n1: /*\n2: * Licensed to the Apache Software Foundation (ASF) under one or more\n3: * contributor license agreements. See the NOTICE file distributed with\n4: * this work for additional information regarding copyright ownership.\n5: * The ASF licenses this file to You under the Apache License, Version 2.0\n6: * (the \"License\"); you may not use this file except in compliance with\n7: * the License. You may obtain a copy of the License at\n8: *\n9: * http://www.apache.org/licenses/LICENSE-2.0\n10: *\n11: * Unless required by applicable law or agreed to in writing, software\n12: * distributed under the License is distributed on an \"AS IS\" BASIS,\n13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n14: * See the License for the specific language governing permissions and\n15: * limitations under the License.\n16: */\n17: \n18: package org.apache.flink.streaming.api.functions.sink.legacy;\n19: \n20: import org.apache.flink.annotation.Internal;\n21: import org.apache.flink.annotation.VisibleForTesting;\n22: import org.apache.flink.api.common.state.CheckpointListener;\n23: import org.apache.flink.api.common.state.ListState;\n24: import org.apache.flink.api.common.state.ListStateDescriptor;\n25: import org.apache.flink.api.common.typeinfo.TypeHint;\n26: import org.apache.flink.api.common.typeinfo.TypeInformation;\n27: import org.apache.flink.api.common.typeutils.CompositeTypeSerializerSnapshot;\n28: import org.apache.flink.api.common.typeutils.TypeSerializer;\n29: import org.apache.flink.api.common.typeutils.TypeSerializerSnapshot;\n30: import org.apache.flink.core.memory.DataInputView;\n31: import org.apache.flink.core.memory.DataOutputView;\n32: import org.apache.flink.runtime.state.FunctionInitializationContext;\n33: import org.apache.flink.runtime.state.FunctionSnapshotContext;\n34: import org.apache.flink.streaming.api.checkpoint.CheckpointedFunction;\n35: import org.apache.flink.util.FlinkRuntimeException;\n36: \n37: import org.slf4j.Logger;\n38: import org.slf4j.LoggerFactory;\n39: \n40: import javax.annotation.Nonnull;\n41: import javax.annotation.Nullable;\n42: \n43: import java.io.IOException;\n44: import java.time.Clock;\n45: import java.util.AbstractMap;\n46: import java.util.ArrayList;\n47: import java.util.Collection;\n48: import java.util.Collections;\n49: import java.util.Iterator;\n50: import java.util.LinkedHashMap;\n51: import java.util.List;\n52: import java.util.Map;\n53: import java.util.Objects;\n54: import java.util.Optional;\n55: import java.util.stream.Stream;\n56: \n57: import static java.util.Objects.requireNonNull;\n58: import static org.apache.flink.util.Preconditions.checkArgument;\n59: import static org.apache.flink.util.Preconditions.checkNotNull;\n60: import static org.apache.flink.util.Preconditions.checkState;\n61: \n62: /**\n63: * This is a recommended base class for all of the {@link SinkFunction} that intend to implement\n64: * exactly-once semantic. It does that by implementing two phase commit algorithm on top of the\n65: * {@link CheckpointedFunction} and {@link CheckpointListener}. User should provide custom {@code\n66: * TXN} (transaction handle) and implement abstract methods handling this transaction handle.\n67: *\n68: * @param <IN> Input type for {@link SinkFunction}.\n69: * @param <TXN> Transaction to store all of the information required to handle a transaction.\n70: * @param <CONTEXT> Context that will be shared across all invocations for the given {@link\n71: * TwoPhaseCommitSinkFunction} instance. Context is created once\n72: * @deprecated This interface will be removed in future versions. Use the new {@link\n73: * org.apache.flink.api.connector.sink2.Sink} interface ins... |
| 69 | - | assistant | tool_use | mcp__sourcegraph__sg_read_file | |
| 70 | 2026-06-12T16:13:41.195Z | user | tool_result | mcp__sourcegraph__sg_read_file | {"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/flink--0cc95fcc@031d3d0222a9018b36760a0fecf913a2359ae37c/-/blob/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/legacy/StreamingFileSink.java\n1: /*\n2: * Licensed to the Apache Software Foundation (ASF) under one\n3: * or more contributor license agreements. See the NOTICE file\n4: * distributed with this work for additional information\n5: * regarding copyright ownership. The ASF licenses this file\n6: * to you under the Apache License, Version 2.0 (the\n7: * \"License\"); you may not use this file except in compliance\n8: * with the License. You may obtain a copy of the License at\n9: *\n10: * http://www.apache.org/licenses/LICENSE-2.0\n11: *\n12: * Unless required by applicable law or agreed to in writing, software\n13: * distributed under the License is distributed on an \"AS IS\" BASIS,\n14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n15: * See the License for the specific language governing permissions and\n16: * limitations under the License.\n17: */\n18: \n19: package org.apache.flink.streaming.api.functions.sink.filesystem.legacy;\n20: \n21: import org.apache.flink.annotation.Internal;\n22: import org.apache.flink.annotation.VisibleForTesting;\n23: import org.apache.flink.api.common.serialization.BulkWriter;\n24: import org.apache.flink.api.common.serialization.Encoder;\n25: import org.apache.flink.api.common.state.CheckpointListener;\n26: import org.apache.flink.core.fs.FileSystem;\n27: import org.apache.flink.core.fs.Path;\n28: import org.apache.flink.runtime.state.FunctionInitializationContext;\n29: import org.apache.flink.runtime.state.FunctionSnapshotContext;\n30: import org.apache.flink.streaming.api.checkpoint.CheckpointedFunction;\n31: import org.apache.flink.streaming.api.functions.sink.filesystem.BucketAssigner;\n32: import org.apache.flink.streaming.api.functions.sink.filesystem.BucketFactory;\n33: import org.apache.flink.streaming.api.functions.sink.filesystem.BucketWriter;\n34: import org.apache.flink.streaming.api.functions.sink.filesystem.Buckets;\n35: import org.apache.flink.streaming.api.functions.sink.filesystem.BulkBucketWriter;\n36: import org.apache.flink.streaming.api.functions.sink.filesystem.DefaultBucketFactoryImpl;\n37: import org.apache.flink.streaming.api.functions.sink.filesystem.OutputFileConfig;\n38: import org.apache.flink.streaming.api.functions.sink.filesystem.RollingPolicy;\n39: import org.apache.flink.streaming.api.functions.sink.filesystem.RowWiseBucketWriter;\n40: import org.apache.flink.streaming.api.functions.sink.filesystem.StreamingFileSinkHelper;\n41: import org.apache.flink.streaming.api.functions.sink.filesystem.bucketassigners.DateTimeBucketAssigner;\n42: import org.apache.flink.streaming.api.functions.sink.filesystem.rollingpolicies.CheckpointRollingPolicy;\n43: import org.apache.flink.streaming.api.functions.sink.filesystem.rollingpolicies.DefaultRollingPolicy;\n44: import org.apache.flink.streaming.api.functions.sink.filesystem.rollingpolicies.OnCheckpointRollingPolicy;\n45: import org.apache.flink.streaming.api.functions.sink.legacy.RichSinkFunction;\n46: import org.apache.flink.streaming.api.functions.sink.legacy.SinkFunction;\n47: import org.apache.flink.streaming.api.operators.StreamingRuntimeContext;\n48: import org.apache.flink.util.Preconditions;\n49: \n50: import java.io.IOException;\n51: import java.io.Serializable;\n52: \n53: /**\n54: * Sink that emits its input elements to {@link FileSystem} files within buckets. This is integrated\n55: * with the checkpointing mechanism to provide exactly once semantics.\n56: *\n57: * <p>When creating the sink a {@code basePath} must be specified. The base directory contains one\n58: * directory for every bucket. The bucket directories themselves contain several part files, with at\n59: * least one for each parallel subtask of the sink which is writing data to th... |
| 71 | - | assistant | tool_use | mcp__sourcegraph__sg_read_file | |
| 72 | 2026-06-12T16:13:42.172Z | user | tool_result | mcp__sourcegraph__sg_read_file | {"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/flink--0cc95fcc@031d3d0222a9018b36760a0fecf913a2359ae37c/-/blob/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/DataGeneratorSource.java\n1: /*\n2: * Licensed to the Apache Software Foundation (ASF) under one\n3: * or more contributor license agreements. See the NOTICE file\n4: * distributed with this work for additional information\n5: * regarding copyright ownership. The ASF licenses this file\n6: * to you under the Apache License, Version 2.0 (the\n7: * \"License\"); you may not use this file except in compliance\n8: * with the License. You may obtain a copy of the License at\n9: *\n10: * http://www.apache.org/licenses/LICENSE-2.0\n11: *\n12: * Unless required by applicable law or agreed to in writing, software\n13: * distributed under the License is distributed on an \"AS IS\" BASIS,\n14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n15: * See the License for the specific language governing permissions and\n16: * limitations under the License.\n17: */\n18: \n19: package org.apache.flink.streaming.api.functions.source.datagen;\n20: \n21: import org.apache.flink.annotation.Internal;\n22: import org.apache.flink.api.common.functions.OpenContext;\n23: import org.apache.flink.runtime.state.FunctionInitializationContext;\n24: import org.apache.flink.runtime.state.FunctionSnapshotContext;\n25: import org.apache.flink.streaming.api.checkpoint.CheckpointedFunction;\n26: import org.apache.flink.streaming.api.functions.source.legacy.RichParallelSourceFunction;\n27: \n28: import org.slf4j.Logger;\n29: import org.slf4j.LoggerFactory;\n30: \n31: import javax.annotation.Nullable;\n32: \n33: /**\n34: * A data generator source that abstract data generator. It can be used to easy startup/test for\n35: * streaming job and performance testing. It is stateful, re-scalable, possibly in parallel.\n36: *\n37: * @deprecated Use {@code org.apache.flink.connector.datagen.source.DataGeneratorSource} instead.\n38: */\n39: @Internal\n40: public class DataGeneratorSource<T> extends RichParallelSourceFunction<T>\n41: implements CheckpointedFunction {\n42: \n43: private static final long serialVersionUID = 1L;\n44: \n45: private static final Logger LOG = LoggerFactory.getLogger(DataGeneratorSource.class);\n46: \n47: private final DataGenerator<T> generator;\n48: \n49: private final long rowsPerSecond;\n50: \n51: @Nullable private final Long numberOfRows;\n52: \n53: private transient int outputSoFar;\n54: \n55: private transient int toOutput;\n56: \n57: transient volatile boolean isRunning;\n58: \n59: /**\n60: * Creates a source that emits records by {@link DataGenerator} without controlling emit rate.\n61: *\n62: * @param generator data generator.\n63: */\n64: public DataGeneratorSource(DataGenerator<T> generator) {\n65: this(generator, Long.MAX_VALUE, null);\n66: }\n67: \n68: /**\n69: * Creates a source that emits records by {@link DataGenerator}.\n70: *\n71: * @param generator data generator.\n72: * @param rowsPerSecond Control the emit rate.\n73: * @param numberOfRows Total number of rows to output.\n74: */\n75: public DataGeneratorSource(\n76: DataGenerator<T> generator, long rowsPerSecond, @Nullable Long numberOfRows) {\n77: this.generator = generator;\n78: this.rowsPerSecond = rowsPerSecond;\n79: this.numberOfRows = numberOfRows;\n80: }\n81: \n82: @Override\n83: public void open(OpenContext openContext) throws Exception {\n84: super.open(openContext);\n85: \n86: if (numberOfRows != null) {\n87: final int stepSize = getRuntimeContext().getTaskInfo().getNumberOfParallelSubtasks();\n88: final int taskIdx = getRuntimeContext().getTaskInfo().getIndexOfThisSubtask();\n89: \n90: final ... |
| 73 | - | assistant | tool_use | mcp__sourcegraph__sg_read_file | |
| 74 | 2026-06-12T16:13:43.008Z | user | tool_result | mcp__sourcegraph__sg_read_file | {"text":"URL: https://demo.sourcegraph.com/github.com/sg-evals/flink--0cc95fcc@031d3d0222a9018b36760a0fecf913a2359ae37c/-/blob/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/CollectionInputFormat.java\n1: /*\n2: * Licensed to the Apache Software Foundation (ASF) under one\n3: * or more contributor license agreements. See the NOTICE file\n4: * distributed with this work for additional information\n5: * regarding copyright ownership. The ASF licenses this file\n6: * to you under the Apache License, Version 2.0 (the\n7: * \"License\"); you may not use this file except in compliance\n8: * with the License. You may obtain a copy of the License at\n9: *\n10: * http://www.apache.org/licenses/LICENSE-2.0\n11: *\n12: * Unless required by applicable law or agreed to in writing, software\n13: * distributed under the License is distributed on an \"AS IS\" BASIS,\n14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n15: * See the License for the specific language governing permissions and\n16: * limitations under the License.\n17: */\n18: \n19: package org.apache.flink.streaming.api.legacy.io;\n20: \n21: import org.apache.flink.api.common.io.GenericInputFormat;\n22: import org.apache.flink.api.common.io.NonParallelInput;\n23: import org.apache.flink.api.common.typeutils.TypeSerializer;\n24: import org.apache.flink.core.io.GenericInputSplit;\n25: import org.apache.flink.core.memory.DataInputViewStreamWrapper;\n26: import org.apache.flink.core.memory.DataOutputViewStreamWrapper;\n27: \n28: import java.io.IOException;\n29: import java.io.ObjectInputStream;\n30: import java.io.ObjectOutputStream;\n31: import java.util.ArrayList;\n32: import java.util.Collection;\n33: import java.util.Iterator;\n34: import java.util.List;\n35: \n36: /** An input format that returns objects from a collection. */\n37: public class CollectionInputFormat<T> extends GenericInputFormat<T> implements NonParallelInput {\n38: \n39: private static final long serialVersionUID = 1L;\n40: private static final int MAX_TO_STRING_LEN = 100;\n41: \n42: private TypeSerializer<T> serializer;\n43: \n44: // input data as collection. transient, because it will be serialized in a custom way\n45: private transient Collection<T> dataSet;\n46: \n47: private transient Iterator<T> iterator;\n48: \n49: public CollectionInputFormat(Collection<T> dataSet, TypeSerializer<T> serializer) {\n50: if (dataSet == null) {\n51: throw new NullPointerException();\n52: }\n53: \n54: this.serializer = serializer;\n55: \n56: this.dataSet = dataSet;\n57: }\n58: \n59: @Override\n60: public boolean reachedEnd() throws IOException {\n61: return !this.iterator.hasNext();\n62: }\n63: \n64: @Override\n65: public void open(GenericInputSplit split) throws IOException {\n66: super.open(split);\n67: \n68: this.iterator = this.dataSet.iterator();\n69: }\n70: \n71: @Override\n72: public T nextRecord(T record) throws IOException {\n73: return this.iterator.next();\n74: }\n75: \n76: // --------------------------------------------------------------------------------------------\n77: \n78: private void writeObject(ObjectOutputStream out) throws IOException {\n79: out.defaultWriteObject();\n80: \n81: final int size = dataSet.size();\n82: out.writeInt(size);\n83: \n84: if (size > 0) {\n85: DataOutputViewStreamWrapper wrapper = new DataOutputViewStreamWrapper(out);\n86: for (T element : dataSet) {\n87: serializer.serialize(element, wrapper);\n88: }\n89: }\n90: }\n91: \n92: private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {\n93: in.defaultReadObject();\n94: \n95: int collectionLength = in.readInt();\n96: List<T> list = new ArrayList<T>(col... |
| 75 | - | system | thinking_tokens | - | |
| 76 | - | system | thinking_tokens | - | |
| 77 | - | system | thinking_tokens | - | |
| 78 | - | system | thinking_tokens | - | |
| 79 | - | system | thinking_tokens | - | |
| 80 | - | system | thinking_tokens | - | |
| 81 | - | system | thinking_tokens | - | |
| 82 | - | system | thinking_tokens | - | |
| 83 | - | system | thinking_tokens | - | |
| 84 | - | system | thinking_tokens | - | |
| 85 | - | system | thinking_tokens | - | |
| 86 | - | system | thinking_tokens | - | |
| 87 | - | system | thinking_tokens | - | |
| 88 | - | system | thinking_tokens | - | |
| 89 | - | system | thinking_tokens | - | |
| 90 | - | system | thinking_tokens | - | |
| 91 | - | system | thinking_tokens | - | |
| 92 | - | system | thinking_tokens | - | |
| 93 | - | system | thinking_tokens | - | |
| 94 | - | system | thinking_tokens | - | |
| 95 | - | system | thinking_tokens | - | |
| 96 | - | system | thinking_tokens | - | |
| 97 | - | system | thinking_tokens | - | |
| 98 | - | system | thinking_tokens | - | |
| 99 | - | system | thinking_tokens | - | |
| 100 | - | system | thinking_tokens | - | |
| 101 | - | assistant | text | - | I see that `CollectionInputFormat.java` and `BoundedOutOfOrdernessTimestampExtractor.java` don't have `@Deprecated` annotations. Let me do a broader search to ensure complete coverage. |
| 102 | - | assistant | tool_use | mcp__sourcegraph__sg_keyword_search | |
| 103 | - | assistant | tool_use | mcp__sourcegraph__sg_keyword_search | |
| 104 | 2026-06-12T16:14:06.068Z | user | tool_result | mcp__sourcegraph__sg_keyword_search | {"text":"# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextOutputFormat.java\n41: */\n42: @Deprecated\n43: @PublicEvolving\n44: public class TextOutputFormat<T> extends FileOutputFormat<T> {\n45: \n46: \n36: *\n37: * @deprecated If you want to read/write data from/to text file, please use FLIP-27 FileSource and\n38: * Sink-V2 FlinkSink. This class should be removed if we drop all supports for {@link\n39: * org.apache.flink.api.common.io.InputFormat} and {@link\n40: \n\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextInputFormat.java\n36: */\n37: @Deprecated\n38: @PublicEvolving\n39: public class TextInputFormat extends DelimitedInputFormat<String> {\n40: \n41: \n32: *\n33: * @deprecated If you want to read/write data from/to text file, please use FLIP-27 FileSource and\n34: * Sink-V2 FlinkSink. This class should be removed if we drop the supports for read/write via\n35: * input/output format in DataStream api.\n36: \n\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/DiscardingSink.java\n27: * @param <T> The type of elements received by the sink.\n28: * @deprecated This interface will be removed in future versions. Use the new {@link\n29: * org.apache.flink.streaming.api.functions.sink.v2.DiscardingSink} interface instead.\n30: \n31: @Internal\n32: public class DiscardingSink<T> implements SinkFunction<T>, SupportsConcurrentExecutionAttempts {\n33: \n34: \n\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/AscendingTimestampExtractor.java\n36: */\n37: @Deprecated\n38: @PublicEvolving\n39: public abstract class AscendingTimestampExtractor<T>\n40: implements WatermarkStrategyWithPeriodicWatermarks<T> {\n41: \n136: private static final Logger LOG =\n137: LoggerFactory.getLogger(AscendingTimestampExtractor.class);\n138: \n139: \n118: /** Handler that fails the program when timestamp monotony is violated. */\n119: public static final class FailingHandler implements MonotonyViolationHandler {\n120: private static final long serialVersionUID = 1L;\n121: \n\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/DataGeneratorSource.java\n39: @Internal\n40: public class DataGeneratorSource<T> extends RichParallelSourceFunction<T>\n41: implements CheckpointedFunction {\n42: \n44: \n45: private static final Logger LOG = LoggerFactory.getLogger(DataGeneratorSource.class);\n46: \n47: \n36: *\n37: * @deprecated Use {@code org.apache.flink.connector.datagen.source.DataGeneratorSource} instead.\n38: */\n39: \n\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/legacy/StreamingFileSink.java\n273: Preconditions.checkState(\n274: bucketFactory.getClass() == DefaultBucketFactoryImpl.class,\n275: \"newBuilderWithBucketAssignerAndPolicy() cannot be called after specifying a customized bucket factory\");\n276: \n420: Preconditions.checkState(\n421: bucketFactory.getClass() == DefaultBucketFactoryImpl.class,\n422: \"newBuilderWithBucketAssigner() cannot be called after specifying a customized bucket factory\");\n423: \n335: @Internal\n336: public static class BulkFormatBuilder<\n337: IN, BucketID, T extends BulkFormatBuilder<IN, BucketID, T>>\n338: \n\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/TwoPhaseCommitSinkFunction.java\n856: }\n857: if (o == null || getClass() != ... |
| 105 | 2026-06-12T16:14:06.103Z | user | tool_result | mcp__sourcegraph__sg_keyword_search | {"text":"No results.\n\nNo results found."} |
| 106 | - | system | thinking_tokens | - | |
| 107 | - | system | thinking_tokens | - | |
| 108 | - | system | thinking_tokens | - | |
| 109 | - | system | thinking_tokens | - | |
| 110 | - | system | thinking_tokens | - | |
| 111 | - | system | thinking_tokens | - | |
| 112 | - | system | thinking_tokens | - | |
| 113 | - | system | thinking_tokens | - | |
| 114 | - | system | thinking_tokens | - | |
| 115 | - | system | thinking_tokens | - | |
| 116 | - | system | thinking_tokens | - | |
| 117 | - | system | thinking_tokens | - | |
| 118 | - | system | thinking_tokens | - | |
| 119 | - | system | thinking_tokens | - | |
| 120 | - | system | thinking_tokens | - | |
| 121 | - | system | thinking_tokens | - | |
| 122 | - | assistant | text | - | Let me also check for legacy source function interfaces and any other deprecated items. |
| 123 | - | assistant | tool_use | mcp__sourcegraph__sg_list_files | |
| 124 | - | assistant | tool_use | mcp__sourcegraph__sg_keyword_search | |
| 125 | 2026-06-12T16:14:17.702Z | user | tool_result | mcp__sourcegraph__sg_list_files | {"text":"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/DiscardingSink.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/TwoPhaseCommitSinkFunction.java\n"} |
| 126 | 2026-06-12T16:14:17.726Z | user | tool_result | mcp__sourcegraph__sg_keyword_search | {"text":"# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/DiscardingSink.java\n27: * @param <T> The type of elements received by the sink.\n28: * @deprecated This interface will be removed in future versions. Use the new {@link\n29: * org.apache.flink.streaming.api.functions.sink.v2.DiscardingSink} interface instead.\n30: \n\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/DataGeneratorSource.java\n36: *\n37: * @deprecated Use {@code org.apache.flink.connector.datagen.source.DataGeneratorSource} instead.\n38: */\n39: \n\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/TwoPhaseCommitSinkFunction.java\n71: * TwoPhaseCommitSinkFunction} instance. Context is created once\n72: * @deprecated This interface will be removed in future versions. Use the new {@link\n73: * org.apache.flink.api.connector.sink2.Sink} interface instead.\n74: \n\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/AscendingTimestampExtractor.java\n36: */\n37: @Deprecated\n38: @PublicEvolving\n39: \n\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/legacy/StreamingFileSink.java\n97: * @param <IN> Type of the elements emitted by this sink\n98: * @deprecated Use {@link org.apache.flink.connector.file.sink.FileSink} instead.\n99: */\n100: \n"} |
| 127 | - | system | thinking_tokens | - | |
| 128 | - | system | thinking_tokens | - | |
| 129 | - | system | thinking_tokens | - | |
| 130 | - | assistant | text | - | Now I have a comprehensive picture. Let me also check the datastream directory and operators for any deprecated API classes. |
| 131 | - | assistant | tool_use | mcp__sourcegraph__sg_keyword_search | |
| 132 | 2026-06-12T16:14:21.543Z | user | tool_result | mcp__sourcegraph__sg_keyword_search | {"text":"No results.\n\nNo results found."} |
| 133 | - | assistant | tool_use | mcp__sourcegraph__sg_keyword_search | |
| 134 | 2026-06-12T16:14:21.870Z | user | tool_result | mcp__sourcegraph__sg_keyword_search | {"text":"No results.\n\nNo results found."} |
| 135 | - | system | thinking_tokens | - | |
| 136 | - | system | thinking_tokens | - | |
| 137 | - | system | thinking_tokens | - | |
| 138 | - | assistant | tool_use | mcp__sourcegraph__sg_keyword_search | |
| 139 | 2026-06-12T16:14:25.516Z | user | tool_result | mcp__sourcegraph__sg_keyword_search | {"text":"# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextInputFormat.java\n32: *\n33: * @deprecated If you want to read/write data from/to text file, please use FLIP-27 FileSource and\n34: * Sink-V2 FlinkSink. This class should be removed if we drop the supports for read/write via\n35: \n36: */\n37: @Deprecated\n38: @PublicEvolving\n39: \n\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextOutputFormat.java\n36: *\n37: * @deprecated If you want to read/write data from/to text file, please use FLIP-27 FileSource and\n38: * Sink-V2 FlinkSink. This class should be removed if we drop all supports for {@link\n39: \n41: */\n42: @Deprecated\n43: @PublicEvolving\n44: \n"} |
| 140 | - | assistant | tool_use | mcp__sourcegraph__sg_keyword_search | |
| 141 | 2026-06-12T16:14:25.977Z | user | tool_result | mcp__sourcegraph__sg_keyword_search | {"text":"No results.\n\nNo results found."} |
| 142 | - | system | thinking_tokens | - | |
| 143 | - | system | thinking_tokens | - | |
| 144 | - | system | thinking_tokens | - | |
| 145 | - | system | thinking_tokens | - | |
| 146 | - | system | thinking_tokens | - | |
| 147 | - | system | thinking_tokens | - | |
| 148 | - | system | thinking_tokens | - | |
| 149 | - | system | thinking_tokens | - | |
| 150 | - | system | thinking_tokens | - | |
| 151 | - | system | thinking_tokens | - | |
| 152 | - | system | thinking_tokens | - | |
| 153 | - | system | thinking_tokens | - | |
| 154 | - | system | thinking_tokens | - | |
| 155 | - | system | thinking_tokens | - | |
| 156 | - | system | thinking_tokens | - | |
| 157 | - | system | thinking_tokens | - | |
| 158 | - | system | thinking_tokens | - | |
| 159 | - | system | thinking_tokens | - | |
| 160 | - | system | thinking_tokens | - | |
| 161 | - | system | thinking_tokens | - | |
| 162 | - | system | thinking_tokens | - | |
| 163 | - | system | thinking_tokens | - | |
| 164 | - | system | thinking_tokens | - | |
| 165 | - | system | thinking_tokens | - | |
| 166 | - | system | thinking_tokens | - | |
| 167 | - | system | thinking_tokens | - | |
| 168 | - | system | thinking_tokens | - | |
| 169 | - | system | thinking_tokens | - | |
| 170 | - | system | thinking_tokens | - | |
| 171 | - | system | thinking_tokens | - | |
| 172 | - | system | thinking_tokens | - | |
| 173 | - | system | thinking_tokens | - | |
| 174 | - | system | thinking_tokens | - | |
| 175 | - | system | thinking_tokens | - | |
| 176 | - | system | thinking_tokens | - | |
| 177 | - | system | thinking_tokens | - | |
| 178 | - | system | thinking_tokens | - | |
| 179 | - | system | thinking_tokens | - | |
| 180 | - | system | thinking_tokens | - | |
| 181 | - | system | thinking_tokens | - | |
| 182 | - | system | thinking_tokens | - | |
| 183 | - | system | thinking_tokens | - | |
| 184 | - | system | thinking_tokens | - | |
| 185 | - | assistant | text | - | Now I have complete coverage. Let me compile the findings and write the answer. |
| 186 | - | assistant | tool_use | Write | |
| 187 | 2026-06-12T16:15:16.349Z | user | tool_result | Write | File created successfully at: /workspace/answer.json (file state is current in your context — no need to Read it back) |
| 188 | - | assistant | text | - | The answer covers all deprecated DataStream API classes found in `flink-streaming-java/src/main/` of the Flink repo. Here's a summary: **Files with `@Deprecated` Java annotation:** - `AscendingTimestampExtractor` — timestamp extractor - `TextInputFormat` — I/O format (→ FLIP-27 FileSource) - `TextOutputFormat` — I/O format (→ Sink-V2 FlinkSink) **Files with `@deprecated` Javadoc tag (legacy sink/source packages, no `@Deprecated` annotation):** - `DiscardingSink` — sink function (→ `sink.v2.DiscardingSink`) - `TwoPhaseCommitSinkFunction` — sink function (→ `sink2.Sink`) - `StreamingFileSink` — streaming file sink (→ `FileSink`) - `DataGeneratorSource` — source function (→ `connector.datagen.source.DataGeneratorSource`) Not deprecated: `CollectionInputFormat`, `BoundedOutOfOrdernessTimestampExtractor`. Test harness files (`StreamTaskTestHarness`, etc.) are excluded as they are out of scope for source/sink/timestamp/I/O focus. |
ToolSearch @ -{
"query": "select:mcp__sourcegraph__sg_keyword_search,mcp__sourcegraph__sg_list_files",
"max_results": 2
}{
"matches": [
"mcp__sourcegraph__sg_keyword_search",
"mcp__sourcegraph__sg_list_files"
],
"query": "select:mcp__sourcegraph__sg_keyword_search,mcp__sourcegraph__sg_list_files",
"total_deferred_tools": 33
}mcp__sourcegraph__sg_list_files @ -{
"repo": "github.com/sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src"
}{
"content": "{\"text\":\"flink-streaming-java/src/main/\\nflink-streaming-java/src/test/\\n\"}",
"structuredContent": {
"text": "flink-streaming-java/src/main/\nflink-streaming-java/src/test/\n"
}
}mcp__sourcegraph__sg_keyword_search @ -{
"query": "@Deprecated repo:^github.com/sg-evals/flink--0cc95fcc$ file:flink-streaming-java/src/"
}{
"content": "{\"text\":\"# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextInputFormat.java\\n32: *\\n33: * @deprecated If you want to read/write data from/to text file, please use FLIP-27 FileSource and\\n34: * Sink-V2 FlinkSink. This class should be removed if we drop the supports for read/write via\\n35: \\n36: */\\n37: @Deprecated\\n38: @PublicEvolving\\n39: \\n\\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextOutputFormat.java\\n36: *\\n37: * @deprecated If you want to read/write data from/to text file, please use FLIP-27 FileSource and\\n38: * Sink-V2 FlinkSink. This class should be removed if we drop all supports for {@link\\n39: \\n41: */\\n42: @Deprecated\\n43: @PublicEvolving\\n44: \\n\\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/StreamTaskTestHarness.java\\n97: *\\n98: * @deprecated Please use {@link StreamTaskMailboxTestHarness} and {@link\\n99: * StreamTaskMailboxTestHarnessBuilder}. Do not add new code using this test harness.\\n100: \\n100: */\\n101: @Deprecated\\n102: public class StreamTaskTestHarness<OUT> {\\n103: \\n\\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/DiscardingSink.java\\n27: * @param <T> The type of elements received by the sink.\\n28: * @deprecated This interface will be removed in future versions. Use the new {@link\\n29: * org.apache.flink.streaming.api.functions.sink.v2.DiscardingSink} interface instead.\\n30: \\n\\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/OneInputStreamTaskTestHarness.java\\n52: *\\n53: * @deprecated Please use {@link StreamTaskMailboxTestHarness} and {@link\\n54: * StreamTaskMailboxTestHarnessBuilder}. Do not add new code using this test harness.\\n55: \\n55: */\\n56: @Deprecated\\n57: public class OneInputStreamTaskTestHarness<IN, OUT> extends StreamTaskTestHarness<OUT> {\\n58: \\n\\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/tasks/TwoInputStreamTaskTestHarness.java\\n52: *\\n53: * @deprecated Please use {@link StreamTaskMailboxTestHarness} and {@link\\n54: * StreamTaskMailboxTestHarnessBuilder}. Do not add new code using this test harness.\\n55: \\n55: */\\n56: @Deprecated\\n57: public class TwoInputStreamTaskTestHarness<IN1, IN2, OUT> extends StreamTaskTestHarness<OUT> {\\n58: \\n\\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/DataGeneratorSource.java\\n36: *\\n37: * @deprecated Use {@code org.apache.flink.connector.datagen.source.DataGeneratorSource} instead.\\n38: */\\n39: \\n\\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/TwoPhaseCommitSinkFunction.java\\n71: * TwoPhaseCommitSinkFunction} instance. Context is created once\\n72: * @deprecated This interface will be removed in future versions. Use the new {@link\\n73: * org.apache.flink.api.connector.sink2.Sink} interface instead.\\n74: \\n\\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/AscendingTimestampExtractor.java\\n36: */\\n37: @Deprecated\\n38: @PublicEvolving\\n39: \\n\\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/legacy/StreamingFileSink.java\\n97: * @param <IN> Type of the elements emitted by this sink\\n98: * @deprecated Use {@link org.apache.flink.connector.file.sink.FileSink} instead.\\n99: */\\n100: \\n\"}",
"structuredContent": {
"text": "# github.com/sg-evals/flink
...mcp__sourcegraph__sg_list_files @ -{
"repo": "github.com/sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api"
}{
"content": "{\"text\":\"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/lineage/\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/windowing/\\n\"}",
"structuredContent": {
"text": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/lineage/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/windowing/\n"
}
}mcp__sourcegraph__sg_keyword_search @ -{
"query": "@Deprecated DataStream repo:^github.com/sg-evals/flink--0cc95fcc$ file:flink-streaming-java/src/main/"
}{
"content": "{\"text\":\"# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextInputFormat.java\\n32: *\\n33: * @deprecated If you want to read/write data from/to text file, please use FLIP-27 FileSource and\\n34: * Sink-V2 FlinkSink. This class should be removed if we drop the supports for read/write via\\n35: * input/output format in DataStream api.\\n36: */\\n37: @Deprecated\\n38: @PublicEvolving\\n39: \\n\"}",
"structuredContent": {
"text": "# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextInputFormat.java\n32: *\n33: * @deprecated If you want to read/write data from/to text file, please use FLIP-27 FileSource and\n34: * Sink-V2 FlinkSink. This class should be removed if we drop the supports for read/write via\n35: * input/output format in DataStream api.\n36: */\n37: @Deprecated\n38: @PublicEvolving\n39: \n"
}
}mcp__sourcegraph__sg_list_files @ -{
"repo": "github.com/sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions"
}{
"content": "{\"text\":\"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/async/\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/co/\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/windowing/\\n\"}",
"structuredContent": {
"text": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/async/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/co/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/windowing/\n"
}
}mcp__sourcegraph__sg_list_files @ -{
"repo": "github.com/sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy"
}{
"content": "{\"text\":\"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/\\n\"}",
"structuredContent": {
"text": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/\n"
}
}mcp__sourcegraph__sg_list_files @ -{
"repo": "github.com/sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink"
}{
"content": "{\"text\":\"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/v2/\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/PrintSink.java\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/SinkContextUtil.java\\n\"}",
"structuredContent": {
"text": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/v2/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/PrintSink.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/SinkContextUtil.java\n"
}
}mcp__sourcegraph__sg_list_files @ -{
"repo": "github.com/sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source"
}{
"content": "{\"text\":\"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/SerializedCheckpointData.java\\n\"}",
"structuredContent": {
"text": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/SerializedCheckpointData.java\n"
}
}mcp__sourcegraph__sg_list_files @ -{
"repo": "github.com/sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps"
}{
"content": "{\"text\":\"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/AscendingTimestampExtractor.java\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/BoundedOutOfOrdernessTimestampExtractor.java\\n\"}",
"structuredContent": {
"text": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/AscendingTimestampExtractor.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/BoundedOutOfOrdernessTimestampExtractor.java\n"
}
}mcp__sourcegraph__sg_list_files @ -{
"repo": "github.com/sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io"
}{
"content": "{\"text\":\"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/CollectionInputFormat.java\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextInputFormat.java\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextOutputFormat.java\\n\"}",
"structuredContent": {
"text": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/CollectionInputFormat.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextInputFormat.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextOutputFormat.java\n"
}
}mcp__sourcegraph__sg_list_files @ -{
"repo": "github.com/sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy"
}{
"content": "{\"text\":\"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/DiscardingSink.java\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/TwoPhaseCommitSinkFunction.java\\n\"}",
"structuredContent": {
"text": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/DiscardingSink.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/TwoPhaseCommitSinkFunction.java\n"
}
}mcp__sourcegraph__sg_list_files @ -{
"repo": "github.com/sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen"
}{
"content": "{\"text\":\"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/DataGenerator.java\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/DataGeneratorSource.java\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/RandomGenerator.java\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/SequenceGenerator.java\\n\"}",
"structuredContent": {
"text": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/DataGenerator.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/DataGeneratorSource.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/RandomGenerator.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/SequenceGenerator.java\n"
}
}mcp__sourcegraph__sg_list_files @ -{
"repo": "github.com/sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem"
}{
"content": "{\"text\":\"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/legacy/\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/Bucket.java\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/BucketFactory.java\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/BucketLifeCycleListener.java\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/BucketState.java\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/BucketStateSerializer.java\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/Buckets.java\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/DefaultBucketFactoryImpl.java\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/FileLifeCycleListener.java\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/StreamingFileSinkHelper.java\\n\"}",
"structuredContent": {
"text": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/legacy/\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/Bucket.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/BucketFactory.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/BucketLifeCycleListener.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/BucketState.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/BucketStateSerializer.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/Buckets.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/DefaultBucketFactoryImpl.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/FileLifeCycleListener.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/StreamingFileSinkHelper.java\n"
}
}mcp__sourcegraph__sg_list_files @ -{
"repo": "github.com/sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/legacy"
}{
"content": "{\"text\":\"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/legacy/StreamingFileSink.java\\n\"}",
"structuredContent": {
"text": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/legacy/StreamingFileSink.java\n"
}
}ToolSearch @ -{
"query": "select:mcp__sourcegraph__sg_read_file",
"max_results": 1
}{
"matches": [
"mcp__sourcegraph__sg_read_file"
],
"query": "select:mcp__sourcegraph__sg_read_file",
"total_deferred_tools": 33
}mcp__sourcegraph__sg_read_file @ -{
"repo": "github.com/sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/AscendingTimestampExtractor.java"
}{
"content": "{\"text\":\"URL: https://demo.sourcegraph.com/github.com/sg-evals/flink--0cc95fcc@031d3d0222a9018b36760a0fecf913a2359ae37c/-/blob/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/AscendingTimestampExtractor.java\\n1: /*\\n2: * Licensed to the Apache Software Foundation (ASF) under one\\n3: * or more contributor license agreements. See the NOTICE file\\n4: * distributed with this work for additional information\\n5: * regarding copyright ownership. The ASF licenses this file\\n6: * to you under the Apache License, Version 2.0 (the\\n7: * \\\"License\\\"); you may not use this file except in compliance\\n8: * with the License. You may obtain a copy of the License at\\n9: *\\n10: * http://www.apache.org/licenses/LICENSE-2.0\\n11: *\\n12: * Unless required by applicable law or agreed to in writing, software\\n13: * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n15: * See the License for the specific language governing permissions and\\n16: * limitations under the License.\\n17: */\\n18: \\n19: package org.apache.flink.streaming.api.functions.timestamps;\\n20: \\n21: import org.apache.flink.annotation.PublicEvolving;\\n22: import org.apache.flink.streaming.api.watermark.Watermark;\\n23: import org.apache.flink.streaming.runtime.operators.util.WatermarkStrategyWithPeriodicWatermarks;\\n24: \\n25: import org.slf4j.Logger;\\n26: import org.slf4j.LoggerFactory;\\n27: \\n28: import static java.util.Objects.requireNonNull;\\n29: \\n30: /**\\n31: * A timestamp assigner and watermark generator for streams where timestamps are monotonously\\n32: * ascending. In this case, the local watermarks for the streams are easy to generate, because they\\n33: * strictly follow the timestamps.\\n34: *\\n35: * @param <T> The type of the elements that this function can extract timestamps from\\n36: */\\n37: @Deprecated\\n38: @PublicEvolving\\n39: public abstract class AscendingTimestampExtractor<T>\\n40: implements WatermarkStrategyWithPeriodicWatermarks<T> {\\n41: \\n42: private static final long serialVersionUID = 1L;\\n43: \\n44: /** The current timestamp. */\\n45: private long currentTimestamp = Long.MIN_VALUE;\\n46: \\n47: /** Handler that is called when timestamp monotony is violated. */\\n48: private MonotonyViolationHandler violationHandler = new LoggingHandler();\\n49: \\n50: /**\\n51: * Extracts the timestamp from the given element. The timestamp must be monotonically\\n52: * increasing.\\n53: *\\n54: * @param element The element that the timestamp is extracted from.\\n55: * @return The new timestamp.\\n56: */\\n57: public abstract long extractAscendingTimestamp(T element);\\n58: \\n59: /**\\n60: * Sets the handler for violations to the ascending timestamp order.\\n61: *\\n62: * @param handler The violation handler to use.\\n63: * @return This extractor.\\n64: */\\n65: public AscendingTimestampExtractor<T> withViolationHandler(MonotonyViolationHandler handler) {\\n66: this.violationHandler = requireNonNull(handler);\\n67: return this;\\n68: }\\n69: \\n70: // ------------------------------------------------------------------------\\n71: \\n72: @Override\\n73: public final long extractTimestamp(T element, long elementPrevTimestamp) {\\n74: final long newTimestamp = extractAscendingTimestamp(element);\\n75: if (newTimestamp >= this.currentTimestamp) {\\n76: this.currentTimestamp = newTimestamp;\\n77: return newTimestamp;\\n78: } else {\\n79: violationHandler.handleViolation(newTimestamp, this.currentTimestamp);\\n80: return newTimestamp;\\n81: }\\n82: }\\n83: \\n84: @Override\\n85: public final Watermark getCurrentWatermark() {\\n86:
...mcp__sourcegraph__sg_read_file @ -{
"repo": "github.com/sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/BoundedOutOfOrdernessTimestampExtractor.java"
}{
"content": "{\"text\":\"URL: https://demo.sourcegraph.com/github.com/sg-evals/flink--0cc95fcc@031d3d0222a9018b36760a0fecf913a2359ae37c/-/blob/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/BoundedOutOfOrdernessTimestampExtractor.java\\n1: /*\\n2: * Licensed to the Apache Software Foundation (ASF) under one\\n3: * or more contributor license agreements. See the NOTICE file\\n4: * distributed with this work for additional information\\n5: * regarding copyright ownership. The ASF licenses this file\\n6: * to you under the Apache License, Version 2.0 (the\\n7: * \\\"License\\\"); you may not use this file except in compliance\\n8: * with the License. You may obtain a copy of the License at\\n9: *\\n10: * http://www.apache.org/licenses/LICENSE-2.0\\n11: *\\n12: * Unless required by applicable law or agreed to in writing, software\\n13: * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n15: * See the License for the specific language governing permissions and\\n16: * limitations under the License.\\n17: */\\n18: \\n19: package org.apache.flink.streaming.api.functions.timestamps;\\n20: \\n21: import org.apache.flink.streaming.api.watermark.Watermark;\\n22: import org.apache.flink.streaming.runtime.operators.util.WatermarkStrategyWithPeriodicWatermarks;\\n23: \\n24: import java.time.Duration;\\n25: \\n26: /**\\n27: * This is a {@link WatermarkStrategyWithPeriodicWatermarks} used to emit Watermarks that lag behind\\n28: * the element with the maximum timestamp (in event time) seen so far by a fixed amount of time,\\n29: * <code>\\n30: * t_late</code>. This can help reduce the number of elements that are ignored due to lateness when\\n31: * computing the final result for a given window, in the case where we know that elements arrive no\\n32: * later than <code>t_late</code> units of time after the watermark that signals that the system\\n33: * event-time has advanced past their (event-time) timestamp.\\n34: */\\n35: public abstract class BoundedOutOfOrdernessTimestampExtractor<T>\\n36: implements WatermarkStrategyWithPeriodicWatermarks<T> {\\n37: \\n38: private static final long serialVersionUID = 1L;\\n39: \\n40: /** The current maximum timestamp seen so far. */\\n41: private long currentMaxTimestamp;\\n42: \\n43: /** The timestamp of the last emitted watermark. */\\n44: private long lastEmittedWatermark = Long.MIN_VALUE;\\n45: \\n46: /**\\n47: * The (fixed) interval between the maximum seen timestamp seen in the records and that of the\\n48: * watermark to be emitted.\\n49: */\\n50: private final long maxOutOfOrderness;\\n51: \\n52: public BoundedOutOfOrdernessTimestampExtractor(Duration maxOutOfOrderness) {\\n53: if (maxOutOfOrderness.isNegative()) {\\n54: throw new IllegalArgumentException(\\n55: String.format(\\n56: \\\"Tried to set the maximum allowed lateness to %s. This parameter cannot be negative.\\\",\\n57: maxOutOfOrderness));\\n58: }\\n59: \\n60: this.maxOutOfOrderness = maxOutOfOrderness.toMillis();\\n61: this.currentMaxTimestamp = Long.MIN_VALUE + this.maxOutOfOrderness;\\n62: }\\n63: \\n64: public long getMaxOutOfOrdernessInMillis() {\\n65: return maxOutOfOrderness;\\n66: }\\n67: \\n68: /**\\n69: * Extracts the timestamp from the given element.\\n70: *\\n71: * @param element The element that the timestamp is extracted from.\\n72: * @return The new timestamp.\\n73: */\\n74: public abstract long extractTimestamp(T element);\\n75: \\n76: @Override\\n77: public final Watermark getCurrentWatermark() {\\n78: // this guarantees that the watermark never goes backwards.\\n79: long potentialWM = currentMaxT
...mcp__sourcegraph__sg_read_file @ -{
"repo": "github.com/sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextInputFormat.java"
}{
"content": "{\"text\":\"URL: https://demo.sourcegraph.com/github.com/sg-evals/flink--0cc95fcc@031d3d0222a9018b36760a0fecf913a2359ae37c/-/blob/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextInputFormat.java\\n1: /*\\n2: * Licensed to the Apache Software Foundation (ASF) under one\\n3: * or more contributor license agreements. See the NOTICE file\\n4: * distributed with this work for additional information\\n5: * regarding copyright ownership. The ASF licenses this file\\n6: * to you under the Apache License, Version 2.0 (the\\n7: * \\\"License\\\"); you may not use this file except in compliance\\n8: * with the License. You may obtain a copy of the License at\\n9: *\\n10: * http://www.apache.org/licenses/LICENSE-2.0\\n11: *\\n12: * Unless required by applicable law or agreed to in writing, software\\n13: * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n15: * See the License for the specific language governing permissions and\\n16: * limitations under the License.\\n17: */\\n18: \\n19: package org.apache.flink.streaming.api.legacy.io;\\n20: \\n21: import org.apache.flink.annotation.PublicEvolving;\\n22: import org.apache.flink.api.common.io.DelimitedInputFormat;\\n23: import org.apache.flink.configuration.Configuration;\\n24: import org.apache.flink.core.fs.Path;\\n25: \\n26: import java.io.IOException;\\n27: import java.nio.charset.Charset;\\n28: import java.util.Arrays;\\n29: \\n30: /**\\n31: * Input Format that reads text files. Each line results in another element.\\n32: *\\n33: * @deprecated If you want to read/write data from/to text file, please use FLIP-27 FileSource and\\n34: * Sink-V2 FlinkSink. This class should be removed if we drop the supports for read/write via\\n35: * input/output format in DataStream api.\\n36: */\\n37: @Deprecated\\n38: @PublicEvolving\\n39: public class TextInputFormat extends DelimitedInputFormat<String> {\\n40: \\n41: private static final long serialVersionUID = 1L;\\n42: \\n43: /** Code of \\\\r, used to remove \\\\r from a line when the line ends with \\\\r\\\\n. */\\n44: private static final byte CARRIAGE_RETURN = (byte) '\\\\r';\\n45: \\n46: /** Code of \\\\n, used to identify if \\\\n is used as delimiter. */\\n47: private static final byte NEW_LINE = (byte) '\\\\n';\\n48: \\n49: /** The name of the charset to use for decoding. */\\n50: private String charsetName = \\\"UTF-8\\\";\\n51: \\n52: // --------------------------------------------------------------------------------------------\\n53: \\n54: public TextInputFormat(Path filePath) {\\n55: super(filePath, null);\\n56: }\\n57: \\n58: // --------------------------------------------------------------------------------------------\\n59: \\n60: public String getCharsetName() {\\n61: return charsetName;\\n62: }\\n63: \\n64: public void setCharsetName(String charsetName) {\\n65: if (charsetName == null) {\\n66: throw new IllegalArgumentException(\\\"Charset must not be null.\\\");\\n67: }\\n68: \\n69: this.charsetName = charsetName;\\n70: }\\n71: \\n72: // --------------------------------------------------------------------------------------------\\n73: \\n74: @Override\\n75: public void configure(Configuration parameters) {\\n76: super.configure(parameters);\\n77: \\n78: if (charsetName == null || !Charset.isSupported(charsetName)) {\\n79: throw new RuntimeException(\\\"Unsupported charset: \\\" + charsetName);\\n80: }\\n81: }\\n82: \\n83: // --------------------------------------------------------------------------------------------\\n84: \\n85: @Override\\n86: public String readRecord(String reusable, byte[] bytes, int offset, int numBytes)\\n87: throws IOException {\\n88:
...mcp__sourcegraph__sg_read_file @ -{
"repo": "github.com/sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextOutputFormat.java"
}{
"content": "{\"text\":\"URL: https://demo.sourcegraph.com/github.com/sg-evals/flink--0cc95fcc@031d3d0222a9018b36760a0fecf913a2359ae37c/-/blob/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextOutputFormat.java\\n1: /*\\n2: * Licensed to the Apache Software Foundation (ASF) under one\\n3: * or more contributor license agreements. See the NOTICE file\\n4: * distributed with this work for additional information\\n5: * regarding copyright ownership. The ASF licenses this file\\n6: * to you under the Apache License, Version 2.0 (the\\n7: * \\\"License\\\"); you may not use this file except in compliance\\n8: * with the License. You may obtain a copy of the License at\\n9: *\\n10: * http://www.apache.org/licenses/LICENSE-2.0\\n11: *\\n12: * Unless required by applicable law or agreed to in writing, software\\n13: * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n15: * See the License for the specific language governing permissions and\\n16: * limitations under the License.\\n17: */\\n18: \\n19: package org.apache.flink.streaming.api.legacy.io;\\n20: \\n21: import org.apache.flink.annotation.PublicEvolving;\\n22: import org.apache.flink.api.common.io.FileOutputFormat;\\n23: import org.apache.flink.core.fs.Path;\\n24: \\n25: import java.io.IOException;\\n26: import java.io.Serializable;\\n27: import java.nio.charset.Charset;\\n28: import java.nio.charset.IllegalCharsetNameException;\\n29: import java.nio.charset.UnsupportedCharsetException;\\n30: \\n31: /**\\n32: * A {@link FileOutputFormat} that writes objects to a text file.\\n33: *\\n34: * <p>Objects are converted to Strings using either {@link Object#toString()} or a {@link\\n35: * TextFormatter}.\\n36: *\\n37: * @deprecated If you want to read/write data from/to text file, please use FLIP-27 FileSource and\\n38: * Sink-V2 FlinkSink. This class should be removed if we drop all supports for {@link\\n39: * org.apache.flink.api.common.io.InputFormat} and {@link\\n40: * org.apache.flink.api.common.io.OutputFormat}\\n41: */\\n42: @Deprecated\\n43: @PublicEvolving\\n44: public class TextOutputFormat<T> extends FileOutputFormat<T> {\\n45: \\n46: private static final long serialVersionUID = 1L;\\n47: \\n48: private static final int NEWLINE = '\\\\n';\\n49: \\n50: private String charsetName;\\n51: \\n52: // --------------------------------------------------------------------------------------------\\n53: \\n54: /**\\n55: * Formatter that transforms values into their {@link String} representations.\\n56: *\\n57: * @param <IN> type of input elements\\n58: */\\n59: @PublicEvolving\\n60: public interface TextFormatter<IN> extends Serializable {\\n61: String format(IN value);\\n62: }\\n63: \\n64: public TextOutputFormat(Path outputPath) {\\n65: this(outputPath, \\\"UTF-8\\\");\\n66: }\\n67: \\n68: public TextOutputFormat(Path outputPath, String charset) {\\n69: super(outputPath);\\n70: this.charsetName = charset;\\n71: }\\n72: \\n73: public String getCharsetName() {\\n74: return charsetName;\\n75: }\\n76: \\n77: public void setCharsetName(String charsetName)\\n78: throws IllegalCharsetNameException, UnsupportedCharsetException {\\n79: if (charsetName == null) {\\n80: throw new NullPointerException();\\n81: }\\n82: \\n83: if (!Charset.isSupported(charsetName)) {\\n84: throw new UnsupportedCharsetException(\\n85: \\\"The charset \\\" + charsetName + \\\" is not supported.\\\");\\n86: }\\n87: \\n88: this.charsetName = charsetName;\\n89: }\\n90: \\n91: // --------------------------------------------------------------------------------------------\\n92: \\n93: @Override\\n94: public void w
...mcp__sourcegraph__sg_read_file @ -{
"repo": "github.com/sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/DiscardingSink.java"
}{
"content": "{\"text\":\"URL: https://demo.sourcegraph.com/github.com/sg-evals/flink--0cc95fcc@031d3d0222a9018b36760a0fecf913a2359ae37c/-/blob/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/DiscardingSink.java\\n1: /*\\n2: * Licensed to the Apache Software Foundation (ASF) under one\\n3: * or more contributor license agreements. See the NOTICE file\\n4: * distributed with this work for additional information\\n5: * regarding copyright ownership. The ASF licenses this file\\n6: * to you under the Apache License, Version 2.0 (the\\n7: * \\\"License\\\"); you may not use this file except in compliance\\n8: * with the License. You may obtain a copy of the License at\\n9: *\\n10: * http://www.apache.org/licenses/LICENSE-2.0\\n11: *\\n12: * Unless required by applicable law or agreed to in writing, software\\n13: * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n15: * See the License for the specific language governing permissions and\\n16: * limitations under the License.\\n17: */\\n18: \\n19: package org.apache.flink.streaming.api.functions.sink.legacy;\\n20: \\n21: import org.apache.flink.annotation.Internal;\\n22: import org.apache.flink.api.common.SupportsConcurrentExecutionAttempts;\\n23: \\n24: /**\\n25: * A stream sink that ignores all elements.\\n26: *\\n27: * @param <T> The type of elements received by the sink.\\n28: * @deprecated This interface will be removed in future versions. Use the new {@link\\n29: * org.apache.flink.streaming.api.functions.sink.v2.DiscardingSink} interface instead.\\n30: */\\n31: @Internal\\n32: public class DiscardingSink<T> implements SinkFunction<T>, SupportsConcurrentExecutionAttempts {\\n33: \\n34: private static final long serialVersionUID = 1L;\\n35: \\n36: @Override\\n37: public void invoke(T value) {}\\n38: }\\n39: \"}",
"structuredContent": {
"text": "URL: https://demo.sourcegraph.com/github.com/sg-evals/flink--0cc95fcc@031d3d0222a9018b36760a0fecf913a2359ae37c/-/blob/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/DiscardingSink.java\n1: /*\n2: * Licensed to the Apache Software Foundation (ASF) under one\n3: * or more contributor license agreements. See the NOTICE file\n4: * distributed with this work for additional information\n5: * regarding copyright ownership. The ASF licenses this file\n6: * to you under the Apache License, Version 2.0 (the\n7: * \"License\"); you may not use this file except in compliance\n8: * with the License. You may obtain a copy of the License at\n9: *\n10: * http://www.apache.org/licenses/LICENSE-2.0\n11: *\n12: * Unless required by applicable law or agreed to in writing, software\n13: * distributed under the License is distributed on an \"AS IS\" BASIS,\n14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n15: * See the License for the specific language governing permissions and\n16: * limitations under the License.\n17: */\n18: \n19: package org.apache.flink.streaming.api.functions.sink.legacy;\n20: \n21: import org.apache.flink.annotation.Internal;\n22: import org.apache.flink.api.common.SupportsConcurrentExecutionAttempts;\n23: \n24: /**\n25: * A stream sink that ignores all elements.\n26: *\n27: * @param <T> The type of elements received by the sink.\n28: * @deprecated This interface will be removed in future versions. Use the new {@link\n29: * org.apache.flink.streaming.api.functions.sink.v2.DiscardingSink} interface instead.\n30: */\n31: @Internal\n32: public class DiscardingSink<T> implements SinkFunction<T>, SupportsConcurrentExecutionAttempts {\n33: \n34: private static final long serialVersionUID = 1L;\n35: \n36: @Override\n37: public void invoke(T value) {}\n38: }\n39: "
}
}mcp__sourcegraph__sg_read_file @ -{
"repo": "github.com/sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/TwoPhaseCommitSinkFunction.java"
}{
"content": "{\"text\":\"URL: https://demo.sourcegraph.com/github.com/sg-evals/flink--0cc95fcc@031d3d0222a9018b36760a0fecf913a2359ae37c/-/blob/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/TwoPhaseCommitSinkFunction.java\\n1: /*\\n2: * Licensed to the Apache Software Foundation (ASF) under one or more\\n3: * contributor license agreements. See the NOTICE file distributed with\\n4: * this work for additional information regarding copyright ownership.\\n5: * The ASF licenses this file to You under the Apache License, Version 2.0\\n6: * (the \\\"License\\\"); you may not use this file except in compliance with\\n7: * the License. You may obtain a copy of the License at\\n8: *\\n9: * http://www.apache.org/licenses/LICENSE-2.0\\n10: *\\n11: * Unless required by applicable law or agreed to in writing, software\\n12: * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n14: * See the License for the specific language governing permissions and\\n15: * limitations under the License.\\n16: */\\n17: \\n18: package org.apache.flink.streaming.api.functions.sink.legacy;\\n19: \\n20: import org.apache.flink.annotation.Internal;\\n21: import org.apache.flink.annotation.VisibleForTesting;\\n22: import org.apache.flink.api.common.state.CheckpointListener;\\n23: import org.apache.flink.api.common.state.ListState;\\n24: import org.apache.flink.api.common.state.ListStateDescriptor;\\n25: import org.apache.flink.api.common.typeinfo.TypeHint;\\n26: import org.apache.flink.api.common.typeinfo.TypeInformation;\\n27: import org.apache.flink.api.common.typeutils.CompositeTypeSerializerSnapshot;\\n28: import org.apache.flink.api.common.typeutils.TypeSerializer;\\n29: import org.apache.flink.api.common.typeutils.TypeSerializerSnapshot;\\n30: import org.apache.flink.core.memory.DataInputView;\\n31: import org.apache.flink.core.memory.DataOutputView;\\n32: import org.apache.flink.runtime.state.FunctionInitializationContext;\\n33: import org.apache.flink.runtime.state.FunctionSnapshotContext;\\n34: import org.apache.flink.streaming.api.checkpoint.CheckpointedFunction;\\n35: import org.apache.flink.util.FlinkRuntimeException;\\n36: \\n37: import org.slf4j.Logger;\\n38: import org.slf4j.LoggerFactory;\\n39: \\n40: import javax.annotation.Nonnull;\\n41: import javax.annotation.Nullable;\\n42: \\n43: import java.io.IOException;\\n44: import java.time.Clock;\\n45: import java.util.AbstractMap;\\n46: import java.util.ArrayList;\\n47: import java.util.Collection;\\n48: import java.util.Collections;\\n49: import java.util.Iterator;\\n50: import java.util.LinkedHashMap;\\n51: import java.util.List;\\n52: import java.util.Map;\\n53: import java.util.Objects;\\n54: import java.util.Optional;\\n55: import java.util.stream.Stream;\\n56: \\n57: import static java.util.Objects.requireNonNull;\\n58: import static org.apache.flink.util.Preconditions.checkArgument;\\n59: import static org.apache.flink.util.Preconditions.checkNotNull;\\n60: import static org.apache.flink.util.Preconditions.checkState;\\n61: \\n62: /**\\n63: * This is a recommended base class for all of the {@link SinkFunction} that intend to implement\\n64: * exactly-once semantic. It does that by implementing two phase commit algorithm on top of the\\n65: * {@link CheckpointedFunction} and {@link CheckpointListener}. User should provide custom {@code\\n66: * TXN} (transaction handle) and implement abstract methods handling this transaction handle.\\n67: *\\n68: * @param <IN> Input type for {@link SinkFunction}.\\n69: * @param <TXN> Transaction to store all of the information required to handle a transaction.\\n70: * @param <CONTEXT> Context that will be shared across all invocations for the given {@link\\n71: * TwoPhaseCommitSinkFunction} instance. Context is created once\\n72: * @deprecated This interface will be removed in futur
...mcp__sourcegraph__sg_read_file @ -{
"repo": "github.com/sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/legacy/StreamingFileSink.java"
}{
"content": "{\"text\":\"URL: https://demo.sourcegraph.com/github.com/sg-evals/flink--0cc95fcc@031d3d0222a9018b36760a0fecf913a2359ae37c/-/blob/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/legacy/StreamingFileSink.java\\n1: /*\\n2: * Licensed to the Apache Software Foundation (ASF) under one\\n3: * or more contributor license agreements. See the NOTICE file\\n4: * distributed with this work for additional information\\n5: * regarding copyright ownership. The ASF licenses this file\\n6: * to you under the Apache License, Version 2.0 (the\\n7: * \\\"License\\\"); you may not use this file except in compliance\\n8: * with the License. You may obtain a copy of the License at\\n9: *\\n10: * http://www.apache.org/licenses/LICENSE-2.0\\n11: *\\n12: * Unless required by applicable law or agreed to in writing, software\\n13: * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n15: * See the License for the specific language governing permissions and\\n16: * limitations under the License.\\n17: */\\n18: \\n19: package org.apache.flink.streaming.api.functions.sink.filesystem.legacy;\\n20: \\n21: import org.apache.flink.annotation.Internal;\\n22: import org.apache.flink.annotation.VisibleForTesting;\\n23: import org.apache.flink.api.common.serialization.BulkWriter;\\n24: import org.apache.flink.api.common.serialization.Encoder;\\n25: import org.apache.flink.api.common.state.CheckpointListener;\\n26: import org.apache.flink.core.fs.FileSystem;\\n27: import org.apache.flink.core.fs.Path;\\n28: import org.apache.flink.runtime.state.FunctionInitializationContext;\\n29: import org.apache.flink.runtime.state.FunctionSnapshotContext;\\n30: import org.apache.flink.streaming.api.checkpoint.CheckpointedFunction;\\n31: import org.apache.flink.streaming.api.functions.sink.filesystem.BucketAssigner;\\n32: import org.apache.flink.streaming.api.functions.sink.filesystem.BucketFactory;\\n33: import org.apache.flink.streaming.api.functions.sink.filesystem.BucketWriter;\\n34: import org.apache.flink.streaming.api.functions.sink.filesystem.Buckets;\\n35: import org.apache.flink.streaming.api.functions.sink.filesystem.BulkBucketWriter;\\n36: import org.apache.flink.streaming.api.functions.sink.filesystem.DefaultBucketFactoryImpl;\\n37: import org.apache.flink.streaming.api.functions.sink.filesystem.OutputFileConfig;\\n38: import org.apache.flink.streaming.api.functions.sink.filesystem.RollingPolicy;\\n39: import org.apache.flink.streaming.api.functions.sink.filesystem.RowWiseBucketWriter;\\n40: import org.apache.flink.streaming.api.functions.sink.filesystem.StreamingFileSinkHelper;\\n41: import org.apache.flink.streaming.api.functions.sink.filesystem.bucketassigners.DateTimeBucketAssigner;\\n42: import org.apache.flink.streaming.api.functions.sink.filesystem.rollingpolicies.CheckpointRollingPolicy;\\n43: import org.apache.flink.streaming.api.functions.sink.filesystem.rollingpolicies.DefaultRollingPolicy;\\n44: import org.apache.flink.streaming.api.functions.sink.filesystem.rollingpolicies.OnCheckpointRollingPolicy;\\n45: import org.apache.flink.streaming.api.functions.sink.legacy.RichSinkFunction;\\n46: import org.apache.flink.streaming.api.functions.sink.legacy.SinkFunction;\\n47: import org.apache.flink.streaming.api.operators.StreamingRuntimeContext;\\n48: import org.apache.flink.util.Preconditions;\\n49: \\n50: import java.io.IOException;\\n51: import java.io.Serializable;\\n52: \\n53: /**\\n54: * Sink that emits its input elements to {@link FileSystem} files within buckets. This is integrated\\n55: * with the checkpointing mechanism to provide exactly once semantics.\\n56: *\\n57: * <p>When creating the sink a {@code basePath} must be specified. The base directory contains one\\n58: * directory for every bucket. The bucket directories themselves contain several part files, with a
...mcp__sourcegraph__sg_read_file @ -{
"repo": "github.com/sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/DataGeneratorSource.java"
}{
"content": "{\"text\":\"URL: https://demo.sourcegraph.com/github.com/sg-evals/flink--0cc95fcc@031d3d0222a9018b36760a0fecf913a2359ae37c/-/blob/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/DataGeneratorSource.java\\n1: /*\\n2: * Licensed to the Apache Software Foundation (ASF) under one\\n3: * or more contributor license agreements. See the NOTICE file\\n4: * distributed with this work for additional information\\n5: * regarding copyright ownership. The ASF licenses this file\\n6: * to you under the Apache License, Version 2.0 (the\\n7: * \\\"License\\\"); you may not use this file except in compliance\\n8: * with the License. You may obtain a copy of the License at\\n9: *\\n10: * http://www.apache.org/licenses/LICENSE-2.0\\n11: *\\n12: * Unless required by applicable law or agreed to in writing, software\\n13: * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n15: * See the License for the specific language governing permissions and\\n16: * limitations under the License.\\n17: */\\n18: \\n19: package org.apache.flink.streaming.api.functions.source.datagen;\\n20: \\n21: import org.apache.flink.annotation.Internal;\\n22: import org.apache.flink.api.common.functions.OpenContext;\\n23: import org.apache.flink.runtime.state.FunctionInitializationContext;\\n24: import org.apache.flink.runtime.state.FunctionSnapshotContext;\\n25: import org.apache.flink.streaming.api.checkpoint.CheckpointedFunction;\\n26: import org.apache.flink.streaming.api.functions.source.legacy.RichParallelSourceFunction;\\n27: \\n28: import org.slf4j.Logger;\\n29: import org.slf4j.LoggerFactory;\\n30: \\n31: import javax.annotation.Nullable;\\n32: \\n33: /**\\n34: * A data generator source that abstract data generator. It can be used to easy startup/test for\\n35: * streaming job and performance testing. It is stateful, re-scalable, possibly in parallel.\\n36: *\\n37: * @deprecated Use {@code org.apache.flink.connector.datagen.source.DataGeneratorSource} instead.\\n38: */\\n39: @Internal\\n40: public class DataGeneratorSource<T> extends RichParallelSourceFunction<T>\\n41: implements CheckpointedFunction {\\n42: \\n43: private static final long serialVersionUID = 1L;\\n44: \\n45: private static final Logger LOG = LoggerFactory.getLogger(DataGeneratorSource.class);\\n46: \\n47: private final DataGenerator<T> generator;\\n48: \\n49: private final long rowsPerSecond;\\n50: \\n51: @Nullable private final Long numberOfRows;\\n52: \\n53: private transient int outputSoFar;\\n54: \\n55: private transient int toOutput;\\n56: \\n57: transient volatile boolean isRunning;\\n58: \\n59: /**\\n60: * Creates a source that emits records by {@link DataGenerator} without controlling emit rate.\\n61: *\\n62: * @param generator data generator.\\n63: */\\n64: public DataGeneratorSource(DataGenerator<T> generator) {\\n65: this(generator, Long.MAX_VALUE, null);\\n66: }\\n67: \\n68: /**\\n69: * Creates a source that emits records by {@link DataGenerator}.\\n70: *\\n71: * @param generator data generator.\\n72: * @param rowsPerSecond Control the emit rate.\\n73: * @param numberOfRows Total number of rows to output.\\n74: */\\n75: public DataGeneratorSource(\\n76: DataGenerator<T> generator, long rowsPerSecond, @Nullable Long numberOfRows) {\\n77: this.generator = generator;\\n78: this.rowsPerSecond = rowsPerSecond;\\n79: this.numberOfRows = numberOfRows;\\n80: }\\n81: \\n82: @Override\\n83: public void open(OpenContext openContext) throws Exception {\\n84: super.open(openContext);\\n85: \\n86: if (numberOfRows != null) {\\n87: final int stepSize = getRuntimeContext().getTaskInfo().getNumberOfParallelSubtasks();\\n88:
...mcp__sourcegraph__sg_read_file @ -{
"repo": "github.com/sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/CollectionInputFormat.java"
}{
"content": "{\"text\":\"URL: https://demo.sourcegraph.com/github.com/sg-evals/flink--0cc95fcc@031d3d0222a9018b36760a0fecf913a2359ae37c/-/blob/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/CollectionInputFormat.java\\n1: /*\\n2: * Licensed to the Apache Software Foundation (ASF) under one\\n3: * or more contributor license agreements. See the NOTICE file\\n4: * distributed with this work for additional information\\n5: * regarding copyright ownership. The ASF licenses this file\\n6: * to you under the Apache License, Version 2.0 (the\\n7: * \\\"License\\\"); you may not use this file except in compliance\\n8: * with the License. You may obtain a copy of the License at\\n9: *\\n10: * http://www.apache.org/licenses/LICENSE-2.0\\n11: *\\n12: * Unless required by applicable law or agreed to in writing, software\\n13: * distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n14: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n15: * See the License for the specific language governing permissions and\\n16: * limitations under the License.\\n17: */\\n18: \\n19: package org.apache.flink.streaming.api.legacy.io;\\n20: \\n21: import org.apache.flink.api.common.io.GenericInputFormat;\\n22: import org.apache.flink.api.common.io.NonParallelInput;\\n23: import org.apache.flink.api.common.typeutils.TypeSerializer;\\n24: import org.apache.flink.core.io.GenericInputSplit;\\n25: import org.apache.flink.core.memory.DataInputViewStreamWrapper;\\n26: import org.apache.flink.core.memory.DataOutputViewStreamWrapper;\\n27: \\n28: import java.io.IOException;\\n29: import java.io.ObjectInputStream;\\n30: import java.io.ObjectOutputStream;\\n31: import java.util.ArrayList;\\n32: import java.util.Collection;\\n33: import java.util.Iterator;\\n34: import java.util.List;\\n35: \\n36: /** An input format that returns objects from a collection. */\\n37: public class CollectionInputFormat<T> extends GenericInputFormat<T> implements NonParallelInput {\\n38: \\n39: private static final long serialVersionUID = 1L;\\n40: private static final int MAX_TO_STRING_LEN = 100;\\n41: \\n42: private TypeSerializer<T> serializer;\\n43: \\n44: // input data as collection. transient, because it will be serialized in a custom way\\n45: private transient Collection<T> dataSet;\\n46: \\n47: private transient Iterator<T> iterator;\\n48: \\n49: public CollectionInputFormat(Collection<T> dataSet, TypeSerializer<T> serializer) {\\n50: if (dataSet == null) {\\n51: throw new NullPointerException();\\n52: }\\n53: \\n54: this.serializer = serializer;\\n55: \\n56: this.dataSet = dataSet;\\n57: }\\n58: \\n59: @Override\\n60: public boolean reachedEnd() throws IOException {\\n61: return !this.iterator.hasNext();\\n62: }\\n63: \\n64: @Override\\n65: public void open(GenericInputSplit split) throws IOException {\\n66: super.open(split);\\n67: \\n68: this.iterator = this.dataSet.iterator();\\n69: }\\n70: \\n71: @Override\\n72: public T nextRecord(T record) throws IOException {\\n73: return this.iterator.next();\\n74: }\\n75: \\n76: // --------------------------------------------------------------------------------------------\\n77: \\n78: private void writeObject(ObjectOutputStream out) throws IOException {\\n79: out.defaultWriteObject();\\n80: \\n81: final int size = dataSet.size();\\n82: out.writeInt(size);\\n83: \\n84: if (size > 0) {\\n85: DataOutputViewStreamWrapper wrapper = new DataOutputViewStreamWrapper(out);\\n86: for (T element : dataSet) {\\n87: serializer.serialize(element, wrapper);\\n88: }\\n89: }\\n90: }\\n91: \\n92: private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {\\n93: in.defau
...mcp__sourcegraph__sg_keyword_search @ -{
"query": "@Deprecated class repo:^github.com/sg-evals/flink--0cc95fcc$ file:flink-streaming-java/src/main/"
}{
"content": "{\"text\":\"# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextOutputFormat.java\\n41: */\\n42: @Deprecated\\n43: @PublicEvolving\\n44: public class TextOutputFormat<T> extends FileOutputFormat<T> {\\n45: \\n46: \\n36: *\\n37: * @deprecated If you want to read/write data from/to text file, please use FLIP-27 FileSource and\\n38: * Sink-V2 FlinkSink. This class should be removed if we drop all supports for {@link\\n39: * org.apache.flink.api.common.io.InputFormat} and {@link\\n40: \\n\\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextInputFormat.java\\n36: */\\n37: @Deprecated\\n38: @PublicEvolving\\n39: public class TextInputFormat extends DelimitedInputFormat<String> {\\n40: \\n41: \\n32: *\\n33: * @deprecated If you want to read/write data from/to text file, please use FLIP-27 FileSource and\\n34: * Sink-V2 FlinkSink. This class should be removed if we drop the supports for read/write via\\n35: * input/output format in DataStream api.\\n36: \\n\\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/DiscardingSink.java\\n27: * @param <T> The type of elements received by the sink.\\n28: * @deprecated This interface will be removed in future versions. Use the new {@link\\n29: * org.apache.flink.streaming.api.functions.sink.v2.DiscardingSink} interface instead.\\n30: \\n31: @Internal\\n32: public class DiscardingSink<T> implements SinkFunction<T>, SupportsConcurrentExecutionAttempts {\\n33: \\n34: \\n\\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/AscendingTimestampExtractor.java\\n36: */\\n37: @Deprecated\\n38: @PublicEvolving\\n39: public abstract class AscendingTimestampExtractor<T>\\n40: implements WatermarkStrategyWithPeriodicWatermarks<T> {\\n41: \\n136: private static final Logger LOG =\\n137: LoggerFactory.getLogger(AscendingTimestampExtractor.class);\\n138: \\n139: \\n118: /** Handler that fails the program when timestamp monotony is violated. */\\n119: public static final class FailingHandler implements MonotonyViolationHandler {\\n120: private static final long serialVersionUID = 1L;\\n121: \\n\\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/DataGeneratorSource.java\\n39: @Internal\\n40: public class DataGeneratorSource<T> extends RichParallelSourceFunction<T>\\n41: implements CheckpointedFunction {\\n42: \\n44: \\n45: private static final Logger LOG = LoggerFactory.getLogger(DataGeneratorSource.class);\\n46: \\n47: \\n36: *\\n37: * @deprecated Use {@code org.apache.flink.connector.datagen.source.DataGeneratorSource} instead.\\n38: */\\n39: \\n\\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/legacy/StreamingFileSink.java\\n273: Preconditions.checkState(\\n274: bucketFactory.getClass() == DefaultBucketFactoryImpl.class,\\n275: \\\"newBuilderWithBucketAssignerAndPolicy() cannot be called after specifying a customized bucket factory\\\");\\n276: \\n420: Preconditions.checkState(\\n421: bucketFactory.getClass() == DefaultBucketFactoryImpl.class,\\n422: \\\"newBuilderWithBucketAssigner() cannot be called after specifying a customized bucket factory\\\");\\n423: \\n335: @Internal\\n336: public static class BulkFormatBuilder<\\n337: IN, BucketID, T extends BulkFormatBuilder<IN, BucketID, T>>\\n338: \\n\\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/l
...mcp__sourcegraph__sg_keyword_search @ -{
"query": "deprecated SinkFunction SourceFunction repo:^github.com/sg-evals/flink--0cc95fcc$ file:flink-streaming-java/src/main/"
}{
"content": "{\"text\":\"No results.\\n\\nNo results found.\"}",
"structuredContent": {
"text": "No results.\n\nNo results found."
}
}mcp__sourcegraph__sg_list_files @ -{
"repo": "github.com/sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy"
}{
"content": "{\"text\":\"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/DiscardingSink.java\\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/TwoPhaseCommitSinkFunction.java\\n\"}",
"structuredContent": {
"text": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/DiscardingSink.java\nflink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/TwoPhaseCommitSinkFunction.java\n"
}
}mcp__sourcegraph__sg_keyword_search @ -{
"query": "@Deprecated repo:^github.com/sg-evals/flink--0cc95fcc$ file:flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/"
}{
"content": "{\"text\":\"# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/DiscardingSink.java\\n27: * @param <T> The type of elements received by the sink.\\n28: * @deprecated This interface will be removed in future versions. Use the new {@link\\n29: * org.apache.flink.streaming.api.functions.sink.v2.DiscardingSink} interface instead.\\n30: \\n\\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/DataGeneratorSource.java\\n36: *\\n37: * @deprecated Use {@code org.apache.flink.connector.datagen.source.DataGeneratorSource} instead.\\n38: */\\n39: \\n\\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/TwoPhaseCommitSinkFunction.java\\n71: * TwoPhaseCommitSinkFunction} instance. Context is created once\\n72: * @deprecated This interface will be removed in future versions. Use the new {@link\\n73: * org.apache.flink.api.connector.sink2.Sink} interface instead.\\n74: \\n\\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/AscendingTimestampExtractor.java\\n36: */\\n37: @Deprecated\\n38: @PublicEvolving\\n39: \\n\\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/legacy/StreamingFileSink.java\\n97: * @param <IN> Type of the elements emitted by this sink\\n98: * @deprecated Use {@link org.apache.flink.connector.file.sink.FileSink} instead.\\n99: */\\n100: \\n\"}",
"structuredContent": {
"text": "# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/DiscardingSink.java\n27: * @param <T> The type of elements received by the sink.\n28: * @deprecated This interface will be removed in future versions. Use the new {@link\n29: * org.apache.flink.streaming.api.functions.sink.v2.DiscardingSink} interface instead.\n30: \n\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/DataGeneratorSource.java\n36: *\n37: * @deprecated Use {@code org.apache.flink.connector.datagen.source.DataGeneratorSource} instead.\n38: */\n39: \n\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/TwoPhaseCommitSinkFunction.java\n71: * TwoPhaseCommitSinkFunction} instance. Context is created once\n72: * @deprecated This interface will be removed in future versions. Use the new {@link\n73: * org.apache.flink.api.connector.sink2.Sink} interface instead.\n74: \n\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/AscendingTimestampExtractor.java\n36: */\n37: @Deprecated\n38: @PublicEvolving\n39: \n\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/legacy/StreamingFileSink.java\n97: * @param <IN> Type of the elements emitted by this sink\n98: * @deprecated Use {@link org.apache.flink.connector.file.sink.FileSink} instead.\n99: */\n100: \n"
}
}mcp__sourcegraph__sg_keyword_search @ -{
"query": "@Deprecated repo:^github.com/sg-evals/flink--0cc95fcc$ file:flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/"
}{
"content": "{\"text\":\"No results.\\n\\nNo results found.\"}",
"structuredContent": {
"text": "No results.\n\nNo results found."
}
}mcp__sourcegraph__sg_keyword_search @ -{
"query": "@Deprecated repo:^github.com/sg-evals/flink--0cc95fcc$ file:flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/"
}{
"content": "{\"text\":\"No results.\\n\\nNo results found.\"}",
"structuredContent": {
"text": "No results.\n\nNo results found."
}
}mcp__sourcegraph__sg_keyword_search @ -{
"query": "@Deprecated repo:^github.com/sg-evals/flink--0cc95fcc$ file:flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/"
}{
"content": "{\"text\":\"# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextInputFormat.java\\n32: *\\n33: * @deprecated If you want to read/write data from/to text file, please use FLIP-27 FileSource and\\n34: * Sink-V2 FlinkSink. This class should be removed if we drop the supports for read/write via\\n35: \\n36: */\\n37: @Deprecated\\n38: @PublicEvolving\\n39: \\n\\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextOutputFormat.java\\n36: *\\n37: * @deprecated If you want to read/write data from/to text file, please use FLIP-27 FileSource and\\n38: * Sink-V2 FlinkSink. This class should be removed if we drop all supports for {@link\\n39: \\n41: */\\n42: @Deprecated\\n43: @PublicEvolving\\n44: \\n\"}",
"structuredContent": {
"text": "# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextInputFormat.java\n32: *\n33: * @deprecated If you want to read/write data from/to text file, please use FLIP-27 FileSource and\n34: * Sink-V2 FlinkSink. This class should be removed if we drop the supports for read/write via\n35: \n36: */\n37: @Deprecated\n38: @PublicEvolving\n39: \n\n# github.com/sg-evals/flink--0cc95fcc – flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextOutputFormat.java\n36: *\n37: * @deprecated If you want to read/write data from/to text file, please use FLIP-27 FileSource and\n38: * Sink-V2 FlinkSink. This class should be removed if we drop all supports for {@link\n39: \n41: */\n42: @Deprecated\n43: @PublicEvolving\n44: \n"
}
}mcp__sourcegraph__sg_keyword_search @ -{
"query": "@Deprecated repo:^github.com/sg-evals/flink--0cc95fcc$ file:flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/"
}{
"content": "{\"text\":\"No results.\\n\\nNo results found.\"}",
"structuredContent": {
"text": "No results.\n\nNo results found."
}
}Write @ -{
"file_path": "/workspace/answer.json",
"content": "{\n \"files\": [\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/AscendingTimestampExtractor.java\"\n },\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextInputFormat.java\"\n },\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextOutputFormat.java\"\n },\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/DiscardingSink.java\"\n },\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/TwoPhaseCommitSinkFunction.java\"\n },\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/legacy/StreamingFileSink.java\"\n },\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/DataGeneratorSource.java\"\n }\n ],\n \"symbols\": [\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/AscendingTimestampExtractor.java\",\n \"symbol\": \"AscendingTimestampExtractor\"\n },\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextInputFormat.java\",\n \"symbol\": \"TextInputFormat\"\n },\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextOutputFormat.java\",\n \"symbol\": \"TextOutputFormat\"\n },\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/DiscardingSink.java\",\n \"symbol\": \"DiscardingSink\"\n },\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/TwoPhaseCommitSinkFunction.java\",\n \"symbol\": \"TwoPhaseCommitSinkFunction\"\n },\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/legacy/StreamingFileSink.java\",\n \"symbol\": \"StreamingFileSink\"\n },\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/DataGeneratorSource.java\",\n \"symbol\": \"DataGeneratorSource\"\n }\n ],\n \"text\": \"Found 7 deprecated DataStream API classes in sg-evals/flink--0cc95fcc under flink-streaming-java/src/main/:\\n\\n**Timestamp Extractors:**\\n1. `AscendingTimestampExtractor` (flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/AscendingTimestampExtractor.java) — Has `@Deprecated` annotation. A timestamp assigner and watermark generator for monotonically ascending timestamps. No explicit replacement noted in Javadoc, but implements WatermarkStrategyWithPeriodicWatermarks.\\n\\n**I/O Format Classes:**\\n2. `TextInputFormat` (flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextInputFormat.java) — Has `@Deprecated` annotation. Replacement: FLIP-27 FileSource. Reads text files, each line as one element.\\n3. `TextOutputFormat` (flink-streaming-java/src/main/java/org/apache/flink/s
...{
"type": "create",
"filePath": "/workspace/answer.json",
"content": "{\n \"files\": [\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/AscendingTimestampExtractor.java\"\n },\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextInputFormat.java\"\n },\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextOutputFormat.java\"\n },\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/DiscardingSink.java\"\n },\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/TwoPhaseCommitSinkFunction.java\"\n },\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/legacy/StreamingFileSink.java\"\n },\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/DataGeneratorSource.java\"\n }\n ],\n \"symbols\": [\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/AscendingTimestampExtractor.java\",\n \"symbol\": \"AscendingTimestampExtractor\"\n },\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextInputFormat.java\",\n \"symbol\": \"TextInputFormat\"\n },\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextOutputFormat.java\",\n \"symbol\": \"TextOutputFormat\"\n },\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/DiscardingSink.java\",\n \"symbol\": \"DiscardingSink\"\n },\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/TwoPhaseCommitSinkFunction.java\",\n \"symbol\": \"TwoPhaseCommitSinkFunction\"\n },\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/legacy/StreamingFileSink.java\",\n \"symbol\": \"StreamingFileSink\"\n },\n {\n \"repo\": \"sg-evals/flink--0cc95fcc\",\n \"path\": \"flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/DataGeneratorSource.java\",\n \"symbol\": \"DataGeneratorSource\"\n }\n ],\n \"text\": \"Found 7 deprecated DataStream API classes in sg-evals/flink--0cc95fcc under flink-streaming-java/src/main/:\\n\\n**Timestamp Extractors:**\\n1. `AscendingTimestampExtractor` (flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/AscendingTimestampExtractor.java) — Has `@Deprecated` annotation. A timestamp assigner and watermark generator for monotonically ascending timestamps. No explicit replacement noted in Javadoc, but implements WatermarkStrategyWithPeriodicWatermarks.\\n\\n**I/O Format Classes:**\\n2. `TextInputFormat` (flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextInputFormat.java) — Has `@Deprecated` annotation. Replacement: FLIP-27 FileSource. Reads text files, each line as one element.\\n3. `TextOutputFormat` (flink-streaming-java/src/main/java
.../workspace/answer.json{
"files": [
{
"repo": "sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/AscendingTimestampExtractor.java"
},
{
"repo": "sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextInputFormat.java"
},
{
"repo": "sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextOutputFormat.java"
},
{
"repo": "sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/DiscardingSink.java"
},
{
"repo": "sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/TwoPhaseCommitSinkFunction.java"
},
{
"repo": "sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/legacy/StreamingFileSink.java"
},
{
"repo": "sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/DataGeneratorSource.java"
}
],
"symbols": [
{
"repo": "sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/AscendingTimestampExtractor.java",
"symbol": "AscendingTimestampExtractor"
},
{
"repo": "sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextInputFormat.java",
"symbol": "TextInputFormat"
},
{
"repo": "sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextOutputFormat.java",
"symbol": "TextOutputFormat"
},
{
"repo": "sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/DiscardingSink.java",
"symbol": "DiscardingSink"
},
{
"repo": "sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/TwoPhaseCommitSinkFunction.java",
"symbol": "TwoPhaseCommitSinkFunction"
},
{
"repo": "sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/filesystem/legacy/StreamingFileSink.java",
"symbol": "StreamingFileSink"
},
{
"repo": "sg-evals/flink--0cc95fcc",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/datagen/DataGeneratorSource.java",
"symbol": "DataGeneratorSource"
}
],
"text": "Found 7 deprecated DataStream API classes in sg-evals/flink--0cc95fcc under flink-streaming-java/src/main/:\n\n**Timestamp Extractors:**\n1. `AscendingTimestampExtractor` (flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/timestamps/AscendingTimestampExtractor.java) — Has `@Deprecated` annotation. A timestamp assigner and watermark generator for monotonically ascending timestamps. No explicit replacement noted in Javadoc, but implements WatermarkStrategyWithPeriodicWatermarks.\n\n**I/O Format Classes:**\n2. `TextInputFormat` (flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextInputFormat.java) — Has `@Deprecated` annotation. Replacement: FLIP-27 FileSource. Reads text files, each line as one element.\n3. `TextOutputFormat` (flink-streaming-java/src/main/java/org/apache/flink/streaming/api/legacy/io/TextOutputFormat.java) — Has `@Deprecated` annotation. Replacement: Sink-V2 FlinkSink. Writes objects to text files.\n\n**Sink Functions:**\n4. `DiscardingSink` (flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/legacy/Discar...No bash commands.