feat: JFR events for open, HTTP range, segment decode/encode, chunk filtering and writer back-pressure
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- java
- 領域
- backend, observability
調査の方向性
Start by reading the reader and writer entry points named in the issue: VortexReader.open, VortexHttpReader.open, SerializedArrayDecoder.decode, ScanIterator, and VortexWriter. Add the JFR event classes and wire them into those paths as specified, then use the named tests to check event fields, filtering counts, and back-pressure duration. Done when the event tests pass and the reference guide, how-to guide, changelog, and module map are updated.
索引モデルが issue の本文から書いたものです。
説明
Goal
Emit JDK Flight Recorder events from the reader and writer, so a JFR recording shows where a read or write spends its time (file open/mapping, HTTP range fetches, per-segment decode/encode, chunk pruning, writer back-pressure) with no extra dependency and near-zero cost when recording is off.
Events
New package core/src/main/java/io/github/dfa1/vortex/core/jfr/ (with package-info.java). Each event is a public class extending jdk.jfr.Event, annotated @Name("io.github.dfa1.vortex.X"), @Label, @Category({"Vortex", …}), @Description and @StackTrace(false). Public fields get /// docs (doclint is all); byte sizes get @DataAmount.
| Class | Category | Fields |
|---|---|---|
FileOpenedEvent |
I/O | source, fileSize, formatVersion, segmentCount |
FileMappingEvent |
I/O | file, size |
HttpRangeEvent |
I/O | source, offset (-1 = tail), length, status (0 = no response) |
SegmentDecodedEvent |
Decode | encoding, rowCount, segmentSize |
ChunkFilterEvent |
Filter | totalChunks, chunksPruned, chunksWithoutMatch, chunksReturned, rowsReturned |
SegmentEncodedEvent |
Encode | encoding, bufferCount, encodedSize |
SegmentWaitEvent |
Pipeline | segmentsInFlight |
Reader wiring
Pattern: event.begin(), set fields, commit().
VortexReader.open(path, registry, layoutRegistry):FileOpenedspans the whole open and is committed after parse;FileMappingwrapschannel.map. A failed open emits noFileOpened.VortexHttpReader.open(uri, registry, layoutRegistry, client):FileOpenedbegins beforefetchTailand is committed after the reader is built.- New private
sendRange(req, client, uri, offset, length)wrapsclient.sendin try/finally and always commitsHttpRange, withstatus = 0on failure.fetchTailcalls it with offset-1andTAIL_SIZE.bytes();fetchRangewithfromandto - from + 1. - New package-private
static String describe(URI)returningscheme://host[:port]+ raw path. It drops user info, query and fragment, because presigned URLs carry credentials. Used for everysourcefield.
- New private
SerializedArrayDecoder.decode: begin at the top; afterregistry.decode(ctx)setencoding = node.encodingId().id(),rowCount,segmentSize = segLen, then commit. Covers both readers.ScanIterator:- New counters
chunksPruned,chunksWithoutMatch,chunksReturned. - In
hasNext(), splitcanPruneChunk(...) || !selectMatchingRows(...)into two branches that each count,chunkIndex++; continue. - Increment
chunksReturnedinnext(). close()callsemitChunkFilterEvent(), a no-op whenfilter == null || chunks == null.
- New counters
Writer wiring (VortexWriter)
encodeSegment: begin at the top; before returning,if (event.shouldCommit())fillencodingfromresult.rootNode().encodingId().id(),bufferCount,encodedSize, then commit. Failures emit nothing.drainSegments: replacepending.poll().join()with a staticawaitHead(head, pending.size() + 1). It joins directly ifhead.isDone(); otherwise begins aSegmentWaitEvent, joins in atry, commits in thefinally.- No change to the writer's default behavior. (The default executor runs tasks on the caller, so
SegmentWaitnever appears there.)
Tests
Given/When/Then throughout. For events committed on other threads, assert presence and field values, never exact counts.
core/src/test/.../core/testing/JfrRecorderTest.java: abstract base; aRecordingStreamwithsetReuse(false)starts in@BeforeEach; offersawaitEvents()andevents(name).- reader
VortexReaderJfrTest(fixtureprimitives.vortex):FileOpenedandFileMappingfields; a too-small file emits noFileOpened. - reader
VortexHttpReaderJfrTest(mockedHttpClient): tailHttpRange(offset -1, status 206);sourcehas no credentials or query; status 0 whensendthrowsIOException. - writer
JfrEventsTest(usesLegacyZoneMaps.OPTIONS, same package):SegmentEncodedpresent with non-negative sizes (avortex.sequencesegment has 0 buffers).- Default executor: no
SegmentWait. - Executor sleeping 200 ms before each task:
SegmentWaitduration > 50 ms andsegmentsInFlight> 0. - Chunks 1..50, 51..100, 101..150 with
eq(id, 75)→ totals 3/2/0/1 and 1 row. - Single chunk {1, 100} with
eq(id, 50)→ 1/0/1/0 and 0 rows. - Unfiltered scan emits no
ChunkFilter.
Docs (same commit)
docs/reference.md: "JFR events" section (event table) + TOC entry.docs/how-to.md: "Find where a read or write spends its time (JFR)".CHANGELOG.md:## [Unreleased]→ Added.AGENTS.md:core.jfrline in the module map.
Verify
./mvnw test -pl core,reader,writer -am./mvnw verify -DskipTests(Javadoc lint + checkstyle)
- 主要言語
- Java
- スター
- 3
- フォーク
- 2
- 平均マージ
- 9時間 47分
- マージ済み PR(30日)
- 128
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dfa1/vortex-java のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
dfa1/vortex-java#636 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 70/100
dfa1/vortex-java#655 ·
メンテナーはふだん 1 日以内に返信
-
perf
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
dfa1/vortex-java#651 ·
メンテナーはふだん 1 日以内に返信
-
Writer: string columns written as per-chunk dicts where Rust uses its dict layout (up to 2x larger)オープンperf
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
dfa1/vortex-java#650 ·
メンテナーはふだん 1 日以内に返信
-
perf
難易度 4/5 3〜5日 初心者へのやさしさ 28/100
dfa1/vortex-java#649 ·
メンテナーはふだん 1 日以内に返信
dfa1/vortex-java の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
wildfly/wildfly-channel#446 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
5.0.x backport enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
spring-cloud/spring-cloud-function#1507 ·
メンテナーはふだん 1 日以内に返信
-
Empty blood pressure handled as “null” string in exam edit対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
open-learning-exchange/myplanet#18484 ·
メンテナーはふだん 1 日以内に返信
-
ELProcessor.defineFunction() fails for valid method signatures対応中かも @RaphaelFakhri が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
jakartaee/expression-language#492 ·