Cassandra SSTableLoader:无法列出<directory_path>

时间:2016-03-28 08:27:20

标签: java cassandra

我从这里https://github.com/yukim/cassandra-bulkload-example跟随Cassandra散装加载器示例Cassandra 3.4.0。数据文件在数据文件夹下生成。具体如下:

quote-historical_prices-ka-1-CompressionInfo.db  quote-historical_prices-ka-1-Index.db
quote-historical_prices-ka-1-Data.db             quote-historical_prices-ka-1-Statistics.db
quote-historical_prices-ka-1-Digest.sha1         quote-historical_prices-ka-1-TOC.txt
quote-historical_prices-ka-1-Filter.db

然而,当尝试使用sstableloader -d 127.0.0.1 ~/workspace/cassandra-bulkload-example/data/quote/historical_prices/加载这些时,我收到如下错误:

Established connection to initial hosts
Opening sstables and calculating sections to stream
Failed to list files in /home/srai/workspace/cassandra-bulkload-example/data/quote/historical_prices
java.lang.NullPointerException
java.lang.RuntimeException: Failed to list files in /home/srai/workspace/cassandra-bulkload-example/data/quote/historical_prices
        at org.apache.cassandra.db.lifecycle.LogAwareFileLister.list(LogAwareFileLister.java:53)
        at org.apache.cassandra.db.lifecycle.LifecycleTransaction.getFiles(LifecycleTransaction.java:544)
        at org.apache.cassandra.io.sstable.SSTableLoader.openSSTables(SSTableLoader.java:76)
        at org.apache.cassandra.io.sstable.SSTableLoader.stream(SSTableLoader.java:165)
        at org.apache.cassandra.tools.BulkLoader.load(BulkLoader.java:80)
        at org.apache.cassandra.tools.BulkLoader.main(BulkLoader.java:48)
Caused by: java.lang.NullPointerException
        at org.apache.cassandra.io.sstable.format.SSTableReader.openForBatch(SSTableReader.java:431)
        at org.apache.cassandra.io.sstable.SSTableLoader.lambda$openSSTables$220(SSTableLoader.java:121)
        at org.apache.cassandra.db.lifecycle.LogAwareFileLister.lambda$innerList$208(LogAwareFileLister.java:75)
        at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174)
        at java.util.TreeMap$EntrySpliterator.forEachRemaining(TreeMap.java:2965)
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
        at org.apache.cassandra.db.lifecycle.LogAwareFileLister.innerList(LogAwareFileLister.java:77)
        at org.apache.cassandra.db.lifecycle.LogAwareFileLister.list(LogAwareFileLister.java:49)
        ... 5 more
Exception in thread "main" org.apache.cassandra.tools.BulkLoadException: java.lang.RuntimeException: Failed to list files in /home/srai/workspace/cassandra-bulkload-example/data/quote/historical_prices
        at org.apache.cassandra.tools.BulkLoader.load(BulkLoader.java:93)
        at org.apache.cassandra.tools.BulkLoader.main(BulkLoader.java:48)
Caused by: java.lang.RuntimeException: Failed to list files in /home/srai/workspace/cassandra-bulkload-example/data/quote/historical_prices
        at org.apache.cassandra.db.lifecycle.LogAwareFileLister.list(LogAwareFileLister.java:53)
        at org.apache.cassandra.db.lifecycle.LifecycleTransaction.getFiles(LifecycleTransaction.java:544)
        at org.apache.cassandra.io.sstable.SSTableLoader.openSSTables(SSTableLoader.java:76)
        at org.apache.cassandra.io.sstable.SSTableLoader.stream(SSTableLoader.java:165)
        at org.apache.cassandra.tools.BulkLoader.load(BulkLoader.java:80)
        ... 1 more
Caused by: java.lang.NullPointerException
        at org.apache.cassandra.io.sstable.format.SSTableReader.openForBatch(SSTableReader.java:431)
        at org.apache.cassandra.io.sstable.SSTableLoader.lambda$openSSTables$220(SSTableLoader.java:121)
        at org.apache.cassandra.db.lifecycle.LogAwareFileLister.lambda$innerList$208(LogAwareFileLister.java:75)
        at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174)
        at java.util.TreeMap$EntrySpliterator.forEachRemaining(TreeMap.java:2965)
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
        at org.apache.cassandra.db.lifecycle.LogAwareFileLister.innerList(LogAwareFileLister.java:77)
        at org.apache.cassandra.db.lifecycle.LogAwareFileLister.list(LogAwareFileLister.java:49)
        ... 5 more

1 个答案:

答案 0 :(得分:1)

默认情况下,批量加载器示例为2.1.12构建sstables。流式传输&lt;不支持3.0.0表,这是为了在CASSANDRA-10940之前不跳过或提供错误。但是,在3.5中,他们将再次开始在CASSANDRA-10990中支持它。

所以要么在较新版本中构建sstables,要么等待3.5。