Class CompactionInfo
- java.lang.Object
-
- org.apache.cassandra.db.compaction.CompactionInfo
-
public final class CompactionInfo extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CompactionInfo.Holder
static class
CompactionInfo.Unit
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
COLUMNFAMILY
static java.lang.String
COMPACTION_ID
static java.lang.String
COMPLETED
static java.lang.String
ID
static java.lang.String
KEYSPACE
static java.lang.String
SSTABLES
static java.lang.String
TARGET_DIRECTORY
static java.lang.String
TASK_TYPE
static java.lang.String
TOTAL
static java.lang.String
UNIT
-
Constructor Summary
Constructors Constructor Description CompactionInfo(TableMetadata metadata, OperationType tasktype, long completed, long total, CompactionInfo.Unit unit, TimeUUID compactionId, java.util.Collection<? extends SSTableReader> sstables, java.lang.String targetDirectory)
CompactionInfo(TableMetadata metadata, OperationType tasktype, long completed, long total, TimeUUID compactionId, java.util.Collection<? extends SSTableReader> sstables)
CompactionInfo(TableMetadata metadata, OperationType tasktype, long completed, long total, TimeUUID compactionId, java.util.Collection<SSTableReader> sstables, java.lang.String targetDirectory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.String>
asMap()
long
estimatedRemainingWriteBytes()
Note that this estimate is based on the amount of data we have left to read - it assumes input size == output size for a compaction, which is not really true, but should most often provide a worst case remaining write size.CompactionInfo
forProgress(long complete, long total)
long
getCompleted()
java.util.Optional<java.lang.String>
getKeyspace()
java.util.Set<SSTableReader>
getSSTables()
java.util.Optional<java.lang.String>
getTable()
TableMetadata
getTableMetadata()
java.util.List<File>
getTargetDirectories()
Get the directories this compaction could possibly write to.TimeUUID
getTaskId()
OperationType
getTaskType()
long
getTotal()
CompactionInfo.Unit
getUnit()
java.lang.String
targetDirectory()
java.lang.String
toString()
static CompactionInfo
withoutSSTables(TableMetadata metadata, OperationType tasktype, long completed, long total, CompactionInfo.Unit unit, TimeUUID compactionId)
Special compaction info where we always need to cancel the compaction - for example ViewBuilderTask where we don't know the sstables at constructionstatic CompactionInfo
withoutSSTables(TableMetadata metadata, OperationType tasktype, long completed, long total, CompactionInfo.Unit unit, TimeUUID compactionId, java.lang.String targetDirectory)
Special compaction info where we always need to cancel the compaction - for example AutoSavingCache where we don't know the sstables at construction
-
-
-
Field Detail
-
ID
public static final java.lang.String ID
- See Also:
- Constant Field Values
-
KEYSPACE
public static final java.lang.String KEYSPACE
- See Also:
- Constant Field Values
-
COLUMNFAMILY
public static final java.lang.String COLUMNFAMILY
- See Also:
- Constant Field Values
-
COMPLETED
public static final java.lang.String COMPLETED
- See Also:
- Constant Field Values
-
TOTAL
public static final java.lang.String TOTAL
- See Also:
- Constant Field Values
-
TASK_TYPE
public static final java.lang.String TASK_TYPE
- See Also:
- Constant Field Values
-
UNIT
public static final java.lang.String UNIT
- See Also:
- Constant Field Values
-
COMPACTION_ID
public static final java.lang.String COMPACTION_ID
- See Also:
- Constant Field Values
-
SSTABLES
public static final java.lang.String SSTABLES
- See Also:
- Constant Field Values
-
TARGET_DIRECTORY
public static final java.lang.String TARGET_DIRECTORY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CompactionInfo
public CompactionInfo(TableMetadata metadata, OperationType tasktype, long completed, long total, CompactionInfo.Unit unit, TimeUUID compactionId, java.util.Collection<? extends SSTableReader> sstables, java.lang.String targetDirectory)
-
CompactionInfo
public CompactionInfo(TableMetadata metadata, OperationType tasktype, long completed, long total, TimeUUID compactionId, java.util.Collection<SSTableReader> sstables, java.lang.String targetDirectory)
-
CompactionInfo
public CompactionInfo(TableMetadata metadata, OperationType tasktype, long completed, long total, TimeUUID compactionId, java.util.Collection<? extends SSTableReader> sstables)
-
-
Method Detail
-
withoutSSTables
public static CompactionInfo withoutSSTables(TableMetadata metadata, OperationType tasktype, long completed, long total, CompactionInfo.Unit unit, TimeUUID compactionId)
Special compaction info where we always need to cancel the compaction - for example ViewBuilderTask where we don't know the sstables at construction
-
withoutSSTables
public static CompactionInfo withoutSSTables(TableMetadata metadata, OperationType tasktype, long completed, long total, CompactionInfo.Unit unit, TimeUUID compactionId, java.lang.String targetDirectory)
Special compaction info where we always need to cancel the compaction - for example AutoSavingCache where we don't know the sstables at construction
-
forProgress
public CompactionInfo forProgress(long complete, long total)
- Returns:
- A copy of this CompactionInfo with updated progress.
-
getKeyspace
public java.util.Optional<java.lang.String> getKeyspace()
-
getTable
public java.util.Optional<java.lang.String> getTable()
-
getTableMetadata
public TableMetadata getTableMetadata()
-
getCompleted
public long getCompleted()
-
getTotal
public long getTotal()
-
getTaskType
public OperationType getTaskType()
-
getTaskId
public TimeUUID getTaskId()
-
getUnit
public CompactionInfo.Unit getUnit()
-
getSSTables
public java.util.Set<SSTableReader> getSSTables()
-
getTargetDirectories
public java.util.List<File> getTargetDirectories()
Get the directories this compaction could possibly write to.- Returns:
- the directories that we might write to, or empty list if we don't know the metadata (like for index summary redistribution), or null if we don't have any disk boundaries
-
targetDirectory
public java.lang.String targetDirectory()
-
estimatedRemainingWriteBytes
public long estimatedRemainingWriteBytes()
Note that this estimate is based on the amount of data we have left to read - it assumes input size == output size for a compaction, which is not really true, but should most often provide a worst case remaining write size.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
asMap
public java.util.Map<java.lang.String,java.lang.String> asMap()
-
-