org.apache.storm.hdfs.bolt.format

## Class SimpleFileNameFormat

- java.lang.Object
- - org.apache.storm.hdfs.bolt.format.SimpleFileNameFormat

- All Implemented Interfaces:
    Serializable, FileNameFormat

      public class SimpleFileNameFormat
      extends Object
      implements FileNameFormat

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleFileNameFormat()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getName(long rotation, long timeStamp)` Returns the filename the HdfsBolt will create.
    `String` | `getPath()`
    `void` | `prepare(Map<String,Object> conf, TopologyContext topologyContext)`
    `SimpleFileNameFormat` | `withName(String name)` support parameters: $TIME - current time.
    `SimpleFileNameFormat` | `withPath(String path)`
    `SimpleFileNameFormat` | `withTimeFormat(String timeFormat)`

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

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

- - ### Constructor Detail

    - #### SimpleFileNameFormat

          public SimpleFileNameFormat()

  - ### Method Detail

    - #### getName

          public String getName(long rotation,
                                long timeStamp)

      Description copied from interface: `FileNameFormat`

      Returns the filename the HdfsBolt will create.

      Specified by:
        `getName` in interface `FileNameFormat`
      Parameters:
        `rotation` - the current file rotation number (incremented on every rotation)
        `timeStamp` - current time in milliseconds when the rotation occurs

    - #### getPath

          public String getPath()

      Specified by:
        `getPath` in interface `FileNameFormat`

    - #### prepare

          public void prepare(Map<String,Object> conf,
                              TopologyContext topologyContext)

      Specified by:
        `prepare` in interface `FileNameFormat`

    - #### withPath

          public SimpleFileNameFormat withPath(String path)

    - #### withName

          public SimpleFileNameFormat withName(String name)

      support parameters:
      $TIME - current time. use `withTimeFormat` to format.
      $NUM - rotation number
      $HOST - local host name
      $COMPONENT - component id
      $TASK - task id

      Parameters:
        `name` - file name

    - #### withTimeFormat

          public SimpleFileNameFormat withTimeFormat(String timeFormat)

Copyright © 2021 The Apache Software Foundation. All rights reserved.