org.apache.tez.runtime.library.shuffle.common
Class FetchedInput

java.lang.Object
  extended by org.apache.tez.runtime.library.shuffle.common.FetchedInput
Direct Known Subclasses:
DiskFetchedInput, MemoryFetchedInput

@InterfaceAudience.Private
public abstract class FetchedInput
extends Object


Nested Class Summary
protected static class FetchedInput.State
           
static class FetchedInput.Type
           
 
Field Summary
protected  long actualSize
           
protected  FetchedInputCallback callback
           
protected  long compressedSize
           
protected  int id
           
protected  InputAttemptIdentifier inputAttemptIdentifier
           
protected  FetchedInput.State state
           
protected  FetchedInput.Type type
           
 
Constructor Summary
FetchedInput(FetchedInput.Type type, long actualSize, long compressedSize, InputAttemptIdentifier inputAttemptIdentifier, FetchedInputCallback callbackHandler)
           
 
Method Summary
abstract  void abort()
          Abort the output.
abstract  void commit()
          Commit the output.
 boolean equals(Object obj)
           
abstract  void free()
          Called when this input has been consumed, so that resources can be reclaimed.
 long getActualSize()
           
 long getCompressedSize()
           
 InputAttemptIdentifier getInputAttemptIdentifier()
           
abstract  InputStream getInputStream()
          Return an input stream to be used to read the previously fetched data.
abstract  OutputStream getOutputStream()
          Returns the output stream to be used to write fetched data.
 FetchedInput.Type getType()
           
 int hashCode()
           
 void notifyFetchComplete()
          Inform the Allocator about a committed resource.
 void notifyFetchFailure()
          Inform the Allocator about a failed resource.
 void notifyFreedResource()
          Inform the Allocator about a completed resource being released.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inputAttemptIdentifier

protected InputAttemptIdentifier inputAttemptIdentifier

actualSize

protected final long actualSize

compressedSize

protected final long compressedSize

type

protected final FetchedInput.Type type

callback

protected final FetchedInputCallback callback

id

protected final int id

state

protected FetchedInput.State state
Constructor Detail

FetchedInput

public FetchedInput(FetchedInput.Type type,
                    long actualSize,
                    long compressedSize,
                    InputAttemptIdentifier inputAttemptIdentifier,
                    FetchedInputCallback callbackHandler)
Method Detail

getType

public FetchedInput.Type getType()

getActualSize

public long getActualSize()

getCompressedSize

public long getCompressedSize()

getInputAttemptIdentifier

public InputAttemptIdentifier getInputAttemptIdentifier()

notifyFetchComplete

public void notifyFetchComplete()
Inform the Allocator about a committed resource. This should be called by commit


notifyFetchFailure

public void notifyFetchFailure()
Inform the Allocator about a failed resource. This should be called by abort


notifyFreedResource

public void notifyFreedResource()
Inform the Allocator about a completed resource being released. This should be called by free


getOutputStream

public abstract OutputStream getOutputStream()
                                      throws IOException
Returns the output stream to be used to write fetched data. Users are expected to close the OutputStream when they're done

Throws:
IOException

getInputStream

public abstract InputStream getInputStream()
                                    throws IOException
Return an input stream to be used to read the previously fetched data. Users are expected to close the InputStream when they're done

Throws:
IOException

commit

public abstract void commit()
                     throws IOException
Commit the output. Should be idempotent

Throws:
IOException

abort

public abstract void abort()
                    throws IOException
Abort the output. Should be idempotent

Throws:
IOException

free

public abstract void free()
Called when this input has been consumed, so that resources can be reclaimed.


hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2014 Apache Software Foundation. All rights reserved.