From 301a0ca66d63732449f6586787c9318a2dfec822 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Wed, 18 May 2022 10:57:08 -0400 Subject: [PATCH] rename scribe.elasticsearch -> hub.elastic_sync --- hub/elastic_sync/__init__.py | 2 ++ hub/{elasticsearch => elastic_sync}/__main__.py | 4 ++-- hub/{elasticsearch => elastic_sync}/constants.py | 0 hub/{elasticsearch => elastic_sync}/env.py | 0 .../fast_ar_trending.py | 0 .../notifier_protocol.py | 0 hub/{elasticsearch => elastic_sync}/search.py | 2 +- hub/{elasticsearch => elastic_sync}/service.py | 10 +++++----- hub/elasticsearch/__init__.py | 2 -- hub/herald/service.py | 2 +- hub/herald/session.py | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) create mode 100644 hub/elastic_sync/__init__.py rename hub/{elasticsearch => elastic_sync}/__main__.py (87%) rename hub/{elasticsearch => elastic_sync}/constants.py (100%) rename hub/{elasticsearch => elastic_sync}/env.py (100%) rename hub/{elasticsearch => elastic_sync}/fast_ar_trending.py (100%) rename hub/{elasticsearch => elastic_sync}/notifier_protocol.py (100%) rename hub/{elasticsearch => elastic_sync}/search.py (99%) rename hub/{elasticsearch => elastic_sync}/service.py (98%) delete mode 100644 hub/elasticsearch/__init__.py diff --git a/hub/elastic_sync/__init__.py b/hub/elastic_sync/__init__.py new file mode 100644 index 0000000..ca4352e --- /dev/null +++ b/hub/elastic_sync/__init__.py @@ -0,0 +1,2 @@ +from hub.elastic_sync.search import SearchIndex +from hub.elastic_sync.notifier_protocol import ElasticNotifierClientProtocol \ No newline at end of file diff --git a/hub/elasticsearch/__main__.py b/hub/elastic_sync/__main__.py similarity index 87% rename from hub/elasticsearch/__main__.py rename to hub/elastic_sync/__main__.py index 71e9215..f8dfefc 100644 --- a/hub/elasticsearch/__main__.py +++ b/hub/elastic_sync/__main__.py @@ -3,8 +3,8 @@ import logging import traceback import argparse from hub.common import setup_logging -from hub.elasticsearch.env import ElasticEnv -from hub.elasticsearch.service import ElasticSyncService +from hub.elastic_sync.env import ElasticEnv +from hub.elastic_sync.service import ElasticSyncService def main(): diff --git a/hub/elasticsearch/constants.py b/hub/elastic_sync/constants.py similarity index 100% rename from hub/elasticsearch/constants.py rename to hub/elastic_sync/constants.py diff --git a/hub/elasticsearch/env.py b/hub/elastic_sync/env.py similarity index 100% rename from hub/elasticsearch/env.py rename to hub/elastic_sync/env.py diff --git a/hub/elasticsearch/fast_ar_trending.py b/hub/elastic_sync/fast_ar_trending.py similarity index 100% rename from hub/elasticsearch/fast_ar_trending.py rename to hub/elastic_sync/fast_ar_trending.py diff --git a/hub/elasticsearch/notifier_protocol.py b/hub/elastic_sync/notifier_protocol.py similarity index 100% rename from hub/elasticsearch/notifier_protocol.py rename to hub/elastic_sync/notifier_protocol.py diff --git a/hub/elasticsearch/search.py b/hub/elastic_sync/search.py similarity index 99% rename from hub/elasticsearch/search.py rename to hub/elastic_sync/search.py index 6bd68c8..93ace26 100644 --- a/hub/elasticsearch/search.py +++ b/hub/elastic_sync/search.py @@ -14,7 +14,7 @@ from hub.schema.url import normalize_name from hub.error import TooManyClaimSearchParametersError from hub.common import LRUCache from hub.db.common import CLAIM_TYPES, STREAM_TYPES -from hub.elasticsearch.constants import INDEX_DEFAULT_SETTINGS, REPLACEMENTS, FIELDS, TEXT_FIELDS, RANGE_FIELDS +from hub.elastic_sync.constants import INDEX_DEFAULT_SETTINGS, REPLACEMENTS, FIELDS, TEXT_FIELDS, RANGE_FIELDS from hub.db.common import ResolveResult if TYPE_CHECKING: from hub.db import HubDB diff --git a/hub/elasticsearch/service.py b/hub/elastic_sync/service.py similarity index 98% rename from hub/elasticsearch/service.py rename to hub/elastic_sync/service.py index 8acaa2b..ade8db3 100644 --- a/hub/elasticsearch/service.py +++ b/hub/elastic_sync/service.py @@ -9,12 +9,12 @@ from hub.schema.result import Censor from hub.service import BlockchainReaderService from hub.db.revertable import RevertableOp from hub.db.common import TrendingNotification, DB_PREFIXES -from hub.elasticsearch.notifier_protocol import ElasticNotifierProtocol -from hub.elasticsearch.search import IndexVersionMismatch, expand_query -from hub.elasticsearch.constants import ALL_FIELDS, INDEX_DEFAULT_SETTINGS -from hub.elasticsearch.fast_ar_trending import FAST_AR_TRENDING_SCRIPT +from hub.elastic_sync.notifier_protocol import ElasticNotifierProtocol +from hub.elastic_sync.search import IndexVersionMismatch, expand_query +from hub.elastic_sync.constants import ALL_FIELDS, INDEX_DEFAULT_SETTINGS +from hub.elastic_sync.fast_ar_trending import FAST_AR_TRENDING_SCRIPT if typing.TYPE_CHECKING: - from hub.elasticsearch.env import ElasticEnv + from hub.elastic_sync.env import ElasticEnv class ElasticSyncService(BlockchainReaderService): diff --git a/hub/elasticsearch/__init__.py b/hub/elasticsearch/__init__.py deleted file mode 100644 index 6138c4c..0000000 --- a/hub/elasticsearch/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -from hub.elasticsearch.search import SearchIndex -from hub.elasticsearch.notifier_protocol import ElasticNotifierClientProtocol \ No newline at end of file diff --git a/hub/herald/service.py b/hub/herald/service.py index c2fa69c..f6015cf 100644 --- a/hub/herald/service.py +++ b/hub/herald/service.py @@ -6,7 +6,7 @@ from hub.herald.session import SessionManager from hub.herald.mempool import HubMemPool from hub.herald.udp import StatusServer from hub.service import BlockchainReaderService -from hub.elasticsearch import ElasticNotifierClientProtocol +from hub.elastic_sync import ElasticNotifierClientProtocol if typing.TYPE_CHECKING: from hub.herald.env import ServerEnv diff --git a/hub/herald/session.py b/hub/herald/session.py index 06c4bab..9e339b7 100644 --- a/hub/herald/session.py +++ b/hub/herald/session.py @@ -20,7 +20,7 @@ from hub.error import ResolveCensoredError, TooManyClaimSearchParametersError from hub import __version__, PROMETHEUS_NAMESPACE from hub.herald import PROTOCOL_MIN, PROTOCOL_MAX, HUB_PROTOCOL_VERSION from hub.build_info import BUILD, COMMIT_HASH, DOCKER_TAG -from hub.elasticsearch import SearchIndex +from hub.elastic_sync import SearchIndex from hub.common import sha256, hash_to_hex_str, hex_str_to_hash, HASHX_LEN, version_string, formatted_time from hub.common import protocol_version, RPCError, DaemonError, TaskGroup, HISTOGRAM_BUCKETS from hub.herald.jsonrpc import JSONRPCAutoDetect, JSONRPCConnection, JSONRPCv2, JSONRPC