-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
complement queryJob and queryJobDetails
- Loading branch information
1 parent
e8d19cf
commit 781db15
Showing
12 changed files
with
358 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# -*- coding: utf-8 -*- | ||
from typing import Any | ||
import time | ||
|
||
|
||
class BaseObject: | ||
def set_params(self, **params: Any): | ||
for key, value in params.items(): | ||
setattr(self, key, value) | ||
if hasattr(self, f"{key}"): | ||
setattr(self, f"{key}", value) | ||
return self | ||
|
||
def as_dict(obj): | ||
return {attr: getattr(obj, attr) for attr in dir(obj) if not callable(getattr(obj, attr)) and not attr.startswith("__")} | ||
|
||
def execute_with_retry(self, request_func, retry_times, retry_wait_seconds, *args, **kwargs): | ||
attempt = 0 | ||
while attempt < retry_times: | ||
try: | ||
response = request_func(*args, **kwargs) | ||
return response | ||
except Exception as e: | ||
attempt += 1 | ||
if attempt < retry_times: | ||
time.sleep(retry_wait_seconds) | ||
else: | ||
raise e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
access_key_id="" | ||
access_key_secret="" | ||
remote_entrypoints="http://127.0.0.1:16000,http://127.0.0.1:16001" | ||
access_key_id= | ||
access_key_secret= | ||
remote_entrypoints=http://127.0.0.1:16000,http://127.0.0.1:16001 | ||
|
||
agency_name="SGD" | ||
workspace_path="/user/wedpr/milestone2/sgd/" | ||
user="test_user" | ||
storage_endpoint="http://127.0.0.1:50070" | ||
agency_name=SGD | ||
workspace_path=/user/wedpr/milestone2/sgd/ | ||
user=test_user | ||
storage_endpoint=http://127.0.0.1:50070 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.