Rami A. Abdallah

17 papers A* 1A 3C 1Journal 7Unranked 5
YearRankTypeTitle / Venue / Authors
2016 J jnl
IEEE J. Solid State Circuits
Rami A. Abdallah, Naresh R. Shanbhag
2014 J jnl
IEEE Trans. Very Large Scale Integr. Syst.
Rami A. Abdallah, Naresh R. Shanbhag
2013 J jnl
IEEE J. Solid State Circuits
Rami A. Abdallah, Naresh R. Shanbhag
2013 conf
SiPS
Rami A. Abdallah, Naresh R. Shanbhag
2013 J jnl
IEEE Trans. Multim.
Rami A. Abdallah, Naresh R. Shanbhag
2012 conf
CICC
Rami A. Abdallah, Naresh R. Shanbhag
2011 J jnl
IEEE J. Solid State Circuits
Srinivasa R. Sridhara, Michael DiRenzo, Srinivas Lingam, Seok-Jun Lee, Ra Blazquez, Jay Maxey, Samer Ghanem, Yu-Hung Lee, Rami A. Abdallah, Prashant Singh, Manish Goel
2011 A conf
ISLPED
Rami A. Abdallah, Pradeep S. Shenoy, Naresh R. Shanbhag, Philip T. Krein
2011 A conf
DATE
Rami A. Abdallah, Yu-Hung Lee, Naresh R. Shanbhag
2010 J jnl
IEEE Embed. Syst. Lett.
Rami A. Abdallah, Naresh R. Shanbhag
2010 C conf
ICCD
Rami A. Abdallah, Naresh R. Shanbhag
2010 A* conf
DAC
Naresh R. Shanbhag, Rami A. Abdallah, Rakesh Kumar, Douglas L. Jones
2009 J jnl
IEEE Trans. Signal Process.
Rami A. Abdallah, Naresh R. Shanbhag
2009 conf
SiPS
Rami A. Abdallah, Seok-Jun Lee, Manish Goel, Naresh R. Shanbhag
2009 conf
SoC
Eric P. Kim, Rami A. Abdallah, Naresh R. Shanbhag
2008 conf
SiPS
Rami A. Abdallah, Naresh R. Shanbhag
2008 A conf
ISLPED
Rami A. Abdallah, Naresh R. Shanbhag
redb/utils/push_to_elastic.py
← Index redb/utils/push_to_elastic.py python
import json
import os
#from redb.settings import elasticsearch as es
from elasticsearch import Elasticsearch
from dataclasses import asdict
from dotenv import load_dotenv

class Utils():
    """
    Utility class for pushing

    """
    @staticmethod
    def push_to_elastic(sample_dict):
        """
        Pushes the sample_dict to elastic search
        """
        load_dotenv()
        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", "redb_test"
        )
        es = Elasticsearch(
            ELASTIC_ENDPOINT,
            verify_certs=ELASTIC_ENFORCE_SSL,
            basic_auth=(ELASTIC_USER, ELASTIC_PASSWORD),
            maxsize=20,
            retry_on_timeout=True,
            timeout=30,
        )

        try:
            dict_dump = json.dumps(sample_dict)
        except Exception as e:
            print(f"Error: {e}")
            return False
        elastic = es.index(index=ELASTIC_BINARIES_COLLECTION, body=dict_dump)
        return True
    
    def push_to_index(sample_dict, index_name):
        """
        Pushes the sample_dict to elastic search
        """
        load_dotenv()
        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 = index_name
        
        es = Elasticsearch(
            ELASTIC_ENDPOINT,
            verify_certs=ELASTIC_ENFORCE_SSL,
            basic_auth=(ELASTIC_USER, ELASTIC_PASSWORD),
            maxsize=20,
            retry_on_timeout=True,
            timeout=30,
        )

        try:
            dict_dump = json.dumps(sample_dict)
        except Exception as e:
            print(f"Error: {e}")
            return False
        elastic = es.index(index=ELASTIC_BINARIES_COLLECTION, body=dict_dump)
        return True