Repository navigation
Conversation
|
QA tests have started for PR 1508. This patch merges cleanly. |
|
Nice one Jerry! this actually enables using Kafka with non-String data in Java. |
|
QA results for PR 1508: |
|
It's the MIMA test that fails, since the method signature is changed. It's possible to keep and deprecate the existing method of course. Should we just do that, or OK to remove the method on the grounds that the API doesn't quite work? |
|
Jenkins, test this please. |
|
QA tests have started for PR 1508. This patch merges cleanly. |
|
LGTM. I am okay with the binary compatibility change, since it is really wrong that we were using manifest instead of classtags. But I am not sure I really understand what is the reason behind the failure of the |
|
Oh, please add the appropriate exclude in the Mima exclusions See the error in the jenkins console output for the exact exception string that you need to add. |
|
QA results for PR 1508: |
|
This failure is unrelated to this patch. Its a current known issue in Jenkins, will run the test again when this error gets cleared. |
|
Hi TD, thanks for your review. I think the previous issue is that: implicit val keyCmd: Manifest[U] = implicitly[Manifest[AnyRef]].asInstanceOf[Manifest[U]]This line of code cannot actually get the correct runtime class, the runtime class of Because we only got val keyDecoder = manifest[U].runtimeClass.getConstructor(classOf[VerifiableProperties])The right way is like this: implicit val keyCmd: Manifest[U] = Manifest.classType(keyDecodeClass)Manifest can also do the same thing if we correctly feed it with class info. But I think it would be better to change Manifest to ClassTag to keep align with other code, so I changed to use ClassTag. I will add this to Mima exclude. Thanks a lot. |
|
I get it now. Let me try to run the Jenkins once again, to figure out what needs to be added to Mima |
|
Jenkins, test this please. |
|
QA tests have started for PR 1508. This patch merges cleanly. |
|
QA results for PR 1508: |
|
Again, this is an unrelated failure. Running it again. |
|
Jenkins, test this please. |
|
QA tests have started for PR 1508. This patch merges cleanly. |
|
QA results for PR 1508: |
|
Can you add these to the Mima excludes. The last one should not be necessary as it is not a public class. Let me look into this. No harm in adding the exclusion though. |
|
QA tests have started for PR 1508. This patch DID NOT merge cleanly! |
|
@jerryshao Oops, not sure how that is possible given what this patch touches. Can you merge with master nonetheless. |
|
Ok, I will update the code. |
…ecoder construct issue when using Java API
|
QA tests have started for PR 1508. This patch merges cleanly. |
|
QA results for PR 1508: |
|
QA results for PR 1508: |
|
OK, this is very confusing, sequence of two results is very confusing. Let me run the tests again. |
|
Jenkins, test this again. |
|
Jenkins, test this please. |
|
QA tests have started for PR 1508. This patch merges cleanly. |
|
A bunch of tests have been failing spuriously with "java.net.BindException: Address already in use". It's not the PR. I wonder what recent change could have made this happen? Is something being stricter about assigning a fixed port? did a config change to let multiple tests run on the same virtual machine? |
|
Also, a number of them have been failing for spurious python mllib issues. At least was the case yesterday. |
|
QA results for PR 1508: |
|
Heyyyaa, it finally passed. I am merging this. Thanks @jerryshao |
…fix reflection issue This PR updates previous Manifest for KafkaInputDStream's Decoder to ClassTag, also fix the problem addressed in [SPARK-2103](https://issues.apache.org/jira/browse/SPARK-2103). Previous Java interface cannot actually get the type of Decoder, so when using this Manifest to reconstruct the decode object will meet reflection exception. Also for other two Java interfaces, ClassTag[String] is useless because calling Scala API will get the right implicit ClassTag. Current Kafka unit test cannot actually verify the interface. I've tested these interfaces in my local and distribute settings. Author: jerryshao <saisai.shao@intel.com> Closes apache#1508 from jerryshao/SPARK-2103 and squashes the following commits: e90c37b [jerryshao] Add Mima excludes 7529810 [jerryshao] Change Manifest to ClassTag for KafkaInputDStream's Decoder and fix Decoder construct issue when using Java API
|
I'm not sure if this is the exactly same issue, but I am experience this with Spark 1.2.1 and Scala 2.10.4 also. |
|
Hi @salex89 , seems your exception is a little different to this PR, maybe I need a careful look at this exception, thanks for your reporting. |
|
@jerryshao |
|
Yeah, please do it and describe it in detail so we can easily reproduce it. |
…locks.enabled` by default (apache#1508) ### What changes were proposed in this pull request? rdar://99068608 (SPARK-40198 Enable `spark.storage.decommission.(rdd|shuffle)Blocks.enabled` by default) This PR aims to enable the following two configurations by default. Note that these storage configurations are disabled by default by the parent configuration, `spark.storage.decommission.enabled`, still. In addition, all decommission features including this storage decommissioning are disabled by `spark.decommission.enabled` by default. - `spark.storage.decommission.rddBlocks.enabled` - `spark.storage.decommission.shuffleBlocks.enabled` ### Why are the changes needed? This will help users use the storage decommissioning feature more easily. ### Does this PR introduce _any_ user-facing change? Yes, this will reduce the number of required configurations for decommission users. However, these two configurations are disabled by two configurations still. ### How was this patch tested? Pass the CIs.
### What changes were proposed in this pull request? Two new cells in the operator census (`VarkaOperatorCensusCatalog`, `VarkaOperatorCensusProbe`), at 128 bits only. The census forks one JVM per operator and width and reads, from C2's inlining decisions, whether the operator's loop compiles to vector code (`I`), compiles but allocates (`I+A`), or falls back to the Vector API's Java implementation (`F`). - `int.I2B_store64_masked` is the store Varka's emitter writes for a `TINYINT` result in a kernel driven at four int lanes. A byte has no 32-bit species, so each int group's `I2B` fills the low half of a `ByteVector.SPECIES_64` vector. That vector is stored with `intoMemorySegment` under `SPECIES_64.indexInRange(0, lanes)`, because its upper four lanes belong to the next group, and the last group has no next group to write over them. `lanes` is read at run time, as the kernel holds it in a local, so C2 cannot fold the mask to a constant. The cell is anchored on `VectorSupport::storeMasked`. - `int.I2B_store64_combined` is the control, and the store form a fix would use. Two groups' `I2B` results, at parts 0 and -1, are OR-ed into one 64-bit byte vector and stored whole with no mask. It is anchored on `VectorSupport::store`. Both loops write into a native byte buffer mapped once a call, as a kernel maps its output once a batch. The laptop's `sql/varka/operator_census.json` is regenerated at its own flags. The only other changes in it are the JDK line (25.0.4.1 to 25.0.5) and, in three decimal-store cells at two widths, `binaryOp` and `broadcastInt` swapping places in the intrinsics list; no verdict or allocation figure of an existing cell moved. The cells' reading under `-XX:UseAVX=2` comes from a one-off fork of the probe with the suite's own flags and is recorded in `sql/varka/plans/m8/results/VARKA-603-census-avx2.txt`. The operator census table in `sql/varka/skills/vector-api-and-width.md` gains a row for the cells. Row 603 of `m8/PLAN.md` is marked started. | cell | laptop, own flags (AVX-512BW), 128 bits | laptop, `-XX:UseAVX=2`, 128 bits | |---|---|---| | `int.I2B_store64_masked` | `I`, 0.04 bytes a row | `F`, 20.04 bytes a row, `storeMasked failed to inline (intrinsic)` | | `int.I2B_store64_combined` | `I`, 0.04 bytes a row | `I`, 0.04 bytes a row | The 0.04 bytes a row is the output segment each call maps, about 40 bytes over 1024 rows. ### Why are the changes needed? On an AVX2 host such as the EPYC 7763 CI runners, at 128 bits, Varka's checked `TINYINT` multiply (`y1 * y2` under ANSI, `try_multiply(y1, y2)`) runs at about 135 M rows/s. The same host's other `TINYINT` stores run at 19 to 40 G rows/s. The cause is the masked byte store. When C2 intrinsifies `storeMasked`, it asks whether the CPU has `StoreVectorMasked` for 8 byte lanes. HotSpot's x86 backend answers no for every subword element type (byte, short) without AVX-512BW, at every vector size, and a masked store always needs the predicate. So C2 leaves the call in place, and the Vector API's out-of-line Java loop runs instead, boxing the vector and the mask every time. The mask itself (`indexPartiallyInUpperRange`) and everything else in the loop do compile. No census cell recorded this: the only masked-store cell was a long-lane decimal tail. The laptop has AVX-512BW, so it cannot show the refusal without `-XX:UseAVX=2`. These cells put the fact in the census per host. The emitter fix that follows can then point at a measured `F` for the masked form and a measured `I` for the form it switches to. The masked cell describes the host, not the emitter, so it stays `F` on AVX2 after the fix. The fix's evidence will be that kernels stop calling it. ### Does this PR introduce _any_ user-facing change? No. Test code, a generated census file, a results text and documentation only. ### How was this patch tested? - `VARKA_CENSUS_REGEN=true build/sbt 'catalyst/testOnly *VarkaOperatorCensusSuite'`: 8 tests passed (and again without `VARKA_CENSUS_REGEN` after the review fixes, comparing against the committed file), including `everyCellHasAVerdict`, which needs each cell's anchor among its loop's C2 decisions and no second species in a one-species fork. The new cells read `I` at 128 bits and `-` at 256 and 512. - Direct forks of the probe for both cells at `-XX:MaxVectorSize=16`, at the host's flags and under `-XX:UseAVX=2` (the table above; commands and deciding lines in the results text). In the masked cell's tree, `indexPartiallyInUpperRange` is `(intrinsic)`, so the mask was not constant-folded. - `dev/varka_regen_generated.sh --all` regenerated nothing. `python3 dev/varka_census.py --check` passes. `python3 dev/varka_push_check.py --lint` passes (pre-commit range, plan lint, quote check, census check, size, Error Prone, scalastyle, `dev/lint-java`). - Not yet read: the EPYC 7763 column, expected `F` for the masked cell and `I` for the control. It comes from the width-audit workflow's x86 census artifact, which a push touching `VarkaOperatorCensus*.java` triggers. One `/code-review high` pass: found 9 / fixed 6 / left 3 (fixed: control bound, plan rows, probe placement, runner paragraph, JDK line, row 603 state; left: no AVX2 test, PrintInlining only, segment mapped per call). Fixed: the combined control bounded to exactly 128 bits, since its two hard-coded parts fill the 64-bit vector only at four int lanes; both cells given the same plan rows; the new probe loops moved after the widening loads, not between them; the skills page's runner-difference paragraph now names the expected EPYC reading; its laptop JDK line updated; row 603 of `m8/PLAN.md` marked started with what this step built (the plan lint also requires it). Left, as trade-offs: - The `UseAVX=2` reading is recorded in a results text, not held by a test. The plan keeps the per-host census file at the host's own flags, and the EPYC run will hold the same fact natively. - The results text records the probe's `PrintInlining` decisions only. The `PrintIntrinsics`/`PrintCompilation` diagnosis of the emitted kernels belongs to the row's plan document, which lands separately. - The output segment is mapped once a call (0.04 bytes a row), as the decimal store cells and the kernels do, not cached in a static field. That keeps the cell's allocation comparable to a kernel's. One departure from the row's plan: it bounds both cells at 0 to 128 bits, and the control is bounded at exactly 128 here, since its two parts are hard-coded. The masked cell keeps 0 to 128: below 128 bits it still models the emitter's store at two int lanes, though the census does not run there today. Line count: 67 counted lines, by `dev/varka_msg_check.py`. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 5.5)
This PR updates previous Manifest for KafkaInputDStream's Decoder to ClassTag, also fix the problem addressed in SPARK-2103.
Previous Java interface cannot actually get the type of Decoder, so when using this Manifest to reconstruct the decode object will meet reflection exception.
Also for other two Java interfaces, ClassTag[String] is useless because calling Scala API will get the right implicit ClassTag.
Current Kafka unit test cannot actually verify the interface. I've tested these interfaces in my local and distribute settings.