Haitham Abu-Ghazaleh

13 papers B 3C 2Journal 2Unranked 4
YearRankTypeTitle / Venue / Authors
2024 conf
ICC
Haitham Abu-Ghazaleh, Attahiru Sule Alfa
2019 B conf
IWCMC
Haitham Abu-Ghazaleh, Attahiru Sule Alfa
2019 J jnl
IEEE Access
Attahiru Sule Alfa, Haitham Abu-Ghazaleh, Bodhaswar T. Maharaj
2018 B conf
IWCMC
Attahiru Sule Alfa, Haitham Abu-Ghazaleh, Bodhaswar T. Maharaj
2018 ch.
Handbook of Smart Cities, Software Services and Cyber Infrastructure
Attahiru Sule Alfa, Bodhaswar T. Maharaj, Haitham Abu-Ghazaleh, Babatunde S. Awoyemi
2017 B conf
WCNC
Haitham Abu-Ghazaleh, Attahiru Sule Alfa
2016 C conf
INDIN
Haitham Abu-Ghazaleh, Attahiru Sule Alfa
2016 conf
WMNC
Haitham Abu-Ghazaleh, Attahiru Sule Alfa
2015 conf
WMNC
Haitham Abu-Ghazaleh, Attahiru Sule Alfa
2010 J jnl
IEEE Trans. Veh. Technol.
Haitham Abu-Ghazaleh, Attahiru Sule Alfa
2010
Haitham Abu-Ghazaleh
2009 C conf
ISCC
Attahiru Sule Alfa, Haitham Abu-Ghazaleh
2008 conf
VTC Spring
Haitham Abu-Ghazaleh, Attahiru Sule Alfa
redb/settings/elasticsearch.py
← Index redb/settings/elasticsearch.py python
import logging
import os

from elasticsearch import Elasticsearch
from dotenv import load_dotenv

load_dotenv()

# Elasticsearch configuration
ELASTIC_ENDPOINT = os.getenv("ELASTIC_HOST")
ELASTIC_ENFORCE_SSL = os.getenv("ELASTIC_ENFORCE_SSL", False) == "True"
ELASTIC_USER = os.getenv("ELASTIC_USER")
ELASTIC_PASSWORD = os.getenv("ELASTIC_PASSWORD")
ELASTIC_BINARIES_COLLECTION = os.getenv("ELASTIC_BINARIES_COLLECTION", "test_db")

# Cached client instance
_elasticsearch_client = None

def get_elasticsearch_client():
    """Get Elasticsearch client with lazy initialization and caching"""
    global _elasticsearch_client
    
    if _elasticsearch_client is None:
        if not ELASTIC_ENDPOINT:
            raise ValueError("ELASTIC_HOST environment variable is required for Elasticsearch connection")
            
        _elasticsearch_client = Elasticsearch(
            ELASTIC_ENDPOINT,
            verify_certs=ELASTIC_ENFORCE_SSL,
            basic_auth=(ELASTIC_USER, ELASTIC_PASSWORD),
            maxsize=20,
            retry_on_timeout=True,
            timeout=30,
        )
    
    return _elasticsearch_client

def create_elasticsearch_client():
    """Create a new Elasticsearch client connection (legacy function)"""
    return get_elasticsearch_client()