Skip to content

Solve issue #1 #5

Merged
JEnoch merged 14 commits into
eclipse-zenoh:masterfrom
atolab:master
Apr 16, 2020
Merged

Solve issue #1 #5
JEnoch merged 14 commits into
eclipse-zenoh:masterfrom
atolab:master

Conversation

@kydos

@kydos kydos commented Apr 15, 2020

Copy link
Copy Markdown
Member

No description provided.

Comment thread examples/zenoh-net/src/main/java/ZNStream.java Outdated
Comment thread examples/zenoh-net/src/main/java/ZNWrite.java Outdated
Comment thread examples/zenoh/README.md
Comment thread examples/zenoh/README.md
Comment thread zenoh/src/main/java/org/eclipse/zenoh/Workspace.java Outdated
Comment thread zenoh/src/main/java/org/eclipse/zenoh/Workspace.java Outdated
Comment thread zenoh/src/main/java/org/eclipse/zenoh/Workspace.java Outdated

@kydos kydos left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes are avoiding the creation of temporary path and value objects when writing primitive types with a string path.

@kydos kydos left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uniform help and resources for ZN examples.

@JEnoch
JEnoch merged commit 7178f01 into eclipse-zenoh:master Apr 16, 2020
milyin added a commit that referenced this pull request Jul 16, 2026
…485)

* Encoding: native handle where it is born, value where it is cheapest

Minimize JNI crossings for every encoding flow (consumes zenoh-flat-jni
PR #5):

- Predefined constants stay VALUE-ONLY: a send carries just their id
  inside the send call itself — no native handle ever exists for them,
  no extra crossing.
- Custom (schema-carrying) encodings create their native handle at
  construction — the one natural crossing — and every send after passes
  a bare jlong (borrowed and cloned natively, reusable forever).
- Received encodings (sample/query/reply) arrive send-ready: the
  delivery decomposition now includes the owned handle, so the
  save-and-republish scenario never rebuilds the native value from its
  schema string. Handle release is GC-managed (EncodingCleaner in the
  shared tier); Encoding stays a plain non-closeable value with
  unchanged (id, schema) equality/rendering.

Send call sites drive the generated encoding selector block through the
internal Encoding?.jniSel/jniId/jniSchema/jniHandle helpers — one flat
call, zero extra crossings in every case.

New EncodingHandleTest covers the ownership model end-to-end; 110 jvm
tests green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Lifecycle backstops moved into the gc_managed JNI tier

zenoh-flat-jni's Encoding, Session, Publisher, Subscriber, Queryable,
Querier, Scout, LivelinessToken and Query handles are now gc_managed
(milyin/prebindgen#82): a shared Cleaner frees an unreachable handle
whose owner never released it, with explicit close/undeclare settling
the release ticket first.

Delete the 8 deprecated-for-removal finalize() nets (JEP 421) — the JNI
handle is its own backstop now — and drop Encoding's EncodingCleaner
registration (superseded by the gc_managed class; the hand-written
helper is deleted in zenoh-flat-jni).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* CI: bump zenoh-flat-jni pin to the merged encoding-handle commit

The encoding selector wire shape and gc_managed lifecycles this branch
consumes landed in ZettaScaleLabs/zenoh-flat-jni#5 (e802317); the old
pin predates it, so CI compiled against the previous
(present, id, schema) encoding signatures.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants