Java Code Examples for org.apache.beam.sdk.transforms.display.DisplayData#Builder

The following examples show how to use org.apache.beam.sdk.transforms.display.DisplayData#Builder . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BigtableIO.java    From beam with Apache License 2.0 6 votes vote down vote up
@Override
public void populateDisplayData(DisplayData.Builder builder) {
  super.populateDisplayData(builder);
  getBigtableConfig().populateDisplayData(builder);

  List<ByteKeyRange> keyRanges = getKeyRanges();
  for (int i = 0; i < keyRanges.size() && i < 5; i++) {
    builder.addIfNotDefault(
        DisplayData.item("keyRange " + i, keyRanges.get(i).toString()),
        ByteKeyRange.ALL_KEYS.toString());
  }

  if (getRowFilter() != null) {
    builder.add(
        DisplayData.item("rowFilter", getRowFilter().toString()).withLabel("Table Row Filter"));
  }
}
 
Example 2
Source File: CalendarWindows.java    From beam with Apache License 2.0 5 votes vote down vote up
@Override
public void populateDisplayData(DisplayData.Builder builder) {
  super.populateDisplayData(builder);

  builder
      .add(DisplayData.item("numYears", number).withLabel("Window Years"))
      .addIfNotDefault(
          DisplayData.item("startDate", new DateTime(startDate, timeZone).toInstant())
              .withLabel("Window Start Date"),
          new DateTime(DEFAULT_START_DATE, DateTimeZone.UTC).toInstant());
}
 
Example 3
Source File: WriteFiles.java    From beam with Apache License 2.0 5 votes vote down vote up
@Override
public void populateDisplayData(DisplayData.Builder builder) {
  super.populateDisplayData(builder);
  builder
      .add(DisplayData.item("sink", getSink().getClass()).withLabel("WriteFiles Sink"))
      .include("sink", getSink());
  if (getComputeNumShards() != null) {
    builder.include("sharding", getComputeNumShards());
  } else {
    builder.addIfNotNull(
        DisplayData.item("numShards", getNumShardsProvider())
            .withLabel("Fixed Number of Shards"));
  }
}
 
Example 4
Source File: Combine.java    From beam with Apache License 2.0 5 votes vote down vote up
private static void populateGlobalDisplayData(
    DisplayData.Builder builder, int fanout, boolean insertDefault) {
  builder
      .addIfNotDefault(DisplayData.item("fanout", fanout).withLabel("Key Fanout Size"), 0)
      .add(
          DisplayData.item("emitDefaultOnEmptyInput", insertDefault)
              .withLabel("Emit Default On Empty Input"));
}
 
Example 5
Source File: DatastoreV1.java    From beam with Apache License 2.0 5 votes vote down vote up
@Override
public void populateDisplayData(DisplayData.Builder builder) {
  builder
      .addIfNotNull(
          DisplayData.item("projectId", getProjectValueProvider()).withLabel("ProjectId"))
      .addIfNotNull(
          DisplayData.item("namespace", getNamespaceValueProvider()).withLabel("Namespace"));
}
 
Example 6
Source File: WriteRename.java    From beam with Apache License 2.0 5 votes vote down vote up
@Override
public void populateDisplayData(DisplayData.Builder builder) {
  super.populateDisplayData(builder);

  builder
      .add(
          DisplayData.item("firstPaneWriteDisposition", firstPaneWriteDisposition.toString())
              .withLabel("Write Disposition"))
      .add(
          DisplayData.item("firstPaneCreateDisposition", firstPaneCreateDisposition.toString())
              .withLabel("Create Disposition"));
}
 
Example 7
Source File: AvroIO.java    From beam with Apache License 2.0 5 votes vote down vote up
@Override
public void populateDisplayData(DisplayData.Builder builder) {
  super.populateDisplayData(builder);
  builder
      .add(
          DisplayData.item("inferBeamSchema", getInferBeamSchema())
              .withLabel("Infer Beam Schema"))
      .addIfNotNull(DisplayData.item("schema", String.valueOf(getSchema())))
      .addIfNotNull(
          DisplayData.item("recordClass", getRecordClass()).withLabel("Record Class"));
}
 
Example 8
Source File: Combine.java    From beam with Apache License 2.0 5 votes vote down vote up
@Override
public void populateDisplayData(DisplayData.Builder builder) {
  super.populateDisplayData(builder);

  Combine.populateDisplayData(builder, fn, fnDisplayData);
  if (hotKeyFanout instanceof HasDisplayData) {
    builder.include("hotKeyFanout", (HasDisplayData) hotKeyFanout);
  }
  builder.add(
      DisplayData.item("fanoutFn", hotKeyFanout.getClass()).withLabel("Fanout Function"));
}
 
Example 9
Source File: KafkaIO.java    From beam with Apache License 2.0 4 votes vote down vote up
@Override
public void populateDisplayData(DisplayData.Builder builder) {
  super.populateDisplayData(builder);
  kvWriteTransform.populateDisplayData(builder);
}
 
Example 10
Source File: AmqpIO.java    From beam with Apache License 2.0 4 votes vote down vote up
@Override
public void populateDisplayData(DisplayData.Builder builder) {
  builder.add(DisplayData.item("addresses", Joiner.on(" ").join(addresses())));
}
 
Example 11
Source File: DynamicJdbcIO.java    From DataflowTemplates with Apache License 2.0 4 votes vote down vote up
private void populateDisplayData(DisplayData.Builder builder) {
  builder.addIfNotNull(DisplayData.item("jdbcDriverClassName", getDriverClassName()));
  builder.addIfNotNull(DisplayData.item("jdbcUrl", getUrl()));
  builder.addIfNotNull(DisplayData.item("username", getUsername()));
  builder.addIfNotNull(DisplayData.item("driverJars", getDriverJars()));
}
 
Example 12
Source File: Min.java    From beam with Apache License 2.0 4 votes vote down vote up
@Override
public void populateDisplayData(DisplayData.Builder builder) {
  super.populateDisplayData(builder);
  builder.add(DisplayData.item("comparer", comparator.getClass()).withLabel("Record Comparer"));
}
 
Example 13
Source File: PubsubIO.java    From beam with Apache License 2.0 4 votes vote down vote up
@Override
public void populateDisplayData(DisplayData.Builder builder) {
  super.populateDisplayData(builder);
  populateCommonDisplayData(
      builder, getTimestampAttribute(), getIdAttribute(), getTopicProvider());
}
 
Example 14
Source File: CombineFns.java    From beam with Apache License 2.0 4 votes vote down vote up
@Override
public void populateDisplayData(DisplayData.Builder builder) {
  super.populateDisplayData(builder);
  CombineFns.populateDisplayData(builder, combineFns);
}
 
Example 15
Source File: Filter.java    From beam with Apache License 2.0 4 votes vote down vote up
@Override
public void populateDisplayData(DisplayData.Builder builder) {
  super.populateDisplayData(builder);
  builder.add(DisplayData.item("predicate", predicateDescription).withLabel("Filter Predicate"));
}
 
Example 16
Source File: CombineFns.java    From beam with Apache License 2.0 4 votes vote down vote up
@Override
public void populateDisplayData(DisplayData.Builder builder) {
  super.populateDisplayData(builder);
  CombineFns.populateDisplayData(builder, combineFnWithContexts);
}
 
Example 17
Source File: Sample.java    From beam with Apache License 2.0 4 votes vote down vote up
@Override
public void populateDisplayData(DisplayData.Builder builder) {
  super.populateDisplayData(builder);
  builder.add(DisplayData.item("sampleSize", sampleSize).withLabel("Sample Size"));
}
 
Example 18
Source File: HCatalogIO.java    From beam with Apache License 2.0 4 votes vote down vote up
@Override
public void populateDisplayData(DisplayData.Builder builder) {
  spec.populateDisplayData(builder);
}
 
Example 19
Source File: KafkaIO.java    From beam with Apache License 2.0 4 votes vote down vote up
@Override
public void populateDisplayData(DisplayData.Builder builder) {
  super.populateDisplayData(builder);
  read.populateDisplayData(builder);
}
 
Example 20
Source File: InferableFunction.java    From beam with Apache License 2.0 2 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * <p>By default, does not register any display data. Implementors may override this method to
 * provide their own display data.
 */
@Override
public void populateDisplayData(DisplayData.Builder builder) {}