本文整理汇总了Java中org.apache.cassandra.io.sstable.SSTableReader.getSSTableMetadata方法的典型用法代码示例。如果您正苦于以下问题:Java SSTableReader.getSSTableMetadata方法的具体用法?Java SSTableReader.getSSTableMetadata怎么用?Java SSTableReader.getSSTableMetadata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.io.sstable.SSTableReader
的用法示例。
在下文中一共展示了SSTableReader.getSSTableMetadata方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSSTableMetadata
import org.apache.cassandra.io.sstable.SSTableReader; //导入方法依赖的package包/类
public List<SSTableMetadata> getSSTableMetadata(String ksName, String cfName) {
ColumnFamilyStore cfStore = getStore(ksName, cfName);
Collection<SSTableReader> tables = cfStore.getSSTables();
List<SSTableMetadata> metaData = new ArrayList<>(tables.size());
for (SSTableReader table : tables) {
SSTableMetadata tableMetadata = new SSTableMetadata();
File dataFile = new File(table.descriptor.filenameFor(Component.DATA));
tableMetadata.filename = dataFile.getName();
tableMetadata.generation = table.descriptor.generation;
try {
tableMetadata.fileTimestamp = Files.getLastModifiedTime(dataFile.toPath()).toMillis();
} catch (IOException e) {
tableMetadata.fileTimestamp = 0;
}
tableMetadata.minTimestamp = table.getMinTimestamp();
tableMetadata.maxTimestamp = table.getMaxTimestamp();
tableMetadata.diskLength = table.onDiskLength();
tableMetadata.uncompressedLength = table.uncompressedLength();
tableMetadata.keys = table.estimatedKeys();
EstimatedHistogram rowSizeHistogram = table.getEstimatedRowSize();
tableMetadata.maxRowSize = rowSizeHistogram.max();
tableMetadata.avgRowSize = rowSizeHistogram.mean();
EstimatedHistogram columnCountHistogram = table.getEstimatedColumnCount();
tableMetadata.maxColumnCount = columnCountHistogram.max();
tableMetadata.avgColumnCount = columnCountHistogram.mean();
tableMetadata.droppableTombstones = table.getDroppableTombstonesBefore(Util.NOW_SECONDS - table.metadata.getGcGraceSeconds());
tableMetadata.level = table.getSSTableLevel();
tableMetadata.isRepaired = table.isRepaired();
tableMetadata.repairedAt = table.getSSTableMetadata().repairedAt;
metaData.add(tableMetadata);
}
return metaData;
}
示例2: shouldInclude
import org.apache.cassandra.io.sstable.SSTableReader; //导入方法依赖的package包/类
public boolean shouldInclude(SSTableReader sstable)
{
List<ByteBuffer> minColumnNames = sstable.getSSTableMetadata().minColumnNames;
List<ByteBuffer> maxColumnNames = sstable.getSSTableMetadata().maxColumnNames;
CellNameType comparator = sstable.metadata.comparator;
if (minColumnNames.isEmpty() || maxColumnNames.isEmpty())
return true;
for (ColumnSlice slice : slices)
if (slice.intersects(minColumnNames, maxColumnNames, comparator, reversed))
return true;
return false;
}
示例3: getSSTableSectionsForRanges
import org.apache.cassandra.io.sstable.SSTableReader; //导入方法依赖的package包/类
private List<SSTableStreamingSections> getSSTableSectionsForRanges(Collection<Range<Token>> ranges, Collection<ColumnFamilyStore> stores, long overriddenRepairedAt, boolean isIncremental)
{
Refs<SSTableReader> refs = new Refs<>();
try
{
for (ColumnFamilyStore cfStore : stores)
{
List<AbstractBounds<RowPosition>> rowBoundsList = new ArrayList<>(ranges.size());
for (Range<Token> range : ranges)
rowBoundsList.add(range.toRowBounds());
refs.addAll(cfStore.selectAndReference(cfStore.viewFilter(rowBoundsList, !isIncremental)).refs);
}
List<SSTableStreamingSections> sections = new ArrayList<>(refs.size());
for (SSTableReader sstable : refs)
{
long repairedAt = overriddenRepairedAt;
if (overriddenRepairedAt == ActiveRepairService.UNREPAIRED_SSTABLE)
repairedAt = sstable.getSSTableMetadata().repairedAt;
sections.add(new SSTableStreamingSections(sstable, refs.get(sstable),
sstable.getPositionsForRanges(ranges),
sstable.estimatedKeysForRanges(ranges),
repairedAt));
}
return sections;
}
catch (Throwable t)
{
refs.release();
throw t;
}
}