Package org.apache.cassandra.io.sstable
Class SequenceBasedSSTableId.Builder
- java.lang.Object
-
- org.apache.cassandra.io.sstable.SequenceBasedSSTableId.Builder
-
- All Implemented Interfaces:
SSTableId.Builder<SequenceBasedSSTableId>
- Enclosing class:
- SequenceBasedSSTableId
public static class SequenceBasedSSTableId.Builder extends java.lang.Object implements SSTableId.Builder<SequenceBasedSSTableId>
-
-
Field Summary
Fields Modifier and Type Field Description static SequenceBasedSSTableId.Builder
instance
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SequenceBasedSSTableId
fromBytes(java.nio.ByteBuffer bytes)
Creates an identifier instance from its binary representationSequenceBasedSSTableId
fromString(java.lang.String token)
Creates an identifier instance from its string representationjava.util.function.Supplier<SequenceBasedSSTableId>
generator(java.util.stream.Stream<SSTableId> existingIdentifiers)
Generates a sequential number to represent an sstables identifier.boolean
isUniqueIdentifier(java.lang.String str)
boolean
isUniqueIdentifier(java.nio.ByteBuffer bytes)
-
-
-
Field Detail
-
instance
public static final SequenceBasedSSTableId.Builder instance
-
-
Method Detail
-
generator
public java.util.function.Supplier<SequenceBasedSSTableId> generator(java.util.stream.Stream<SSTableId> existingIdentifiers)
Generates a sequential number to represent an sstables identifier. The first generated identifier will be greater by one than the largest generation number found across the provided existing identifiers.- Specified by:
generator
in interfaceSSTableId.Builder<SequenceBasedSSTableId>
-
isUniqueIdentifier
public boolean isUniqueIdentifier(java.lang.String str)
- Specified by:
isUniqueIdentifier
in interfaceSSTableId.Builder<SequenceBasedSSTableId>
-
isUniqueIdentifier
public boolean isUniqueIdentifier(java.nio.ByteBuffer bytes)
- Specified by:
isUniqueIdentifier
in interfaceSSTableId.Builder<SequenceBasedSSTableId>
-
fromString
public SequenceBasedSSTableId fromString(java.lang.String token) throws java.lang.IllegalArgumentException
Description copied from interface:SSTableId.Builder
Creates an identifier instance from its string representation- Specified by:
fromString
in interfaceSSTableId.Builder<SequenceBasedSSTableId>
- Parameters:
token
- string representation as returned bySSTableId.toString()
- Throws:
java.lang.IllegalArgumentException
- when the provided string is not a valid string representation of the identifier
-
fromBytes
public SequenceBasedSSTableId fromBytes(java.nio.ByteBuffer bytes) throws java.lang.IllegalArgumentException
Description copied from interface:SSTableId.Builder
Creates an identifier instance from its binary representationThe method expects the identifier is encoded in all remaining bytes of the buffer. The method does not move the pointer of the buffer.
- Specified by:
fromBytes
in interfaceSSTableId.Builder<SequenceBasedSSTableId>
- Parameters:
bytes
- binary representation as returned bySSTableId.asBytes()
- Throws:
java.lang.IllegalArgumentException
- when the provided bytes are not a valid binary representation of the identifier
-
-