from urlparse import urlparse

from logger import logger


class WorkloadSettings(object):

    def __init__(self, options):
        self.creates = options.creates
        self.reads = options.reads
        self.updates = options.updates
        self.deletes = options.deletes
        self.cases = 0  # Stub for library compatibility

        self.ops = options.ops
        self.throughput = options.throughput

        self.doc_gen = options.generator
        self.size = options.size
        self.items = options.items
        self.expiration = options.expiration
        self.working_set = options.working_set
        self.working_set_access = options.working_set_access

        self.async = options.async

        self.workers = options.workers

        # Stubs for library compatibility
        self.query_workers = 0
        self.subdoc_workers = 0
        self.n1ql_workers = 0

        self.operations = False
        self.fts_config = None

        self.index_type = None
        self.ddocs = {}
        self.qparams = {}


class TargetSettings(object):

    def __init__(self, target_uri, prefix):
        params = urlparse(target_uri)
        if not params.hostname or not params.port or not params.path:
            logger.interrupt('Invalid connection URI')

        self.node = '{}:{}'.format(params.hostname, params.port)
        self.bucket = params.path[1:]
        self.password = params.password or ''
        self.prefix = prefix

from urlparse import urlparse

from logger import logger


class WorkloadSettings(object):

    def __init__(self, options):
        self.creates = options.creates
        self.reads = options.reads
        self.updates = options.updates
        self.deletes = options.deletes
        self.cases = 0  # Stub for library compatibility

        self.ops = options.ops
        self.throughput = options.throughput

        self.doc_gen = options.generator
        self.size = options.size
        self.items = options.items
        self.expiration = options.expiration
        self.working_set = options.working_set
        self.working_set_access = options.working_set_access

        self.async = options.async

        self.workers = options.workers

        # Stubs for library compatibility
        self.query_workers = 0
        self.subdoc_workers = 0
        self.n1ql_workers = 0

        self.operations = False
        self.fts_config = None
        self.fts_updates = 0

        self.index_type = None
        self.ddocs = {}
        self.qparams = {}


class TargetSettings(object):

    def __init__(self, target_uri, prefix):
        params = urlparse(target_uri)
        if not params.hostname or not params.port or not params.path:
            logger.interrupt('Invalid connection URI')

        self.node = '{}:{}'.format(params.hostname, params.port)
        self.bucket = params.path[1:]
        self.password = params.password or ''
        self.prefix = prefix

Add a stub for fts_updates
Add a stub for fts_updates

Change-Id: Ieb48f98a0072dcd27de0b50027ff6c5f3ecc1513
Reviewed-on: http://review.couchbase.org/70413
Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Pavel Paulau <dd88eded64e90046a680e3a6c0828ceb8fe8a0e7@gmail.com>
