Package org.apache.storm.hdfs.common

# Class AbstractHDFSWriter

java.lang.Object
org.apache.storm.hdfs.common.AbstractHDFSWriter

All Implemented Interfaces:
  `Writer`

Direct Known Subclasses:
  `AvroGenericRecordHDFSWriter`, `HDFSWriter`, `SequenceFileWriter`

public abstract class AbstractHDFSWriter extends Object implements Writer

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final org.apache.hadoop.fs.Path`
  `filePath`
  `protected long`
  `lastUsedTime`
  `protected boolean`
  `needsRotation`
  `protected long`
  `offset`
  `protected final FileRotationPolicy`
  `rotationPolicy`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AbstractHDFSWriter(FileRotationPolicy policy, org.apache.hadoop.fs.Path path)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final void`
  `close()`
  `protected abstract void`
  `doClose()`
  `protected abstract void`
  `doSync()`
  `protected abstract void`
  `doWrite(Tuple tuple)`
  `org.apache.hadoop.fs.Path`
  `getFilePath()`
  `boolean`
  `needsRotation()`
  `final void`
  `sync()`
  `final long`
  `write(Tuple tuple)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### filePath

    protected final org.apache.hadoop.fs.Path filePath

  - ### rotationPolicy

    protected final FileRotationPolicy rotationPolicy

  - ### lastUsedTime

    protected long lastUsedTime

  - ### offset

    protected long offset

  - ### needsRotation

    protected boolean needsRotation

- ## Constructor Details

  - ### AbstractHDFSWriter

    public AbstractHDFSWriter(FileRotationPolicy policy, org.apache.hadoop.fs.Path path)

- ## Method Details

  - ### write

    public final long write(Tuple tuple) throws IOException
    Specified by:
      `write` in interface `Writer`
    Throws:
      `IOException`

  - ### sync

    public final void sync() throws IOException
    Specified by:
      `sync` in interface `Writer`
    Throws:
      `IOException`

  - ### close

    public final void close() throws IOException
    Specified by:
      `close` in interface `Writer`
    Throws:
      `IOException`

  - ### needsRotation

    public boolean needsRotation()
    Specified by:
      `needsRotation` in interface `Writer`

  - ### getFilePath

    public org.apache.hadoop.fs.Path getFilePath()
    Specified by:
      `getFilePath` in interface `Writer`

  - ### doWrite

    protected abstract void doWrite(Tuple tuple) throws IOException
    Throws:
      `IOException`

  - ### doSync

    protected abstract void doSync() throws IOException
    Throws:
      `IOException`

  - ### doClose

    protected abstract void doClose() throws IOException
    Throws:
      `IOException`