Class StateBackedIterable.Coder<T>

  • All Implemented Interfaces:
    java.io.Serializable
    Enclosing class:
    StateBackedIterable<T>

    public static class StateBackedIterable.Coder<T>
    extends org.apache.beam.sdk.coders.IterableLikeCoder<T,​java.lang.Iterable<T>>
    Decodes an Iterable that might be backed by state. If the terminator at the end of the value stream is -1 then we return a StateBackedIterable otherwise we return an Iterable.
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.apache.beam.sdk.coders.Coder

        org.apache.beam.sdk.coders.Coder.Context, org.apache.beam.sdk.coders.Coder.NonDeterministicException
    • Constructor Summary

      Constructors 
      Constructor Description
      Coder​(java.util.function.Supplier<Cache<?,​?>> cache, BeamFnStateClient beamFnStateClient, java.util.function.Supplier<java.lang.String> instructionId, org.apache.beam.sdk.coders.Coder<T> elemCoder)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.Iterable<T> decodeToIterable​(java.util.List<T> decodedElements)  
      protected java.lang.Iterable<T> decodeToIterable​(java.util.List<T> decodedElements, long terminatorValue, java.io.InputStream in)  
      void encode​(java.lang.Iterable<T> iterable, java.io.OutputStream outStream)  
      • Methods inherited from class org.apache.beam.sdk.coders.IterableLikeCoder

        decode, getCoderArguments, getElemCoder, isRegisterByteSizeObserverCheap, registerByteSizeObserver, verifyDeterministic
      • Methods inherited from class org.apache.beam.sdk.coders.StructuredCoder

        equals, getComponents, hashCode, toString
      • Methods inherited from class org.apache.beam.sdk.coders.Coder

        consistentWithEquals, decode, encode, getEncodedElementByteSize, getEncodedElementByteSizeUsingCoder, getEncodedTypeDescriptor, structuralValue, verifyDeterministic, verifyDeterministic
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Coder

        public Coder​(java.util.function.Supplier<Cache<?,​?>> cache,
                     BeamFnStateClient beamFnStateClient,
                     java.util.function.Supplier<java.lang.String> instructionId,
                     org.apache.beam.sdk.coders.Coder<T> elemCoder)
    • Method Detail

      • decodeToIterable

        protected java.lang.Iterable<T> decodeToIterable​(java.util.List<T> decodedElements)
        Specified by:
        decodeToIterable in class org.apache.beam.sdk.coders.IterableLikeCoder<T,​java.lang.Iterable<T>>
      • decodeToIterable

        protected java.lang.Iterable<T> decodeToIterable​(java.util.List<T> decodedElements,
                                                         long terminatorValue,
                                                         java.io.InputStream in)
                                                  throws java.io.IOException
        Overrides:
        decodeToIterable in class org.apache.beam.sdk.coders.IterableLikeCoder<T,​java.lang.Iterable<T>>
        Throws:
        java.io.IOException
      • encode

        public void encode​(java.lang.Iterable<T> iterable,
                           java.io.OutputStream outStream)
                    throws java.io.IOException
        Overrides:
        encode in class org.apache.beam.sdk.coders.IterableLikeCoder<T,​java.lang.Iterable<T>>
        Throws:
        java.io.IOException