Class DatabaseDestination
java.lang.Object
io.github.flink.gcp.connector.firestore.DatabaseDestination
- All Implemented Interfaces:
Serializable
A Firestore database in Native mode: a project and a database id.
A database, not a collection, is as far as the sink's destination goes: every write names its own document path, and collections are implicit in Firestore — the first write into one creates it. That is why the sink takes no destination resolver and has nothing to create.
Instances are pure database identity: equals(Object) and hashCode()
are defined over exactly (project, database id). How the client reaches the database — an
emulator endpoint, a service-account key — belongs to the direction that takes it.
This type sits at the module root rather than under sink because the later source and
table directions take the same value.
Instances are immutable and cheap to reuse.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe id of the database every project is created with. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the database id.Returns the Google Cloud project id.inthashCode()static DatabaseDestinationCreates a reference to a project's "(default)" database.static DatabaseDestinationCreates a reference to a named database.toString()Returns the database as the resource name Firestore itself uses,projects/P/databases/D.
-
Field Details
-
DEFAULT_DATABASE_ID
The id of the database every project is created with.- See Also:
-
-
Method Details
-
of
Creates a reference to a project's "(default)" database.- Parameters:
project- the Google Cloud project id, as a bare id rather than a resource path- Returns:
- the database reference
- Throws:
IllegalArgumentException- if the project is null or blank, has leading or trailing whitespace, or contains'/'— a separator would make the composed resource path address a different resource
-
of
Creates a reference to a named database.- Parameters:
project- the Google Cloud project id, as a bare id rather than a resource pathdatabaseId- the database id, for example "(default)"- Returns:
- the database reference
- Throws:
IllegalArgumentException- if a component is null or blank, has leading or trailing whitespace, or contains'/'— a separator would make the composed resource path address a different resource
-
getProject
Returns the Google Cloud project id. -
getDatabaseId
Returns the database id. -
toString
Returns the database as the resource name Firestore itself uses,projects/P/databases/D. -
equals
-
hashCode
public int hashCode()
-