Tabnine Logo
org.apache.beam.sdk.util
Code IndexAdd Tabnine to your IDE (free)

How to use org.apache.beam.sdk.util

Best Java code snippets using org.apache.beam.sdk.util (Showing top 20 results out of 315)

origin: org.apache.beam/beam-sdks-java-core

 private ObjectMapper objectMapper() {
  if (this.objectMapper == null) {
   synchronized (this) {
    if (this.objectMapper == null) {
     this.objectMapper = newObjectMapperWith(RowJsonDeserializer.forSchema(this.schema));
    }
   }
  }
  return this.objectMapper;
 }
}
origin: org.apache.beam/beam-sdks-java-core

/**
 * Discovers all shards of this file.
 *
 * <p>Because of eventual consistency, reads may discover no files or fewer files than the shard
 * template implies. In this case, the read is considered to have failed.
 */
public List<String> readFilesWithRetries() throws IOException, InterruptedException {
 return readFilesWithRetries(Sleeper.DEFAULT, BACK_OFF_FACTORY.backoff());
}
origin: org.apache.beam/beam-sdks-java-core

/**
 * Discovers all shards of this file.
 *
 * <p>Because of eventual consistency, reads may discover no files or fewer files than the shard
 * template implies. In this case, the read is considered to have failed.
 */
public List<String> readFilesWithRetries() throws IOException, InterruptedException {
 return readFilesWithRetries(Sleeper.DEFAULT, BACK_OFF_FACTORY.backoff());
}
origin: org.apache.beam/beam-sdks-java-extensions-google-cloud-platform-core

private static BackOff createBackOff() {
 return BackOffAdapter.toGcpBackOff(BACKOFF_FACTORY.backoff());
}
/**
origin: org.apache.beam/beam-sdks-java-core

/**
 * Encodes the given value using the specified Coder, and returns the encoded bytes.
 *
 * <p>This function is not reentrant; it should not be called from methods of the provided {@link
 * Coder}.
 */
public static <T> byte[] encodeToByteArray(Coder<T> coder, T value) throws CoderException {
 return encodeToByteArray(coder, value, Coder.Context.OUTER);
}
origin: org.apache.beam/beam-sdks-java-core

/** Discovers all shards of this file. */
public List<String> readFilesWithRetries() throws IOException, InterruptedException {
 return readFilesWithRetries(Sleeper.DEFAULT, BACK_OFF_FACTORY.backoff());
}
origin: org.apache.beam/beam-sdks-java-core

/** Decodes the given bytes using the specified Coder, and returns the resulting decoded value. */
public static <T> T decodeFromByteArray(Coder<T> coder, byte[] encodedValue)
  throws CoderException {
 return decodeFromByteArray(coder, encodedValue, Coder.Context.OUTER);
}
origin: org.apache.beam/beam-sdks-java-core

private static void unwrapUserCodeException(UserCodeException e) throws Exception {
 if (e.getCause() instanceof Exception) {
  throw (Exception) e.getCause();
 } else if (e.getCause() instanceof Error) {
  throw (Error) e.getCause();
 } else {
  throw e;
 }
}
origin: org.apache.beam/beam-sdks-java-core

public static <K, InputT, AccumT, OutputT>
  AppliedCombineFn<K, InputT, AccumT, OutputT> withAccumulatorCoder(
    GlobalCombineFn<? super InputT, AccumT, OutputT> fn,
    Coder<AccumT> accumCoder,
    Iterable<PCollectionView<?>> sideInputViews,
    KvCoder<K, InputT> kvCoder,
    WindowingStrategy<?, ?> windowingStrategy) {
 // Casting down the K and InputT is safe because they're only used as inputs.
 @SuppressWarnings("unchecked")
 GlobalCombineFn<InputT, AccumT, OutputT> clonedFn =
   (GlobalCombineFn<InputT, AccumT, OutputT>) SerializableUtils.clone(fn);
 return create(clonedFn, accumCoder, sideInputViews, kvCoder, windowingStrategy);
}
origin: org.apache.beam/beam-sdks-java-core

/**
 * Returns the partial application of the {@link CombineFnWithContext} to a specific context to
 * produce a {@link CombineFn}.
 *
 * <p>The returned {@link CombineFn} cannot be serialized.
 */
public static <K, InputT, AccumT, OutputT> CombineFn<InputT, AccumT, OutputT> bindContext(
  CombineFnWithContext<InputT, AccumT, OutputT> combineFn, StateContext<?> stateContext) {
 Context context = CombineContextFactory.createFromStateContext(stateContext);
 return new NonSerializableBoundedCombineFn<>(combineFn, context);
}
origin: org.apache.beam/beam-sdks-java-core

/**
 * Extracts string value from the JsonNode if it is within bounds.
 *
 * <p>Throws {@link UnsupportedRowJsonException} if value is out of bounds.
 */
static ValueExtractor<String> stringValueExtractor() {
 return ValidatingValueExtractor.<String>builder()
   .setExtractor(JsonNode::textValue)
   .setValidator(JsonNode::isTextual)
   .build();
}
origin: org.apache.beam/beam-sdks-java-core

private void throwUserCodeException() {
 try {
  userCode();
 } catch (Exception ex) {
  throw UserCodeException.wrap(ex);
 }
}
origin: org.apache.beam/beam-sdks-java-core

 /**
  * Causes the currently executing thread to sleep (temporarily cease execution) for the specified
  * number of milliseconds. The thread does not lose ownership of any monitors.
  */
 public static void sleepMillis(long millis) throws InterruptedException {
  INSTANCE.sleep(millis);
 }
}
origin: org.apache.beam/beam-sdks-java-core

@Override
protected boolean matchesSafely(
  final ApiSurface apiSurface, final Description mismatchDescription) {
 final boolean noDisallowed =
   verifyNoDisallowed(apiSurface, classMatchers, mismatchDescription);
 final boolean noAbandoned =
   verifyNoAbandoned(apiSurface, classMatchers, mismatchDescription);
 return noDisallowed && noAbandoned;
}
origin: org.apache.beam/beam-sdks-java-core

private BucketingFunction newFunc() {
 return new BucketingFunction(
   BUCKET_WIDTH, SIGNIFICANT_BUCKETS,
   SIGNIFICANT_SAMPLES, SUM);
}
origin: org.apache.beam/beam-sdks-java-core

private static <K, InputT, AccumT, OutputT> AppliedCombineFn<K, InputT, AccumT, OutputT> create(
  GlobalCombineFn<InputT, AccumT, OutputT> fn,
  Coder<AccumT> accumulatorCoder,
  Iterable<PCollectionView<?>> sideInputViews,
  KvCoder<K, InputT> kvCoder,
  WindowingStrategy<?, ?> windowingStrategy) {
 return new AppliedCombineFn<>(fn, accumulatorCoder, sideInputViews, kvCoder, windowingStrategy);
}
origin: org.apache.beam/beam-sdks-java-core

/**
 * Returns a {@code WindowedValue} with the given value in the {@link GlobalWindow} using the
 * default timestamp and the specified pane.
 */
public static <T> WindowedValue<T> valueInGlobalWindow(T value, PaneInfo pane) {
 return new ValueInGlobalWindow<>(value, pane);
}
origin: org.apache.beam/beam-sdks-java-core

@Override
public void verifyDeterministic() throws NonDeterministicException {
 verifyDeterministic(
   this, "FullWindowedValueCoder requires a deterministic valueCoder", valueCoder);
 verifyDeterministic(
   this, "FullWindowedValueCoder requires a deterministic windowCoder", windowCoder);
}
origin: org.apache.beam/beam-sdks-java-core

public static UserCodeException wrap(Throwable t) {
 if (t instanceof UserCodeException) {
  return (UserCodeException) t;
 }
 return new UserCodeException(t);
}
origin: org.apache.beam/beam-sdks-java-core

/**
 * Extracts boolean value from JsonNode if it is within bounds.
 *
 * <p>Throws {@link UnsupportedRowJsonException} if value is out of bounds.
 */
static ValueExtractor<Boolean> booleanValueExtractor() {
 return ValidatingValueExtractor.<Boolean>builder()
   .setExtractor(JsonNode::booleanValue)
   .setValidator(JsonNode::isBoolean)
   .build();
}
org.apache.beam.sdk.util

Most used classes

  • CoderUtils
    Utilities for working with Coders.
  • WindowedValue
    An immutable triple of value, timestamp, and windows.
  • FluentBackoff
    A fluent builder for BackOff objects that allows customization of the retry algorithm.
  • WindowedValue$FullWindowedValueCoder
    Coder for WindowedValue.
  • AppliedCombineFn
    A GlobalCombineFn with a fixed accumulator coder. This is created from a specific application of the
  • UserCodeException,
  • GcsUtil,
  • InstanceBuilder,
  • SerializableUtils,
  • VarInt,
  • GcsPath,
  • BackOffUtils,
  • BackOffAdapter,
  • RetryHttpRequestInitializer,
  • MoreFutures,
  • ApiSurface,
  • CombineContextFactory,
  • CombineFnUtil,
  • WindowedValue$WindowedValueCoder
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now