jmhodges (owner)

Revisions

gist: 164219 Download_button fork
public
Public Clone URL: git://gist.github.com/164219.git
Embed All Files: show embed
KeyspaceInputFormat.java #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// This is what boots Cassandra for the hadoop stuff
private void startKeyspace() throws IOException
{
    CalloutManager.instance().onStart();
    LogUtil.init();
    
    if (keyspace == null) {
        throw new RuntimeException("you forgot to set the keyspace with KeyspaceInputFormat.setKeyspace()");
    }
    
    keyspace = DatabaseDescriptor.getTable(keyspace);
    if (keyspace == null) {
        throw new RuntimeException("that keyspace doesn't exist in cassandra!");
    }
    
    Set<String> tables = DatabaseDescriptor.getTableToColumnFamilyMap().keySet();
    for (String table : tables)
    {
        Table tbl = Table.open(table);
        tbl.onStart();
    }
    
    RecoveryManager recoveryMgr = RecoveryManager.instance();
    recoveryMgr.doRecovery();
 
    StorageService.instance().start(); // NPE is here.
}
npe_is_here #
1
2
3
4
5
6
7
java.lang.NullPointerException
at org.apache.cassandra.db.SystemTable.initMetadata(SystemTable.java:112)
at org.apache.cassandra.service.StorageService.start(StorageService.java:252)
at org.apache.cassandra.hadoop.KeyspaceInputFormat.startKeyspace(KeyspaceInputFormat.java:144)
at org.apache.cassandra.hadoop.KeyspaceInputFormat.getSplits(KeyspaceInputFormat.java:65)
at org.apache.hadoop.mapred.LocalJobRunner.getRawSplits(LocalJobRunner.java:65)
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:144)