Skip to content

Instantly share code, notes, and snippets.

@jmhodges
Created August 7, 2009 23:03
Show Gist options
  • Save jmhodges/164219 to your computer and use it in GitHub Desktop.
Save jmhodges/164219 to your computer and use it in GitHub Desktop.
// 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.
}
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment