Skip to content

Commit

Permalink
Add hash node key
Browse files Browse the repository at this point in the history
  • Loading branch information
ssyssy committed Apr 5, 2024
1 parent 9f1c424 commit 448a93f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
5 changes: 4 additions & 1 deletion alluxiofs/client/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
ALLUXIO_ETCD_PASSWORD_KEY = "alluxio.etcd.password"
ALLUXIO_PAGE_SIZE_KEY = "alluxio.worker.page.store.page.size"
ALLUXIO_PAGE_SIZE_DEFAULT_VALUE = "1MB"
ALLUXIO_HASH_NODE_PER_WORKER_KEY = (
ALLUXIO_HASH_NODE_PER_WORKER_KEY1 = (
"alluxio.user.consistent.hash.virtual.node.count.per.worker"
)
ALLUXIO_HASH_NODE_PER_WORKER_KEY2 = (
"alluxio.user.worker.selection.policy.consistent.hash.virtual.node.count.per.worker"
)
ALLUXIO_WORKER_HTTP_SERVER_PORT_KEY = "alluxio.worker.http.server.port"
ALLUXIO_WORKER_HTTP_SERVER_PORT_DEFAULT_VALUE = 28080
ALLUXIO_HASH_NODE_PER_WORKER_DEFAULT_VALUE = 5
Expand Down
14 changes: 11 additions & 3 deletions alluxiofs/client/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
from requests.adapters import HTTPAdapter

from .const import ALLUXIO_HASH_NODE_PER_WORKER_DEFAULT_VALUE
from .const import ALLUXIO_HASH_NODE_PER_WORKER_KEY
from .const import ALLUXIO_HASH_NODE_PER_WORKER_KEY1
from .const import ALLUXIO_HASH_NODE_PER_WORKER_KEY2
from .const import ALLUXIO_PAGE_SIZE_DEFAULT_VALUE
from .const import ALLUXIO_PAGE_SIZE_KEY
from .const import ALLUXIO_SUCCESS_IDENTIFIER
Expand Down Expand Up @@ -180,9 +181,16 @@ def __init__(
if ALLUXIO_PAGE_SIZE_KEY in options:
page_size = options[ALLUXIO_PAGE_SIZE_KEY]
self.logger.debug(f"Page size is set to {page_size}")
if ALLUXIO_HASH_NODE_PER_WORKER_KEY in options:
if ALLUXIO_HASH_NODE_PER_WORKER_KEY1 in options:
hash_node_per_worker = int(
options[ALLUXIO_HASH_NODE_PER_WORKER_KEY]
options[ALLUXIO_HASH_NODE_PER_WORKER_KEY1]
)
self.logger.debug(
f"Hash node per worker is set to {hash_node_per_worker}"
)
if ALLUXIO_HASH_NODE_PER_WORKER_KEY2 in options:
hash_node_per_worker = int(
options[ALLUXIO_HASH_NODE_PER_WORKER_KEY2]
)
self.logger.debug(
f"Hash node per worker is set to {hash_node_per_worker}"
Expand Down

0 comments on commit 448a93f

Please sign in to comment.