You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "bmscomp (via GitHub)" <gi...@apache.org> on 2023/04/23 21:26:59 UTC
[GitHub] [kafka] bmscomp opened a new pull request, #13627: MINOR: simplify if else conditions in Uuid.compareTo
bmscomp opened a new pull request, #13627:
URL: https://github.com/apache/kafka/pull/13627
Replace `if else ` conditions with `Long.compare` for reducing verbosity
### Committer Checklist (excluded from commit message)
- [] Verify design and implementation
- [] Verify test coverage and CI build status
- [] Verify documentation (including upgrade notes)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: simplify if else conditions in Uuid.compareTo method [kafka]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13627:
URL: https://github.com/apache/kafka/pull/13627#issuecomment-2567257676
This PR is being marked as stale since it has not had any activity in 90 days. If you
would like to keep this PR alive, please leave a comment asking for a review. If the PR has
merge conflicts, update it with the latest from the base branch.
<p>
If you are having difficulty finding a reviewer, please reach out on the
[mailing list](https://kafka.apache.org/contact).
<p>
If this PR is no longer valid or desired, please feel free to close it. If no activity
occurs in the next 30 days, it will be automatically closed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18402: Use openJDK's implementation of comparison for org.apache.kafka.common.Uuid [kafka]
Posted by "bmscomp (via GitHub)" <gi...@apache.org>.
bmscomp commented on code in PR #13627:
URL: https://github.com/apache/kafka/pull/13627#discussion_r1903360183
##########
clients/src/main/java/org/apache/kafka/common/Uuid.java:
##########
@@ -151,19 +151,22 @@ private byte[] getBytesFromUuid() {
return uuidBytes.array();
}
+ /**
+ * Compares this Uuid with another given Uuid.
+ * <p>
+ * This implementation is taken from the compareTo method of the official java.util.UUID implementation.
Review Comment:
@ijuma Thanks so much for the review, please give me some time and I will come with my own optimisation, may be I need to stick on the early one I provided, I will update come back soon with some, I think I need some learnings to do this pull request and make it in a better shape
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: simplify if else conditions in Uuid.compareTo method [kafka]
Posted by "bmscomp (via GitHub)" <gi...@apache.org>.
bmscomp commented on PR #13627:
URL: https://github.com/apache/kafka/pull/13627#issuecomment-2568544362
@divijvaidya Do you think that this pull request worths a follow ? Please can you provide any feedback about it thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] bmscomp commented on pull request #13627: MINOR: simplify if else conditions in Uuid.compareTo method
Posted by "bmscomp (via GitHub)" <gi...@apache.org>.
bmscomp commented on PR #13627:
URL: https://github.com/apache/kafka/pull/13627#issuecomment-1627838038
@divijvaidya Sorry for this delay, I just rebased the branch right now
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18402: Optimise of comparison on org.apache.kafka.common.Uuid [kafka]
Posted by "bmscomp (via GitHub)" <gi...@apache.org>.
bmscomp commented on PR #13627:
URL: https://github.com/apache/kafka/pull/13627#issuecomment-2571801607
@ijuma I already updated the pull request and changed the title, I came with a new implementation that is far from the openJDJK one, I also made toList less verbose and also toArray
Please let me know if any comment
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18402: Use openJDK's implementation of comparison for org.apache.kafka.common.Uuid [kafka]
Posted by "ijuma (via GitHub)" <gi...@apache.org>.
ijuma commented on code in PR #13627:
URL: https://github.com/apache/kafka/pull/13627#discussion_r1903354618
##########
clients/src/main/java/org/apache/kafka/common/Uuid.java:
##########
@@ -151,19 +151,22 @@ private byte[] getBytesFromUuid() {
return uuidBytes.array();
}
+ /**
+ * Compares this Uuid with another given Uuid.
+ * <p>
+ * This implementation is taken from the compareTo method of the official java.util.UUID implementation.
Review Comment:
> May be we have to add an entry on LICENCES file as we are using other libraries are referencing them
That's only allowed when the license is compatible - OpenJDK's license is not.
> the same question can be asked when it comes to implement equals and hashCode for example every developer is getting inspired by the openJDK reference implementation
Please check https://github.com/apache/kafka/blob/trunk/CONTRIBUTING.md. It states clearly that you can only contribute your own work.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] bmscomp commented on a diff in pull request #13627: MINOR: simplify if else conditions in Uuid.compareTo method
Posted by "bmscomp (via GitHub)" <gi...@apache.org>.
bmscomp commented on code in PR #13627:
URL: https://github.com/apache/kafka/pull/13627#discussion_r1178371488
##########
clients/src/main/java/org/apache/kafka/common/Uuid.java:
##########
@@ -143,12 +143,6 @@ public int compareTo(Uuid other) {
return 1;
Review Comment:
@divijvaidya Still there is another way to implement the `compareTo` method, and by the way `compare` can be a pretty name also for the method, and it will keep the same style of the compare method name in `Long`
if (mostSignificantBits == other.mostSignificantBits)
return Long.compare(leastSignificantBits, other.leastSignificantBits);
return Long.compare(mostSignificantBits, other.mostSignificantBits);
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18402: Use openJDK's implementation of comparison for org.apache.kafka.common.Uuid [kafka]
Posted by "bmscomp (via GitHub)" <gi...@apache.org>.
bmscomp commented on PR #13627:
URL: https://github.com/apache/kafka/pull/13627#issuecomment-2571787647
@ijuma @divijvaidya I need some time to come back with my own code, I need some time for some learnings, as the topic is already amazing for me and it touches the contributions aspect and the license one
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18402: Use openJDK's implementation of comparison for org.apache.kafka.common.Uuid [kafka]
Posted by "ijuma (via GitHub)" <gi...@apache.org>.
ijuma commented on code in PR #13627:
URL: https://github.com/apache/kafka/pull/13627#discussion_r1903349807
##########
clients/src/main/java/org/apache/kafka/common/Uuid.java:
##########
@@ -151,19 +151,22 @@ private byte[] getBytesFromUuid() {
return uuidBytes.array();
}
+ /**
+ * Compares this Uuid with another given Uuid.
+ * <p>
+ * This implementation is taken from the compareTo method of the official java.util.UUID implementation.
Review Comment:
We can't take the implementation from OpenJDK, that code has a difference license.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18402: Optimise of comparison on org.apache.kafka.common.Uuid [kafka]
Posted by "divijvaidya (via GitHub)" <gi...@apache.org>.
divijvaidya commented on PR #13627:
URL: https://github.com/apache/kafka/pull/13627#issuecomment-2572799677
> > Can you please copy the openJDK's implementation of comparison?
>
> Please do not ever do this. The OpenJDK code has a different license.
My bad for not checking the license. Thank you for catching this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18402: Optimise of comparison on org.apache.kafka.common.Uuid [kafka]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13627:
URL: https://github.com/apache/kafka/pull/13627#issuecomment-3157316932
This PR has been closed since it has not had any activity in 120 days. If you feel like this
was a mistake, or you would like to continue working on it, please feel free to re-open the
PR and ask for a review.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18402: Optimise of comparison on org.apache.kafka.common.Uuid [kafka]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #13627: KAFKA-18402: Optimise of comparison on org.apache.kafka.common.Uuid
URL: https://github.com/apache/kafka/pull/13627
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] bmscomp commented on pull request #13627: MINOR: simplify if else conditions in Uuid.compareTo method
Posted by "bmscomp (via GitHub)" <gi...@apache.org>.
bmscomp commented on PR #13627:
URL: https://github.com/apache/kafka/pull/13627#issuecomment-1728953825
@divijvaidya I think it's better to stick to the same implementation as JDK
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] divijvaidya commented on a diff in pull request #13627: MINOR: simplify if else conditions in Uuid.compareTo method
Posted by "divijvaidya (via GitHub)" <gi...@apache.org>.
divijvaidya commented on code in PR #13627:
URL: https://github.com/apache/kafka/pull/13627#discussion_r1176249165
##########
clients/src/main/java/org/apache/kafka/common/Uuid.java:
##########
@@ -143,12 +143,6 @@ public int compareTo(Uuid other) {
return 1;
Review Comment:
Can we use `Long.compare()` for mostSignificantBits as well?
##########
.gitignore:
##########
@@ -35,6 +35,7 @@ Vagrantfile.local
config/server-*
config/zookeeper-*
core/data/*
+core/data2/*
Review Comment:
perhaps add a note that this is created by a test [1], other wise other reviewers may wonder (like me) as to where is this directory coming from
https://github.com/apache/kafka/blob/trunk/core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala#L2673
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] divijvaidya commented on pull request #13627: MINOR: simplify if else conditions in Uuid.compareTo method
Posted by "divijvaidya (via GitHub)" <gi...@apache.org>.
divijvaidya commented on PR #13627:
URL: https://github.com/apache/kafka/pull/13627#issuecomment-1640038761
I am apprehensive about making this change. Even JDK's implementation of UUID.compareTo() uses existing code:
```
@Override
public int compareTo(UUID val) {
// The ordering is intentionally set up so that the UUIDs
// can simply be numerically compared as two numbers
return (this.mostSigBits < val.mostSigBits ? -1 :
(this.mostSigBits > val.mostSigBits ? 1 :
(this.leastSigBits < val.leastSigBits ? -1 :
(this.leastSigBits > val.leastSigBits ? 1 :
0))));
}
```
My main concern is that the comparison is dependent on treating unsigned vs. signed values. for example, why not use Long.compareUnsigned instead of using Long.compare.
I would say, it's probably safer to stick to what JDK already does.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] bmscomp commented on pull request #13627: MINOR: simplify if else conditions in Uuid.compareTo method
Posted by "bmscomp (via GitHub)" <gi...@apache.org>.
bmscomp commented on PR #13627:
URL: https://github.com/apache/kafka/pull/13627#issuecomment-1640164474
@divijvaidya This is the implementation of Long.compare, witch expresses the same, as existing implementation
```
Long ...
public static int compare(long x, long y) {
return (x < y) ? -1 : ((x == y) ? 0 : 1);
}
```
I agree with you `Long.compareUnsigned ` is better in this case I'll update this pull request to use it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] bmscomp commented on pull request #13627: MINOR: simplify if else conditions in Uuid.compareTo method
Posted by "bmscomp (via GitHub)" <gi...@apache.org>.
bmscomp commented on PR #13627:
URL: https://github.com/apache/kafka/pull/13627#issuecomment-1640250647
@divijvaidya the latest version of compare in jdk uses `Long.compare`
https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/util/UUID.java#L555
```
@Override
public int compareTo(UUID val) {
// The ordering is intentionally set up so that the UUIDs
// can simply be numerically compared as two numbers
int mostSigBits = Long.compare(this.mostSigBits, val.mostSigBits);
return mostSigBits != 0 ? mostSigBits : Long.compare(this.leastSigBits, val.leastSigBits);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] bmscomp commented on a diff in pull request #13627: MINOR: simplify if else conditions in Uuid.compareTo method
Posted by "bmscomp (via GitHub)" <gi...@apache.org>.
bmscomp commented on code in PR #13627:
URL: https://github.com/apache/kafka/pull/13627#discussion_r1176409358
##########
clients/src/main/java/org/apache/kafka/common/Uuid.java:
##########
@@ -143,12 +143,6 @@ public int compareTo(Uuid other) {
return 1;
Review Comment:
@divijvaidya I could not find a prettier way to use `Long.compare` for `mostSignificantBits` , do you have a trick for it ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] bmscomp commented on a diff in pull request #13627: MINOR: simplify if else conditions in Uuid.compareTo method
Posted by "bmscomp (via GitHub)" <gi...@apache.org>.
bmscomp commented on code in PR #13627:
URL: https://github.com/apache/kafka/pull/13627#discussion_r1176527874
##########
clients/src/main/java/org/apache/kafka/common/Uuid.java:
##########
@@ -143,12 +143,6 @@ public int compareTo(Uuid other) {
return 1;
Review Comment:
Thanks so much @divijvaidya, looks great, I already updated the pull request
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18402: Optimise of comparison on org.apache.kafka.common.Uuid [kafka]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13627:
URL: https://github.com/apache/kafka/pull/13627#issuecomment-2781941192
This PR is being marked as stale since it has not had any activity in 90 days. If you
would like to keep this PR alive, please leave a comment asking for a review. If the PR has
merge conflicts, update it with the latest from the base branch.
<p>
If you are having difficulty finding a reviewer, please reach out on the
[mailing list](https://kafka.apache.org/contact).
<p>
If this PR is no longer valid or desired, please feel free to close it. If no activity
occurs in the next 30 days, it will be automatically closed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: simplify if else conditions in Uuid.compareTo method [kafka]
Posted by "divijvaidya (via GitHub)" <gi...@apache.org>.
divijvaidya commented on PR #13627:
URL: https://github.com/apache/kafka/pull/13627#issuecomment-2569542470
Sure, let's try to merge this in.
1. Can you please copy the openJDK's implementation of comparison?
2. Add a comment specifying that we are using implementation similar to openJDK.
3. Resolve merge conflicts.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18402: Use openJDK's implementation of comparison for org.apache.kafka.common.Uuid [kafka]
Posted by "ijuma (via GitHub)" <gi...@apache.org>.
ijuma commented on code in PR #13627:
URL: https://github.com/apache/kafka/pull/13627#discussion_r1903349680
##########
.gitignore:
##########
@@ -35,6 +35,7 @@ Vagrantfile.local
config/server-*
config/zookeeper-*
core/data/*
+core/data2/*
Review Comment:
Instead of doing this, we may want to fix that test to use tmp instead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18402: Use openJDK's implementation of comparison for org.apache.kafka.common.Uuid [kafka]
Posted by "ijuma (via GitHub)" <gi...@apache.org>.
ijuma commented on PR #13627:
URL: https://github.com/apache/kafka/pull/13627#issuecomment-2571769390
> Can you please copy the openJDK's implementation of comparison?
Please do not ever do this. The OpenJDK code has a different license.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] divijvaidya commented on a diff in pull request #13627: MINOR: simplify if else conditions in Uuid.compareTo method
Posted by "divijvaidya (via GitHub)" <gi...@apache.org>.
divijvaidya commented on code in PR #13627:
URL: https://github.com/apache/kafka/pull/13627#discussion_r1176447810
##########
clients/src/main/java/org/apache/kafka/common/Uuid.java:
##########
@@ -143,12 +143,6 @@ public int compareTo(Uuid other) {
return 1;
Review Comment:
Something like this:
```
@Override
public int compareTo(Uuid other) {
int res = Long.compare(mostSignificantBits, other.mostSignificantBits);
return (res != 0) ? res : Long.compare(leastSignificantBits, other.leastSignificantBits);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18402: Use the same implementations as compareTo of java UUID for org.apache.kafka.common.Uuid [kafka]
Posted by "bmscomp (via GitHub)" <gi...@apache.org>.
bmscomp commented on PR #13627:
URL: https://github.com/apache/kafka/pull/13627#issuecomment-2571384332
@divijvaidya This pull request is updated I used the openJDK's implementation of comparison for the compareTo method of Uuid
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18402: Optimise of comparison on org.apache.kafka.common.Uuid [kafka]
Posted by "bmscomp (via GitHub)" <gi...@apache.org>.
bmscomp commented on PR #13627:
URL: https://github.com/apache/kafka/pull/13627#issuecomment-2573508768
@divijvaidya Nothing bad I think, because the old implementation of the Uuid compareTo method was the same as the old implementation of UUID compareTo of openJDK
But now I came with a new implementation that is not same as the old implementations of compareTo, I think this will make this pull request worth a merge
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18402: Optimise of comparison on org.apache.kafka.common.Uuid [kafka]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13627:
URL: https://github.com/apache/kafka/pull/13627#issuecomment-3043394435
This PR is being marked as stale since it has not had any activity in 90 days. If you
would like to keep this PR alive, please leave a comment asking for a review. If the PR has
merge conflicts, update it with the latest from the base branch.
<p>
If you are having difficulty finding a reviewer, please reach out on the
[mailing list](https://kafka.apache.org/contact).
<p>
If this PR is no longer valid or desired, please feel free to close it. If no activity
occurs in the next 30 days, it will be automatically closed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18402: Optimise of comparison on org.apache.kafka.common.Uuid [kafka]
Posted by "bmscomp (via GitHub)" <gi...@apache.org>.
bmscomp commented on PR #13627:
URL: https://github.com/apache/kafka/pull/13627#issuecomment-2782438397
@divijvaidya @ijuma Still think this is a better implementation, I think what do you think about it ? Or should I close this
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] divijvaidya commented on pull request #13627: MINOR: simplify if else conditions in Uuid.compareTo method
Posted by "divijvaidya (via GitHub)" <gi...@apache.org>.
divijvaidya commented on PR #13627:
URL: https://github.com/apache/kafka/pull/13627#issuecomment-1591667600
@bmscomp a lot of tests are failing right. Can you please rebase with latest trunk and we can actively try to merge this in next few days.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] bmscomp commented on a diff in pull request #13627: MINOR: simplify if else conditions in Uuid.compareTo method
Posted by "bmscomp (via GitHub)" <gi...@apache.org>.
bmscomp commented on code in PR #13627:
URL: https://github.com/apache/kafka/pull/13627#discussion_r1176384671
##########
.gitignore:
##########
@@ -35,6 +35,7 @@ Vagrantfile.local
config/server-*
config/zookeeper-*
core/data/*
+core/data2/*
Review Comment:
@divijvaidya Yes it comes from this test
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] bmscomp commented on a diff in pull request #13627: MINOR: simplify if else conditions in Uuid.compareTo method
Posted by "bmscomp (via GitHub)" <gi...@apache.org>.
bmscomp commented on code in PR #13627:
URL: https://github.com/apache/kafka/pull/13627#discussion_r1178371488
##########
clients/src/main/java/org/apache/kafka/common/Uuid.java:
##########
@@ -143,12 +143,6 @@ public int compareTo(Uuid other) {
return 1;
Review Comment:
Still there is another way to implement the `compareTo` method, and by the way `compare` can be a pretty name also for the method, and it will keep the same style of the compare method name in `Long`
if (mostSignificantBits == other.mostSignificantBits)
return Long.compare(leastSignificantBits, other.leastSignificantBits);
return Long.compare(mostSignificantBits, other.mostSignificantBits);
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-18402: Use openJDK's implementation of comparison for org.apache.kafka.common.Uuid [kafka]
Posted by "bmscomp (via GitHub)" <gi...@apache.org>.
bmscomp commented on code in PR #13627:
URL: https://github.com/apache/kafka/pull/13627#discussion_r1903352310
##########
clients/src/main/java/org/apache/kafka/common/Uuid.java:
##########
@@ -151,19 +151,22 @@ private byte[] getBytesFromUuid() {
return uuidBytes.array();
}
+ /**
+ * Compares this Uuid with another given Uuid.
+ * <p>
+ * This implementation is taken from the compareTo method of the official java.util.UUID implementation.
Review Comment:
@ijuma We just called it openJDK implementation it's not specific to open JDK since it's a recent one it's just about a way of comparison mean the compareTo, the same question can be asked when it comes to implement equals and hashCode for example every developer is getting inspired by the openJDK reference implementation
@divijvaidya What are your thoughts ? I think we have a nice topic right here on reference implementations and also Licences
May be we have to add an entry on LICENCES file as we are using other libraries are referencing them
I agree it's a very good question @ijuma
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org