Example #1
0
 def setup_class(self):
     """Setup parameters"""
     try:
         CuboidIndexDB.createTable(endpoint_url=settings.DYNAMO_ENDPOINT)
     except Exception as e:
         pass
     self.cuboid_index = CuboidIndexDB(
         nd_proj.project_name, endpoint_url=settings.DYNAMO_ENDPOINT)
Example #2
0
 def __init__(self, pr):
     """Create the database connection"""
     self.pr = pr
     # create connections for cuboid bucket and cuboid dyanmo table
     self.cuboid_bucket = CuboidBucket(
         self.pr.project_name, endpoint_url=ndingest_settings.S3_ENDPOINT)
     self.cuboidindex_db = CuboidIndexDB(
         self.pr.project_name,
         endpoint_url=ndingest_settings.DYNAMO_ENDPOINT)
Example #3
0
    def __init__(self, db):
        """Connect to the S3 backend"""

        try:
            self.db = db
            self.project_name = self.db.proj.project_name
            self.cuboidindex_db = CuboidIndexDB(self.project_name)
            self.cuboid_bucket = CuboidBucket(self.project_name)
        except Exception, e:
            logger.error("Cannot connect to S3 backend")
            raise SpatialDBError("Cannot connect to S3 backend")
  def __init__(self, token_name, host_name=HOST_NAME):
    # configuring the logger based on the dataset we are uploading
    self.logger = logging.getLogger(token_name)
    self.logger.setLevel(logging.INFO)
    fh = logging.FileHandler('{}_upload.log'.format(token_name))
    self.logger.addHandler(fh)

    self.info_interface = InfoInterface(host_name, token_name)
    self.project_name = self.info_interface.project_name
    self.cuboidindex_db = CuboidIndexDB(self.project_name)
    self.cuboid_bucket = CuboidBucket(self.project_name)
Example #5
0
    def __init__(self, token_name, host_name=HOST_NAME):
        """Create the bucket and intialize values"""

        # configuring the logger based on the dataset we are uploading
        self.logger = logging.getLogger(token_name)
        self.logger.setLevel(logging.INFO)
        fh = logging.FileHandler('{}.log'.format(token_name))
        self.logger.addHandler(fh)
        # setting up the project metadata
        self.info_interface = InfoInterface(host_name, token_name)
        # creating the resource interface to the remote server
        # self.resource_interface = ResourceInterface(self.info_interface.dataset_name, self.info_interface.project_name, host_name, logger=self.logger)
        # self.proj = self.resource_interface.getProject()
        # create the s3 I/O and index objects
        self.cuboidindex_db = CuboidIndexDB(self.info_interface.project_name)
        self.cuboid_bucket = CuboidBucket(self.info_interface.project_name)
Example #6
0
 def __init__(self, dataset_name, project_name, host_name=HOST_NAME):
   # self.resource_interface = ResourceInterface(dataset_name, project_name, host_name)
   self.cuboid_bucket = CuboidBucket(project_name)
   self.cuboidindex_db = CuboidIndexDB(project_name)