protected Map<MetadataType, MetadataComponent> finalizeMetadata() { return metadataCollector.finalizeMetadata(getPartitioner().getClass().getCanonicalName(), metadata.params.bloomFilterFpChance, repairedAt, header); }
protected Map<MetadataType, MetadataComponent> finalizeMetadata() { return metadataCollector.finalizeMetadata(getPartitioner().getClass().getCanonicalName(), metadata.params.bloomFilterFpChance, repairedAt, header); }
protected Map<MetadataType, MetadataComponent> finalizeMetadata() { return metadataCollector.finalizeMetadata(getPartitioner().getClass().getCanonicalName(), metadata.params.bloomFilterFpChance, repairedAt, header); }
protected Map<MetadataType, MetadataComponent> finalizeMetadata() { return metadataCollector.finalizeMetadata(getPartitioner().getClass().getCanonicalName(), metadata.params.bloomFilterFpChance, repairedAt, header); }
private Pair<Descriptor, StatsMetadata> close(FinishType type, long repairedAt) { switch (type) { case EARLY: case CLOSE: case NORMAL: iwriter.close(); dataFile.close(); if (type == FinishType.CLOSE) iwriter.bf.close(); } // write sstable statistics Map<MetadataType, MetadataComponent> metadataComponents ; metadataComponents = sstableMetadataCollector .finalizeMetadata(partitioner.getClass().getCanonicalName(), metadata.getBloomFilterFpChance(),repairedAt); // remove the 'tmp' marker from all components Descriptor descriptor = this.descriptor; if (type.isFinal) { dataFile.writeFullChecksum(descriptor); writeMetadata(descriptor, metadataComponents); // save the table of components SSTable.appendTOC(descriptor, components); descriptor = rename(descriptor, components); } return Pair.create(descriptor, (StatsMetadata) metadataComponents.get(MetadataType.STATS)); }
public SSTableReader openEarly(long maxDataAge) { StatsMetadata sstableMetadata = (StatsMetadata) sstableMetadataCollector.finalizeMetadata(partitioner.getClass().getCanonicalName(), metadata.getBloomFilterFpChance(), repairedAt).get(MetadataType.STATS); // find the max (exclusive) readable key IndexSummaryBuilder.ReadableBoundary boundary = iwriter.getMaxReadable(); if (boundary == null) return null; assert boundary.indexLength > 0 && boundary.dataLength > 0; Descriptor link = makeTmpLinks(); // open the reader early, giving it a FINAL descriptor type so that it is indistinguishable for other consumers SegmentedFile ifile = iwriter.builder.complete(link.filenameFor(Component.PRIMARY_INDEX), boundary.indexLength); SegmentedFile dfile = dbuilder.complete(link.filenameFor(Component.DATA), boundary.dataLength); SSTableReader sstable = SSTableReader.internalOpen(descriptor.asType(Descriptor.Type.FINAL), components, metadata, partitioner, ifile, dfile, iwriter.summary.build(partitioner, boundary), iwriter.bf.sharedCopy(), maxDataAge, sstableMetadata, SSTableReader.OpenReason.EARLY); // now it's open, find the ACTUAL last readable key (i.e. for which the data file has also been flushed) sstable.first = getMinimalKey(first); sstable.last = getMinimalKey(boundary.lastKey); return sstable; }