/** * @param <T> parameter The runtime parameter. * @return the String value of runtime parameter if the parameter is accessible, returns * "Unavailable during pipeline construction" otherwise for debugging purpose. */ protected static <T> String getDisplayValue(ValueProvider<T> parameter) { if (parameter.isAccessible()) { return String.valueOf(parameter.get()); } return VALUE_UNAVAILABLE; }
/** * Gets the table specified by the configuration. * @return The table ID. */ public String getTableId() { return tableId.get(); }
@Override public boolean isAccessible() { return value.isAccessible(); }
@Override public T apply(Void input) { return provider.get(); } }))
@Override public boolean isAccessible() { return projectId.isAccessible() && instanceId.isAccessible() && tableId.isAccessible() && request.isAccessible(); }
ConstantTimePartitioningDestinations( DynamicDestinations<T, TableDestination> inner, ValueProvider<String> jsonTimePartitioning) { super(inner); checkArgument(jsonTimePartitioning != null, "jsonTimePartitioning provider can not be null"); if (jsonTimePartitioning.isAccessible()) { checkArgument(jsonTimePartitioning.get() != null, "jsonTimePartitioning can not be null"); } this.jsonTimePartitioning = jsonTimePartitioning; }
/** * Gets the {@link Scan} used to filter the table. * @return The {@link Scan}. */ public ReadRowsRequest getRequest() { return request.get(); }
@Override public boolean isAccessible() { return valueX.isAccessible() && valueY.isAccessible(); }
@Override public void serialize(ValueProvider<?> value, JsonGenerator jgen, SerializerProvider provider) throws IOException { if (value.isAccessible()) { jgen.writeObject(value.get()); } else { jgen.writeNull(); } } }
/** * Gets the table specified by the configuration. * @return The table ID. */ public String getTableId() { return tableId.get(); }
@Override public boolean isAccessible() { return projectId.isAccessible() && instanceId.isAccessible() && tableId.isAccessible() && request.isAccessible(); }
@ProcessElement public void outputNumShards(ProcessContext ctxt) { checkArgument( numShards.isAccessible(), "NumShards must be accessible at runtime to use constant sharding"); ctxt.output(numShards.get()); } }))
public String getProjectId() { return projectId.get(); } }
@Override public boolean isAccessible() { return start.isAccessible() && stop.isAccessible() && maxVersion.isAccessible() && filter.isAccessible(); }
/** Returns the table being read from. */ @Nullable public String getTableId() { ValueProvider<String> tableId = getBigtableConfig().getTableId(); return tableId != null && tableId.isAccessible() ? tableId.get() : null; }
/** * Gets the project ID for the Cloud Bigtable instance. * @return The project ID for the instance. */ public String getProjectId() { return configuration.get(BigtableOptionsFactory.PROJECT_ID_KEY).get(); }
@Override public boolean isAccessible() { return request.isAccessible(); }
@Override public void validate() { if (!config.getValidate()) { LOG.debug("Validation is disabled"); return; } ValueProvider<String> tableId = config.getTableId(); checkArgument( tableId != null && tableId.isAccessible() && !tableId.get().isEmpty(), "tableId was not supplied"); }
/** Get the topic being read from. */ @Nullable public TopicPath getTopic() { return topic == null ? null : topic.get(); }
/** * Checks if the parameters are accessible. Runtime parameters are not accessible at pipeline * construction time. */ protected boolean areParametersAccessible() { return configuration.get(BigtableOptionsFactory.PROJECT_ID_KEY).isAccessible(); }