org.apache.cassandra.streaming

## Class StreamLockfile

- java.lang.Object
- - org.apache.cassandra.streaming.StreamLockfile

-     public class StreamLockfile
      extends java.lang.Object

  Encapsulates the behavior for 'locking' any streamed sttables to a node. If a process crashes while converting a set of SSTableWriters to SSTReaders (meaning, some subset of SSTWs were converted, but not the entire set), we want to disregard the entire set as we will surely have missing data (by definition). Basic behavior id to write out the names of all SSTWs to a file, one SSTW per line, and then delete the file when complete (normal behavior). This should happen before converting any SSTWs. Thus, the lockfile is created, some SSTWs are converted, and if the process crashes, on restart, we look for any existing lockfile, and delete any referenced SSTRs.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `FILE_EXT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StreamLockfile(java.io.File lockfile)`
    `StreamLockfile(java.io.File directory, java.util.UUID uuid)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cleanup()`
    `void` | `create(java.util.Collection<SSTableWriter> sstables)`
    `void` | `delete()`

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

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

- - ### Field Detail

    - #### FILE_EXT

          public static final java.lang.String FILE_EXT

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### StreamLockfile

          public StreamLockfile(java.io.File directory,
                                java.util.UUID uuid)

    - #### StreamLockfile

          public StreamLockfile(java.io.File lockfile)

  - ### Method Detail

    - #### create

          public void create(java.util.Collection<SSTableWriter> sstables)

    - #### delete

          public void delete()

    - #### cleanup

          public void cleanup()

Copyright © 2018 The Apache Software Foundation