org.apache.hadoop.mapreduce.checkpoint

## Class FSCheckpointService

- java.lang.Object
- - org.apache.hadoop.mapreduce.checkpoint.FSCheckpointService

- All Implemented Interfaces:
    CheckpointService

      public class FSCheckpointService
      extends Object
      implements CheckpointService

  A FileSystem based CheckpointService.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.hadoop.mapreduce.checkpoint.CheckpointService

      `CheckpointService.CheckpointReadChannel, CheckpointService.CheckpointWriteChannel`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FSCheckpointService(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path base, CheckpointNamingService namingPolicy, short replication)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `abort(CheckpointService.CheckpointWriteChannel ch)` Dual to commit, it aborts the current checkpoint.
    `CheckpointID` | `commit(CheckpointService.CheckpointWriteChannel ch)` Used to finalize and existing checkpoint.
    `CheckpointService.CheckpointWriteChannel` | `create()` This method creates a checkpoint and provide a channel to write to it.
    `boolean` | `delete(CheckpointID id)` It discards an existing checkpoint identified by its CheckpointID.
    `CheckpointService.CheckpointReadChannel` | `open(CheckpointID id)` Given a CheckpointID returns a reading channel.

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

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

- - ### Constructor Detail

    - #### FSCheckpointService

          public FSCheckpointService(org.apache.hadoop.fs.FileSystem fs,
                                     org.apache.hadoop.fs.Path base,
                                     CheckpointNamingService namingPolicy,
                                     short replication)

  - ### Method Detail

    - #### create

          public CheckpointService.CheckpointWriteChannel create()
                                                          throws IOException

      Description copied from interface: `CheckpointService`
      This method creates a checkpoint and provide a channel to write to it. The name/location of the checkpoint are unknown to the user as of this time, in fact, the CheckpointID is not released to the user until commit is called. This makes enforcing atomicity of writes easy.
      Specified by:
        `create` in interface `CheckpointService`
      Returns:
        a channel that can be used to write to the checkpoint
      Throws:
        `IOException`

    - #### open

          public CheckpointService.CheckpointReadChannel open(CheckpointID id)
                                                       throws IOException,
                                                              InterruptedException

      Description copied from interface: `CheckpointService`
      Given a CheckpointID returns a reading channel.
      Specified by:
        `open` in interface `CheckpointService`
      Parameters:
        `id` - CheckpointID for the checkpoint to be opened
      Returns:
        a CheckpointReadChannel
      Throws:
        `IOException`
        `InterruptedException`

    - #### commit

          public CheckpointID commit(CheckpointService.CheckpointWriteChannel ch)
                              throws IOException,
                                     InterruptedException

      Description copied from interface: `CheckpointService`
      Used to finalize and existing checkpoint. It returns the CheckpointID that can be later used to access (read-only) this checkpoint. This guarantees atomicity of the checkpoint.
      Specified by:
        `commit` in interface `CheckpointService`
      Parameters:
        `ch` - the CheckpointWriteChannel to commit
      Returns:
        a CheckpointID
      Throws:
        `IOException`
        `InterruptedException`

    - #### abort

          public void abort(CheckpointService.CheckpointWriteChannel ch)
                     throws IOException

      Description copied from interface: `CheckpointService`
      Dual to commit, it aborts the current checkpoint. Garbage collection choices are left to the implementation. The CheckpointID is not generated nor released to the user so the checkpoint is not accessible.
      Specified by:
        `abort` in interface `CheckpointService`
      Parameters:
        `ch` - the CheckpointWriteChannel to abort
      Throws:
        `IOException`

    - #### delete

          public boolean delete(CheckpointID id)
                         throws IOException,
                                InterruptedException

      Description copied from interface: `CheckpointService`
      It discards an existing checkpoint identified by its CheckpointID.
      Specified by:
        `delete` in interface `CheckpointService`
      Parameters:
        `id` - CheckpointID for the checkpoint to be deleted
      Returns:
        a boolean confirming success of the deletion
      Throws:
        `IOException`
        `InterruptedException`

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.