-
Notifications
You must be signed in to change notification settings - Fork 10
Update Alluxio Configuration Approach #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1eb6242
add alluxio io logic
SibylYang efd14d5
Merge remote-tracking branch 'origin/main'
SibylYang ce90396
update config
SibylYang 56929c7
update config
SibylYang 46837eb
update config
SibylYang ad87ea9
update config
SibylYang d7f6111
update data_manager config
SibylYang f6e9fd2
address comments
SibylYang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,89 @@ | ||
| from typing import Optional | ||
|
|
||
| import humanfriendly | ||
|
|
||
| from .const import ALLUXIO_CLUSTER_NAME_DEFAULT_VALUE | ||
| from .const import ALLUXIO_HASH_NODE_PER_WORKER_DEFAULT_VALUE | ||
| from .const import ALLUXIO_PAGE_SIZE_DEFAULT_VALUE | ||
| from .const import ALLUXIO_WORKER_HTTP_SERVER_PORT_DEFAULT_VALUE | ||
|
|
||
|
|
||
| class AlluxioClientConfig: | ||
| """ | ||
| Class responsible for creating the configuration for Alluxio Client. | ||
| """ | ||
|
|
||
| def __init__( | ||
| self, | ||
| etcd_hosts: Optional[str] = None, | ||
| worker_hosts: Optional[str] = None, | ||
| etcd_port=2379, | ||
| worker_http_port=ALLUXIO_WORKER_HTTP_SERVER_PORT_DEFAULT_VALUE, | ||
| etcd_refresh_workers_interval=120, | ||
| page_size=ALLUXIO_PAGE_SIZE_DEFAULT_VALUE, | ||
| hash_node_per_worker=ALLUXIO_HASH_NODE_PER_WORKER_DEFAULT_VALUE, | ||
| cluster_name=ALLUXIO_CLUSTER_NAME_DEFAULT_VALUE, | ||
| etcd_username: Optional[str] = None, | ||
| etcd_password: Optional[str] = None, | ||
| concurrency=64, | ||
| **kwargs, | ||
| ): | ||
| """ | ||
| Initializes Alluxio client configuration. | ||
| Args: | ||
| etcd_hosts (Optional[str], optional): The hostnames of ETCD to get worker addresses from | ||
| in 'host1,host2,host3' format. Either etcd_hosts or worker_hosts should be provided, not both. | ||
| worker_hosts (Optional[str], optional): The worker hostnames in 'host1,host2,host3' format. | ||
| Either etcd_hosts or worker_hosts should be provided, not both. | ||
| concurrency (int, optional): The maximum number of concurrent operations for HTTP requests, default to 64. | ||
| etcd_port (int, optional): The port of each etcd server. | ||
| worker_http_port (int, optional): The port of the HTTP server on each Alluxio worker node. | ||
| etcd_refresh_workers_interval (int, optional): The interval to refresh worker list from ETCD membership service periodically. | ||
| All negative values mean the service is disabled. | ||
| """ | ||
|
|
||
| assert ( | ||
| etcd_hosts or worker_hosts | ||
| ), "Must supply either 'etcd_hosts' or 'worker_hosts'" | ||
|
|
||
| assert not ( | ||
| etcd_hosts and worker_hosts | ||
| ), "Supply either 'etcd_hosts' or 'worker_hosts', not both" | ||
|
|
||
| assert isinstance(etcd_port, int) and ( | ||
| 1 <= etcd_port <= 65535 | ||
| ), "'etcd_port' should be an integer in the range 1-65535" | ||
|
|
||
| assert isinstance(worker_http_port, int) and ( | ||
| 1 <= worker_http_port <= 65535 | ||
| ), "'worker_http_port' should be an integer in the range 1-65535" | ||
|
|
||
| assert ( | ||
| isinstance(concurrency, int) and concurrency > 0 | ||
| ), "'concurrency' should be a positive integer" | ||
|
|
||
| assert isinstance( | ||
| etcd_refresh_workers_interval, int | ||
| ), "'etcd_refresh_workers_interval' should be an integer" | ||
|
|
||
| self.etcd_hosts = etcd_hosts | ||
| self.worker_hosts = worker_hosts | ||
| self.etcd_port = etcd_port | ||
| self.worker_http_port = worker_http_port | ||
| self.etcd_refresh_workers_interval = etcd_refresh_workers_interval | ||
|
|
||
| assert ( | ||
| isinstance(hash_node_per_worker, int) and hash_node_per_worker > 0 | ||
| ), "'hash_node_per_worker' should be a positive integer" | ||
|
|
||
| self.hash_node_per_worker = hash_node_per_worker | ||
| self.page_size = humanfriendly.parse_size(page_size, binary=True) | ||
| self.cluster_name = cluster_name | ||
|
|
||
| assert (etcd_username is None) == ( | ||
| etcd_password is None | ||
| ), "Both ETCD username and password must be set or both should be unset." | ||
|
|
||
| self.etcd_username = etcd_username | ||
| self.etcd_password = etcd_password | ||
| self.concurrency = concurrency |
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.