Creates a new Path.

@param databaseName The Firestore database name.
@param segments The segments of the path relative to the root collections.
556322
static ResourcePath create(DatabaseRootName databaseName, ImmutableList<String> segments) {
    return new AutoValue_ResourcePath(segments, databaseName);
  }
639711
static final ZooRollingSession open(String dbName) {
        if (!ZooHelper.dbExists(dbName)) {
            // create database
            // By default, all database files will be created in %USER_HOME%/zoodb
            ZooHelper.createDb(dbName);
        }
		return new ZooRollingSession(dbName);
	}
806177
def database_root_path(cls, project, database):
        """"""
        return google.api_core.path_template.expand(
            "projects/{project}/databases/{database}",
            project=project,
            database=database,
        )
1323353
private SegmentMetadataUpdateTransaction getOrCreateSegmentUpdateTransaction(String segmentName, long segmentId) {
        SegmentMetadataUpdateTransaction sm = tryGetSegmentUpdateTransaction(segmentId);
        if (sm == null) {
            SegmentMetadata baseSegmentMetadata = createSegmentMetadata(segmentName, segmentId);
            sm = new SegmentMetadataUpdateTransaction(baseSegmentMetadata, this.recoveryMode);
            this.segmentUpdates.put(segmentId, sm);
        }

        return sm;
    }
423828
private void createDatabaseIfNotExist(boolean drop) throws URISyntaxException, IOException, ClientProtocolException
    {
        boolean exist = checkForDBExistence();

        if (exist && drop)
        {
            dropDatabase();
            exist = false;
        }
        if (!exist)
        {
            URI uri = new URI(CouchDBConstants.PROTOCOL, null, httpHost.getHostName(), httpHost.getPort(),
                    CouchDBConstants.URL_SEPARATOR + databaseName.toLowerCase(), null, null);

            HttpPut put = new HttpPut(uri);
            HttpResponse putRes = null;
            try
            {
                // creating database.
                putRes = httpClient.execute(httpHost, put, CouchDBUtils.getContext(httpHost));
            }
            finally
            {
                CouchDBUtils.closeContent(putRes);
            }
        }
    }
14652
@SuppressWarnings({ "unchecked", "rawtypes" })
	@Pure
	protected GP newPath(PT startPoint, ST segment) {
		if (this.pathFactory != null) {
			return this.pathFactory.newPath(startPoint, segment);
		}
		try {
			return (GP) new GraphPath(segment, startPoint);
		} catch (Throwable e) {
			throw new IllegalStateException(Locale.getString("E2"), e); //$NON-NLS-1$
		}
	}
159433
protected function createArchiveDatabaseDirectoryIfNotExists($database)
    {
        $path = $this->archivesPath . $database . '/';
        
        if( ! is_dir($path) )
        {
            Filesystem::createFolder($path);
        }
    }
913916
@InterfaceAudience.Private
    private String pathForDatabaseNamed(String name) {
        if ((name == null) || (name.length() == 0) || Pattern.matches(LEGAL_CHARACTERS, name))
            return null;
        // NOTE: CouchDB allows forward slash as part of database name.
        //       However, ':' is illegal character on Windows platform.
        //       For Windows, substitute with period '.'
        name = isWindows() ? name.replace('/', '.') : name.replace('/', ':');
        String result = directoryFile.getPath() + File.separator + name + Manager.kDBExtension;
        return result;
    }
262532
public static CuratorFramework useNamespaceAndEnsurePath(final CuratorFramework client, final String path) throws Exception {
		Preconditions.checkNotNull(client, "client must not be null");
		Preconditions.checkNotNull(path, "path must not be null");

		// Ensure that the checkpoints path exists
		client.newNamespaceAwareEnsurePath(path)
			.ensure(client.getZookeeperClient());

		// All operations will have the path as root
		return client.usingNamespace(generateZookeeperPath(client.getNamespace(), path));
	}
2617
private UpdateableSegmentMetadata createSegmentMetadata(String segmentName, long segmentId) {
        UpdateableSegmentMetadata metadata = new StreamSegmentMetadata(segmentName, segmentId, this.containerId);
        this.newSegments.put(metadata.getId(), metadata);
        this.newSegmentNames.put(metadata.getName(), metadata.getId());
        return metadata;
    }
1019676
public static Connection createSpatialDataBase(String dbName,boolean initSpatial, String h2Parameters )throws SQLException, ClassNotFoundException {
        String databasePath = initDBFile(dbName, h2Parameters);
        org.h2.Driver.load();
        // Keep a connection alive to not close the DataBase on each unit test
        Connection connection = DriverManager.getConnection(databasePath,
                "sa", "sa");
        // Init spatial ext
        if(initSpatial) {
            H2GISFunctions.load(connection);
        }
        return connection;
    }
121794
public void createMongoDBCollection(String colectionName, DataTable options) {
        BasicDBObject aux = new BasicDBObject();
        // Recorremos las options para castearlas y añadirlas a la collection
        List<List<String>> rowsOp = options.raw();
        for (int i = 0; i < rowsOp.size(); i++) {
            List<String> rowOp = rowsOp.get(i);
            if (rowOp.get(0).equals("size") || rowOp.get(0).equals("max")) {
                int intproperty = Integer.parseInt(rowOp.get(1));
                aux.append(rowOp.get(0), intproperty);
            } else {
                Boolean boolProperty = Boolean.parseBoolean(rowOp.get(1));
                aux.append(rowOp.get(0), boolProperty);
            }
        }
        dataBase.createCollection(colectionName, aux);
    }
943667
@Override
	public JdbcDatabaseDescriptor dbByName(final String dbName) {
		Collection<H2DatabaseWorking> select = CollectionUtils.select(dbsw, new Predicate<H2DatabaseWorking>() {

			@Override
			public boolean evaluate(H2DatabaseWorking db) {
				return dbName.equals( db.getName() );
			}

		});
		if(CollectionUtils.size(select)==0){
			throw new IllegalArgumentException("There are no databases called '" + dbName + "'");
		}
		if(CollectionUtils.size(select)>=2){
			throw new IllegalArgumentException("More than one database is called '" + dbName + "'");
		}
		return CollectionUtils.extractSingleton( select );
	}
15471
@Override
    public Map<String, Optional<Partition>> getPartitionsByNames(String databaseName, String tableName, List<String> partitionNames)
    {
        requireNonNull(partitionNames, "partitionNames is null");
        if (partitionNames.isEmpty()) {
            return ImmutableMap.of();
        }

        List<Partition> partitions = batchGetPartition(databaseName, tableName, partitionNames);

        Map<String, List<String>> partitionNameToPartitionValuesMap = partitionNames.stream()
                .collect(toMap(identity(), HiveUtil::toPartitionValues));
        Map<List<String>, Partition> partitionValuesToPartitionMap = partitions.stream()
                .collect(toMap(Partition::getValues, identity()));

        ImmutableMap.Builder<String, Optional<Partition>> resultBuilder = ImmutableMap.builder();
        for (Entry<String, List<String>> entry : partitionNameToPartitionValuesMap.entrySet()) {
            Partition partition = partitionValuesToPartitionMap.get(entry.getValue());
            resultBuilder.put(entry.getKey(), Optional.ofNullable(partition));
        }
        return resultBuilder.build();
    }
144192
def createNew(cls, store, pathSegments):
        
        if isinstance(pathSegments, basestring):
            raise ValueError(
                'Received %r instead of a sequence' % (pathSegments,))
        if store.dbdir is None:
            self = cls(store=store, storepath=None)
        else:
            storepath = store.newDirectory(*pathSegments)
            self = cls(store=store, storepath=storepath)
        self.open()
        self.close()
        return self
438038
private static synchronized void addDatabaseObject(String type,
            String path, Database db) {

        // A VoltDB extension to work around ENG-6044
        /* disable 15 lines ...
        Object  key = path;

        HashMap databaseMap;

        if (type == DatabaseURL.S_FILE) {
            databaseMap = fileDatabaseMap;
            key         = filePathToKey(path);
        } else if (type == DatabaseURL.S_RES) {
            databaseMap = resDatabaseMap;
        } else if (type == DatabaseURL.S_MEM) {
            databaseMap = memDatabaseMap;
        } else {
            throw Error.runtimeError(ErrorCode.U_S0500,
                                     "DatabaseManager.addDatabaseObject()");
        }
           ... disabled 15 lines */

        assert(type == DatabaseURL.S_MEM);
        java.util.HashMap<String, Database> databaseMap = memDatabaseMap;
        String key = path;
        // End of VoltDB extension

        databaseIDMap.put(db.databaseID, db);
        databaseMap.put(key, db);
    }
1292614
@Override
	public void createTable(ObjectPath tablePath, CatalogBaseTable table, boolean ignoreIfExists)
		throws TableAlreadyExistException, DatabaseNotExistException {
		checkNotNull(tablePath);
		checkNotNull(table);

		if (!databaseExists(tablePath.getDatabaseName())) {
			throw new DatabaseNotExistException(catalogName, tablePath.getDatabaseName());
		}

		if (tableExists(tablePath)) {
			if (!ignoreIfExists) {
				throw new TableAlreadyExistException(catalogName, tablePath);
			}
		} else {
			tables.put(tablePath, table.copy());

			if ((table instanceof CatalogTable) && ((CatalogTable) table).isPartitioned()) {
				partitions.put(tablePath, new LinkedHashMap<>());
			}
		}
	}