Class DatastoreV1.Write
- java.lang.Object
-
- org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<com.google.datastore.v1.Entity>,org.apache.beam.sdk.values.PDone>
-
- org.apache.beam.sdk.io.gcp.datastore.DatastoreV1.Write
-
- All Implemented Interfaces:
java.io.Serializable,org.apache.beam.sdk.transforms.display.HasDisplayData
- Enclosing class:
- DatastoreV1
public static class DatastoreV1.Write extends org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<com.google.datastore.v1.Entity>,org.apache.beam.sdk.values.PDone>APTransformthat writesEntityobjects to Cloud Datastore.- See Also:
DatastoreIO, Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.beam.sdk.values.PDoneexpand(org.apache.beam.sdk.values.PCollection<com.google.datastore.v1.Entity> input)java.lang.StringgetDatabaseId()java.lang.StringgetProjectId()voidpopulateDisplayData(org.apache.beam.sdk.transforms.display.DisplayData.Builder builder)java.lang.StringtoString()DatastoreV1.WritewithDatabaseId(java.lang.String databaseId)Returns a newDatastoreV1.Writethat writes to the Cloud Datastore for the database id.DatastoreV1.WritewithDatabaseId(org.apache.beam.sdk.options.ValueProvider<java.lang.String> databaseId)Same aswithDatabaseId(String)but with aValueProvider.DatastoreV1.WritewithHintNumWorkers(int hintNumWorkers)Returns a newDatastoreV1.Writewith a different worker count hint for ramp-up throttling.DatastoreV1.WritewithHintNumWorkers(org.apache.beam.sdk.options.ValueProvider<java.lang.Integer> hintNumWorkers)Same aswithHintNumWorkers(int)but with aValueProvider.DatastoreV1.WritewithLocalhost(java.lang.String localhost)Returns a newDatastoreV1.Writethat writes to the Cloud Datastore Emulator running locally on the specified host port.DatastoreV1.WritewithProjectId(java.lang.String projectId)Returns a newDatastoreV1.Writethat writes to the Cloud Datastore for the default database.DatastoreV1.WritewithProjectId(org.apache.beam.sdk.options.ValueProvider<java.lang.String> projectId)Same aswithProjectId(String)but with aValueProvider.DatastoreV1.WritewithRampupThrottlingDisabled()Returns a newDatastoreV1.Writethat does not throttle during ramp-up.DatastoreV1.WriteWithSummarywithResults()ReturnsDatastoreV1.WriteWithSummarytransform which can be used inWait.on(PCollection[])to wait until all data is written.-
Methods inherited from class org.apache.beam.sdk.transforms.PTransform
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, setDisplayData, setResourceHints, validate, validate
-
-
-
-
Method Detail
-
withProjectId
public DatastoreV1.Write withProjectId(java.lang.String projectId)
Returns a newDatastoreV1.Writethat writes to the Cloud Datastore for the default database.
-
withDatabaseId
public DatastoreV1.Write withDatabaseId(java.lang.String databaseId)
Returns a newDatastoreV1.Writethat writes to the Cloud Datastore for the database id.
-
withProjectId
public DatastoreV1.Write withProjectId(org.apache.beam.sdk.options.ValueProvider<java.lang.String> projectId)
Same aswithProjectId(String)but with aValueProvider.
-
withDatabaseId
public DatastoreV1.Write withDatabaseId(org.apache.beam.sdk.options.ValueProvider<java.lang.String> databaseId)
Same aswithDatabaseId(String)but with aValueProvider.
-
withLocalhost
public DatastoreV1.Write withLocalhost(java.lang.String localhost)
Returns a newDatastoreV1.Writethat writes to the Cloud Datastore Emulator running locally on the specified host port.
-
withRampupThrottlingDisabled
public DatastoreV1.Write withRampupThrottlingDisabled()
Returns a newDatastoreV1.Writethat does not throttle during ramp-up.
-
withHintNumWorkers
public DatastoreV1.Write withHintNumWorkers(int hintNumWorkers)
Returns a newDatastoreV1.Writewith a different worker count hint for ramp-up throttling. Value is ignored if ramp-up throttling is disabled.
-
withHintNumWorkers
public DatastoreV1.Write withHintNumWorkers(org.apache.beam.sdk.options.ValueProvider<java.lang.Integer> hintNumWorkers)
Same aswithHintNumWorkers(int)but with aValueProvider.
-
withResults
public DatastoreV1.WriteWithSummary withResults()
ReturnsDatastoreV1.WriteWithSummarytransform which can be used inWait.on(PCollection[])to wait until all data is written.Example: write a
PCollectionto one database and then to another database, making sure that writing a window of data to the second database starts only after the respective window has been fully written to the first database.PCollection<Entity> entities = ... ; PCollection<DatastoreV1.WriteSuccessSummary> writeSummary = entities.apply(DatastoreIO.v1().write().withProjectId(project).withResults());
-
toString
public java.lang.String toString()
- Overrides:
toStringin classorg.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<com.google.datastore.v1.Entity>,org.apache.beam.sdk.values.PDone>
-
populateDisplayData
public void populateDisplayData(org.apache.beam.sdk.transforms.display.DisplayData.Builder builder)
- Specified by:
populateDisplayDatain interfaceorg.apache.beam.sdk.transforms.display.HasDisplayData- Overrides:
populateDisplayDatain classorg.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<com.google.datastore.v1.Entity>,org.apache.beam.sdk.values.PDone>
-
getProjectId
public java.lang.String getProjectId()
-
getDatabaseId
public java.lang.String getDatabaseId()
-
expand
public org.apache.beam.sdk.values.PDone expand(org.apache.beam.sdk.values.PCollection<com.google.datastore.v1.Entity> input)
- Specified by:
expandin classorg.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<com.google.datastore.v1.Entity>,org.apache.beam.sdk.values.PDone>
-
-