Create a new DBService for the given tenant.
424060
private DBService createTenantDBService(Tenant tenant) {
        m_logger.info("Creating DBService for tenant: {}", tenant.getName());
        Map<String, Object> dbServiceParams = tenant.getDefinition().getOptionMap("DBService");
        String dbServiceName = null;
        if (dbServiceParams == null || !dbServiceParams.containsKey("dbservice")) {
            dbServiceName = ServerParams.instance().getModuleParamString("DBService", "dbservice");
            Utils.require(!Utils.isEmpty(dbServiceName), "DBService.dbservice parameter is not defined");
        } else {
            dbServiceName = dbServiceParams.get("dbservice").toString();
        }

        DBService dbservice = null;
        try {
            @SuppressWarnings("unchecked")
            Class<DBService> serviceClass = (Class<DBService>) Class.forName(dbServiceName);
            Constructor<DBService> constructor = serviceClass.getConstructor(Tenant.class);
            dbservice = constructor.newInstance(tenant);
            dbservice.initialize();
            dbservice.start();
        } catch (IllegalArgumentException e) {
            throw new RuntimeException("Cannot load specified 'dbservice': " + dbServiceName, e);
        } catch (ClassNotFoundException e) {
            throw new RuntimeException("Could not load dbservice class '" + dbServiceName + "'", e);
        } catch (NoSuchMethodException e) {
            throw new RuntimeException("Required constructor missing for dbservice class: " + dbServiceName, e);
        } catch (SecurityException | InstantiationException | IllegalAccessException | InvocationTargetException e) {
            throw new RuntimeException("Could not invoke constructor for dbservice class: " + dbServiceName, e);
        } catch (Throwable e) {
            throw new RuntimeException("Failed to initialize DBService '" + dbServiceName +
                                       "' for tenant: " + tenant.getName(), e);
        }
        return dbservice;
    }
32667
public TableStore createTableStoreService() {
        return getSingleton(this.tableStoreService, setup -> new TableService(setup.getContainerRegistry(), setup.getSegmentToContainerMapper()));
    }
82587
def create_tenant(self, tenant_id, retentions=None):
        
        item = { 'id': tenant_id }
        if retentions is not None:
            item['retentions'] = retentions

        self._post(self._get_tenants_url(), json.dumps(item, indent=2))
1015565
def create(cls, name, users=None):
        

        api = Client.instance().api

        database_data = {
            'name': name,
            'active': True,
        }

        if isinstance(users, list) or isinstance(users, tuple):
            database_data['users'] = users

        data = api.database.post(data=database_data)

        db = Database(
            name=name,
            api=api,
            kwargs=data
        )

        Client.instance().set_database(name=name)

        return db
291138
def create(name, dry_run, verbose, query=None, parent=None):
    """"""
    if parent is not None:
        parent = Collection.query.filter_by(name=parent).one().id
    collection = Collection(name=name, dbquery=query, parent_id=parent)
    db.session.add(collection)
    if verbose:
        click.secho('New collection: {0}'.format(collection))
161892
def create_db(name, **client_args):
    '''
    
    '''
    if db_exists(name, **client_args):
        log.info('DB \'%s\' already exists', name)
        return False

    client = _client(**client_args)
    client.create_database(name)

    return True
475112
public InternalTenantContext createInternalTenantContext(final Long tenantRecordId, @Nullable final Long accountRecordId) {
        populateMDCContext(null, accountRecordId, tenantRecordId);

        if (accountRecordId == null) {
            return new InternalTenantContext(tenantRecordId);
        } else {
            final ImmutableAccountData immutableAccountData = getImmutableAccountData(accountRecordId, tenantRecordId);
            final DateTimeZone fixedOffsetTimeZone = immutableAccountData.getFixedOffsetTimeZone();
            final DateTime referenceTime = immutableAccountData.getReferenceTime();
            return new InternalTenantContext(tenantRecordId, accountRecordId, fixedOffsetTimeZone, referenceTime);
        }
    }
952873
def create(self, db_name, **kwargs):
        
        db = PostgresDatabase(
            db_name, host=self.host, port=self.port,
            superuser=self.superuser, **kwargs)
        db.ensure_user()
        db.create()
        return db
1140529
def create(cls, path_name=None, name=None, project_id=None,
               log_modified_at=None, crawlable=True):
        """"""
        result = cls(path_name, name, project_id, log_modified_at, crawlable)

        db.session.add(result)
        db.session.commit()

        crawl_result(result, True)

        return result
611515
def create(self, **kwargs):
        """"""
        resp = self.client.create(url=self.base_url,
                                  json=kwargs)
        return resp
209518
def makeService(cls, options):
        
        from axiom.store import Store
        jm = options['journal-mode']
        if jm is not None:
            jm = jm.decode('ascii')
        store = Store(options['dbdir'], debug=options['debug'], journalMode=jm)
        service = IService(store)
        _CheckSystemVersion(store).setServiceParent(service)
        return service
166991
public void deleteTenantDB(Tenant tenant) {
        synchronized (m_tenantDBMap) {
            DBService dbservice = m_tenantDBMap.remove(tenant.getName());
            if (dbservice != null) {
                m_logger.info("Stopping DBService for deleted tenant: {}", tenant.getName());
                dbservice.stop();
            }
        }
    }
403497
def create_db():
    
    from flask_appbuilder.models.sqla import Model

    engine = current_app.appbuilder.get_session.get_bind(mapper=None, clause=None)
    Model.metadata.create_all(engine)
    click.echo(click.style("DB objects created", fg="green"))
1319848
def service(ctx):
    """"""

    install_service(ctx.obj['instance'], ctx.obj['dbhost'], ctx.obj['dbname'], ctx.obj['port'])
566935
def createDatabase( dbname, dbdesc, createapptoken = "1" )

      @dbname, @dbdesc, @createapptoken = dbname, dbdesc, createapptoken

      xmlRequestData = toXML( :dbname, @dbname )
      xmlRequestData << toXML( :dbdesc, @dbdesc )
      xmlRequestData << toXML( :createapptoken, @createapptoken )

      sendRequest( :createDatabase, xmlRequestData )

      @dbid = getResponseValue( :dbid )
      @appdbid = getResponseValue( :appdbid )
      @apptoken = getResponseValue( :apptoken )

      return self if @chainAPIcalls
      return @dbid, @appdbid
   end
1026034
def create(cls, user_id, github_id=None, name=None, **kwargs):
        """"""
        with db.session.begin_nested():
            obj = cls(user_id=user_id, github_id=github_id, name=name,
                      **kwargs)
            db.session.add(obj)
        return obj
97399
private void createOrOpenBDBDbs() throws Exception {
		// configuration for the mapping dbs
		DatabaseConfig dbConfig = new DatabaseConfig();
		dbConfig.setAllowCreate(true); // db will be created if it does not exist
		dbConfig.setReadOnly(readOnly);
		dbConfig.setTransactional(transactional);
		// create/open mapping dbs using config
		iidToIdDB = dbEnv.openDatabase(null, "idToName", dbConfig);

		// if countSizeOnLoad is true, the id-name mappings are counted and the loadCounter is initialized
		if (countSizeOnLoad) {
			System.out.println(new Date() + " counting index size started ");
			int idToNameMappings = (int) iidToIdDB.count();
			loadCounter = Math.min(idToNameMappings, maxNumVectors);
			System.out.println(new Date() + " counting index size ended ");
			System.out.println("Index size: " + loadCounter);
		}

		idToIidDB = dbEnv.openDatabase(null, "nameToId", dbConfig);

		if (useGeolocation) {// create/open geolocation db using config
			iidToGeolocationDB = dbEnv.openDatabase(null, "idToGeolocation", dbConfig);
		}

		if (useMetaData) {
			StoreConfig storeConfig = new StoreConfig(); // configuration of the entity store
			storeConfig.setAllowCreate(true); // store will be created if it does not exist
			storeConfig.setReadOnly(readOnly);
			storeConfig.setTransactional(transactional);
			iidToMetadataDB = new EntityStore(dbEnv, "idToMetadata", storeConfig);
			// int nameToMetadataMappings = (int) nameToMetadataBDB.getPrimaryIndex(String.class,
			// MediaFeedData.class).count(); // counting the size of an EntityStore
		}
	}