You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Grant Henke (Code Review)" <ge...@cloudera.org> on 2020/09/16 21:57:40 UTC

[kudu-CR] Fix assign-location.py on Python 3.8+

Grant Henke has uploaded this change for review. ( http://gerrit.cloudera.org:8080/16461


Change subject: Fix assign-location.py on Python 3.8+
......................................................................

Fix assign-location.py on Python 3.8+

Python 3.8+ removed time.clock() in favor of various other
clock options. This patch fixes assign-location.py to be
Python 3.8+ compatible by using time.process_time()
if time.clock() is not available.

Change-Id: I21f9f8bc519a7286d17a012404b074494461e571
---
M src/kudu/scripts/assign-location.py
1 file changed, 9 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/61/16461/1
-- 
To view, visit http://gerrit.cloudera.org:8080/16461
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I21f9f8bc519a7286d17a012404b074494461e571
Gerrit-Change-Number: 16461
Gerrit-PatchSet: 1
Gerrit-Owner: Grant Henke <gr...@apache.org>

[kudu-CR] Fix assign-location.py on Python 3.8+

Posted by "Grant Henke (Code Review)" <ge...@cloudera.org>.
Hello Alexey Serbin, Kudu Jenkins, Andrew Wong, Greg Solovyev, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/16461

to look at the new patch set (#3).

Change subject: Fix assign-location.py on Python 3.8+
......................................................................

Fix assign-location.py on Python 3.8+

Python 3.8+ removed time.clock() in favor of various other
clock options. This patch fixes assign-location.py to be
Python 3.8+ compatible by using time.time() instead.
We use this in other Python scripts for similar deadline
functionality.

Change-Id: I21f9f8bc519a7286d17a012404b074494461e571
---
M src/kudu/scripts/assign-location.py
1 file changed, 2 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/61/16461/3
-- 
To view, visit http://gerrit.cloudera.org:8080/16461
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I21f9f8bc519a7286d17a012404b074494461e571
Gerrit-Change-Number: 16461
Gerrit-PatchSet: 3
Gerrit-Owner: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Greg Solovyev <gs...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] Fix assign-location.py on Python 3.8+

Posted by "Grant Henke (Code Review)" <ge...@cloudera.org>.
Grant Henke has removed a vote on this change.

Change subject: Fix assign-location.py on Python 3.8+
......................................................................


Removed Verified-1 by Kudu Jenkins (120)
-- 
To view, visit http://gerrit.cloudera.org:8080/16461
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: I21f9f8bc519a7286d17a012404b074494461e571
Gerrit-Change-Number: 16461
Gerrit-PatchSet: 3
Gerrit-Owner: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Greg Solovyev <gs...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] Fix assign-location.py on Python 3.8+

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/16461 )

Change subject: Fix assign-location.py on Python 3.8+
......................................................................


Patch Set 3: Code-Review+2


-- 
To view, visit http://gerrit.cloudera.org:8080/16461
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I21f9f8bc519a7286d17a012404b074494461e571
Gerrit-Change-Number: 16461
Gerrit-PatchSet: 3
Gerrit-Owner: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Greg Solovyev <gs...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 16 Sep 2020 23:01:57 +0000
Gerrit-HasComments: No

[kudu-CR] Fix assign-location.py on Python 3.8+

Posted by "Grant Henke (Code Review)" <ge...@cloudera.org>.
Hello Alexey Serbin, Kudu Jenkins, Andrew Wong, Greg Solovyev, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/16461

to look at the new patch set (#2).

Change subject: Fix assign-location.py on Python 3.8+
......................................................................

Fix assign-location.py on Python 3.8+

Python 3.8+ removed time.clock() in favor of various other
clock options. This patch fixes assign-location.py to be
Python 3.8+ compatible by using time.process_time()
if it is available.

Change-Id: I21f9f8bc519a7286d17a012404b074494461e571
---
M src/kudu/scripts/assign-location.py
1 file changed, 10 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/61/16461/2
-- 
To view, visit http://gerrit.cloudera.org:8080/16461
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I21f9f8bc519a7286d17a012404b074494461e571
Gerrit-Change-Number: 16461
Gerrit-PatchSet: 2
Gerrit-Owner: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Greg Solovyev <gs...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] Fix assign-location.py on Python 3.8+

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/16461 )

Change subject: Fix assign-location.py on Python 3.8+
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/16461/1/src/kudu/scripts/assign-location.py
File src/kudu/scripts/assign-location.py:

http://gerrit.cloudera.org:8080/#/c/16461/1/src/kudu/scripts/assign-location.py@98
PS1, Line 98:     # time.clock() is deprecated since Python 3.3 and removed in Python 3.8.
> As an option, maybe use time.mktime(time.localtime()) to be portable across
Ah, I guess we could get away just using

time.time()

?



-- 
To view, visit http://gerrit.cloudera.org:8080/16461
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I21f9f8bc519a7286d17a012404b074494461e571
Gerrit-Change-Number: 16461
Gerrit-PatchSet: 1
Gerrit-Owner: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Greg Solovyev <gs...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 16 Sep 2020 22:48:11 +0000
Gerrit-HasComments: Yes

[kudu-CR] Fix assign-location.py on Python 3.8+

Posted by "Grant Henke (Code Review)" <ge...@cloudera.org>.
Grant Henke has posted comments on this change. ( http://gerrit.cloudera.org:8080/16461 )

Change subject: Fix assign-location.py on Python 3.8+
......................................................................


Patch Set 1:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/16461/1/src/kudu/scripts/assign-location.py
File src/kudu/scripts/assign-location.py:

http://gerrit.cloudera.org:8080/#/c/16461/1/src/kudu/scripts/assign-location.py@98
PS1, Line 98:     # time.clock() is deprecated since Python 3.3 and removed in Python 3.8.
> Ah, I guess we could get away just using
Done


http://gerrit.cloudera.org:8080/#/c/16461/1/src/kudu/scripts/assign-location.py@98
PS1, Line 98:     # time.clock() is deprecated since Python 3.3 and removed in Python 3.8.
> Would it be possible to try process_time() first, since that's what we expe
Done


http://gerrit.cloudera.org:8080/#/c/16461/1/src/kudu/scripts/assign-location.py@98
PS1, Line 98:     # time.clock() is deprecated since Python 3.3 and removed in Python 3.8.
> As an option, maybe use time.mktime(time.localtime()) to be portable across
Done



-- 
To view, visit http://gerrit.cloudera.org:8080/16461
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I21f9f8bc519a7286d17a012404b074494461e571
Gerrit-Change-Number: 16461
Gerrit-PatchSet: 1
Gerrit-Owner: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Greg Solovyev <gs...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 16 Sep 2020 23:02:03 +0000
Gerrit-HasComments: Yes

[kudu-CR] Fix assign-location.py on Python 3.8+

Posted by "Grant Henke (Code Review)" <ge...@cloudera.org>.
Grant Henke has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/16461 )

Change subject: Fix assign-location.py on Python 3.8+
......................................................................

Fix assign-location.py on Python 3.8+

Python 3.8+ removed time.clock() in favor of various other
clock options. This patch fixes assign-location.py to be
Python 3.8+ compatible by using time.time() instead.
We use this in other Python scripts for similar deadline
functionality.

Change-Id: I21f9f8bc519a7286d17a012404b074494461e571
Reviewed-on: http://gerrit.cloudera.org:8080/16461
Reviewed-by: Alexey Serbin <as...@cloudera.com>
Reviewed-by: Andrew Wong <aw...@cloudera.com>
Tested-by: Grant Henke <gr...@apache.org>
---
M src/kudu/scripts/assign-location.py
1 file changed, 2 insertions(+), 3 deletions(-)

Approvals:
  Alexey Serbin: Looks good to me, approved
  Andrew Wong: Looks good to me, approved
  Grant Henke: Verified

-- 
To view, visit http://gerrit.cloudera.org:8080/16461
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I21f9f8bc519a7286d17a012404b074494461e571
Gerrit-Change-Number: 16461
Gerrit-PatchSet: 4
Gerrit-Owner: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Greg Solovyev <gs...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)

[kudu-CR] Fix assign-location.py on Python 3.8+

Posted by "Grant Henke (Code Review)" <ge...@cloudera.org>.
Grant Henke has posted comments on this change. ( http://gerrit.cloudera.org:8080/16461 )

Change subject: Fix assign-location.py on Python 3.8+
......................................................................


Patch Set 3: Verified+1


-- 
To view, visit http://gerrit.cloudera.org:8080/16461
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I21f9f8bc519a7286d17a012404b074494461e571
Gerrit-Change-Number: 16461
Gerrit-PatchSet: 3
Gerrit-Owner: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Greg Solovyev <gs...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 16 Sep 2020 23:32:36 +0000
Gerrit-HasComments: No

[kudu-CR] Fix assign-location.py on Python 3.8+

Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/16461 )

Change subject: Fix assign-location.py on Python 3.8+
......................................................................


Patch Set 3: Code-Review+2


-- 
To view, visit http://gerrit.cloudera.org:8080/16461
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I21f9f8bc519a7286d17a012404b074494461e571
Gerrit-Change-Number: 16461
Gerrit-PatchSet: 3
Gerrit-Owner: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Greg Solovyev <gs...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 16 Sep 2020 23:18:00 +0000
Gerrit-HasComments: No

[kudu-CR] Fix assign-location.py on Python 3.8+

Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/16461 )

Change subject: Fix assign-location.py on Python 3.8+
......................................................................


Patch Set 1: Code-Review+1

(1 comment)

http://gerrit.cloudera.org:8080/#/c/16461/1/src/kudu/scripts/assign-location.py
File src/kudu/scripts/assign-location.py:

http://gerrit.cloudera.org:8080/#/c/16461/1/src/kudu/scripts/assign-location.py@98
PS1, Line 98:     # time.clock() is deprecated since Python 3.3 and removed in Python 3.8.
Would it be possible to try process_time() first, since that's what we expect to work moving forward?



-- 
To view, visit http://gerrit.cloudera.org:8080/16461
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I21f9f8bc519a7286d17a012404b074494461e571
Gerrit-Change-Number: 16461
Gerrit-PatchSet: 1
Gerrit-Owner: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Greg Solovyev <gs...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 16 Sep 2020 22:18:20 +0000
Gerrit-HasComments: Yes

[kudu-CR] Fix assign-location.py on Python 3.8+

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/16461 )

Change subject: Fix assign-location.py on Python 3.8+
......................................................................


Patch Set 1:

(1 comment)

I verified the updated script works for Python 2.7 on macOS HighSierra.

http://gerrit.cloudera.org:8080/#/c/16461/1/src/kudu/scripts/assign-location.py
File src/kudu/scripts/assign-location.py:

http://gerrit.cloudera.org:8080/#/c/16461/1/src/kudu/scripts/assign-location.py@98
PS1, Line 98:     # time.clock() is deprecated since Python 3.3 and removed in Python 3.8.
> Would it be possible to try process_time() first, since that's what we expe
As an option, maybe use time.mktime(time.localtime()) to be portable across python version?  It's fine to have 1 second resolution in this context -- the code will work as needed.  This works for Python2.7.

Would this work for Python 3.8?



-- 
To view, visit http://gerrit.cloudera.org:8080/16461
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I21f9f8bc519a7286d17a012404b074494461e571
Gerrit-Change-Number: 16461
Gerrit-PatchSet: 1
Gerrit-Owner: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Greg Solovyev <gs...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 16 Sep 2020 22:42:58 +0000
Gerrit-HasComments: Yes

[kudu-CR] Fix assign-location.py on Python 3.8+

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/16461 )

Change subject: Fix assign-location.py on Python 3.8+
......................................................................


Patch Set 3:

Thank you for fixing this!  I guess it should have been 'time.time()' from the very beginning: I did a mistake (typo?) using 'time.clock()' instead.


-- 
To view, visit http://gerrit.cloudera.org:8080/16461
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I21f9f8bc519a7286d17a012404b074494461e571
Gerrit-Change-Number: 16461
Gerrit-PatchSet: 3
Gerrit-Owner: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Grant Henke <gr...@apache.org>
Gerrit-Reviewer: Greg Solovyev <gs...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Wed, 16 Sep 2020 23:02:59 +0000
Gerrit-HasComments: No