List of usage examples for org.apache.cassandra.io.sstable Component SUMMARY
Component SUMMARY
To view the source code for org.apache.cassandra.io.sstable Component SUMMARY.
Click Source Link
From source file:com.scylladb.tools.SSTableToCQL.java
License:Open Source License
private void addFile(final List<SSTableReader> sstables, File dir, String name) { Pair<Descriptor, Component> p = SSTable.tryComponentFromFilename(dir, name); Descriptor desc = p == null ? null : p.left; if (p == null || !p.right.equals(Component.DATA) || desc.type.isTemporary) { return;/* w w w . j a v a 2 s. c om*/ } if (!new File(desc.filenameFor(Component.PRIMARY_INDEX)).exists()) { logger.info("Skipping file {} because index is missing", name); return; } CFMetaData metadata = getCFMetaData(keyspace, desc.cfname); if (metadata == null) { logger.info("Skipping file {}: column family {}.{} doesn't exist", name, keyspace, desc.cfname); return; } Set<Component> components = new HashSet<>(); components.add(Component.DATA); components.add(Component.PRIMARY_INDEX); if (new File(desc.filenameFor(Component.SUMMARY)).exists()) { components.add(Component.SUMMARY); } if (new File(desc.filenameFor(Component.COMPRESSION_INFO)).exists()) { components.add(Component.COMPRESSION_INFO); } if (new File(desc.filenameFor(Component.STATS)).exists()) { components.add(Component.STATS); } try { // To conserve memory, open SSTableReaders without bloom // filters and discard // the index summary after calculating the file sections to // stream and the estimated // number of keys for each endpoint. See CASSANDRA-5555 for // details. SSTableReader sstable = openForBatch(desc, components, metadata, getPartitioner()); sstables.add(sstable); } catch (IOException e) { logger.warn("Skipping file {}, error opening it: {}", name, e.getMessage()); } }