Class DLPReidentifyText
- java.lang.Object
-
- org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<java.lang.String,java.lang.String>>,org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<java.lang.String,com.google.privacy.dlp.v2.ReidentifyContentResponse>>>
-
- org.apache.beam.sdk.extensions.ml.DLPReidentifyText
-
- All Implemented Interfaces:
java.io.Serializable,org.apache.beam.sdk.transforms.display.HasDisplayData
public abstract class DLPReidentifyText extends org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<java.lang.String,java.lang.String>>,org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<java.lang.String,com.google.privacy.dlp.v2.ReidentifyContentResponse>>>APTransformconnecting to Cloud DLP (https://cloud.google.com/dlp/docs/libraries) and inspecting text for identifying data according to provided settings.The transform supports both delimited columnar input data and unstructured input.
If the headerColumns property is set and a sideinput with headers is added to the PTransform, delimiter also should be set, else the results will be incorrect. If headerColumns is neither set nor passed as sideinput, input is assumed to be unstructured.
Batch size defines how big are batches sent to DLP at once in bytes.
The transform consumes
KVofStrings (assumed to be filename as key and contents as value) and outputsKVofString(eg. filename) andReidentifyContentResponse, which will containTableof results for the user to consume.Batch size defines how big are batches sent to DLP at once in bytes.
Either reidentifyTemplateName
Stringor reidentifyConfigDeidentifyConfigneed to be set. inspectConfigInspectConfigand inspectTemplateNameStringare optional.Batch size defines how big are batches sent to DLP at once in bytes.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDLPReidentifyText.Builder
-
Field Summary
Fields Modifier and Type Field Description static java.lang.IntegerDLP_PAYLOAD_LIMIT_BYTES
-
Constructor Summary
Constructors Constructor Description DLPReidentifyText()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<java.lang.String,com.google.privacy.dlp.v2.ReidentifyContentResponse>>expand(org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<java.lang.String,java.lang.String>> input)The transform converts the contents of input PCollection intoTable.Rows and then calls Cloud DLP service to perform the reidentification according to provided settings.abstract intgetBatchSizeBytes()Returns size of input elements batch to be sent to Cloud DLP service in one request.abstract @Nullable java.lang.StringgetColumnDelimiter()Returns delimiter to be used when splitting values from input strings into columns.abstract @Nullable org.apache.beam.sdk.values.PCollectionView<java.util.List<java.lang.String>>getHeaderColumns()Returns list of column names if the input KV value is a delimited row.abstract @Nullable com.google.privacy.dlp.v2.InspectConfiggetInspectConfig()Returns configuration object for data inspection.abstract @Nullable java.lang.StringgetInspectTemplateName()Returns template name for data inspection.abstract java.lang.StringgetProjectId()Returns ID of Google Cloud project to be used when deidentifying data.abstract @Nullable com.google.privacy.dlp.v2.DeidentifyConfiggetReidentifyConfig()Returns configuration object for reidentification.abstract @Nullable java.lang.StringgetReidentifyTemplateName()Returns template name for data reidentification.static DLPReidentifyText.BuildernewBuilder()-
Methods inherited from class org.apache.beam.sdk.transforms.PTransform
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setDisplayData, setResourceHints, toString, validate, validate
-
-
-
-
Method Detail
-
getInspectTemplateName
public abstract @Nullable java.lang.String getInspectTemplateName()
Returns template name for data inspection.
-
getReidentifyTemplateName
public abstract @Nullable java.lang.String getReidentifyTemplateName()
Returns template name for data reidentification.
-
getInspectConfig
public abstract @Nullable com.google.privacy.dlp.v2.InspectConfig getInspectConfig()
Returns configuration object for data inspection. If present, supersedes the template settings.
-
getReidentifyConfig
public abstract @Nullable com.google.privacy.dlp.v2.DeidentifyConfig getReidentifyConfig()
Returns configuration object for reidentification. If present, supersedes the template.
-
getColumnDelimiter
public abstract @Nullable java.lang.String getColumnDelimiter()
Returns delimiter to be used when splitting values from input strings into columns.
-
getHeaderColumns
public abstract @Nullable org.apache.beam.sdk.values.PCollectionView<java.util.List<java.lang.String>> getHeaderColumns()
Returns list of column names if the input KV value is a delimited row.
-
getBatchSizeBytes
public abstract int getBatchSizeBytes()
Returns size of input elements batch to be sent to Cloud DLP service in one request.
-
getProjectId
public abstract java.lang.String getProjectId()
Returns ID of Google Cloud project to be used when deidentifying data.
-
newBuilder
public static DLPReidentifyText.Builder newBuilder()
-
expand
public org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<java.lang.String,com.google.privacy.dlp.v2.ReidentifyContentResponse>> expand(org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<java.lang.String,java.lang.String>> input)
The transform converts the contents of input PCollection intoTable.Rows and then calls Cloud DLP service to perform the reidentification according to provided settings.- Specified by:
expandin classorg.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<java.lang.String,java.lang.String>>,org.apache.beam.sdk.values.PCollection<org.apache.beam.sdk.values.KV<java.lang.String,com.google.privacy.dlp.v2.ReidentifyContentResponse>>>- Parameters:
input- input PCollection- Returns:
- PCollection after transformations
-
-