Wrong Keyspace name is generated while streaming the sstables using 
BulkOutputFormat.
-------------------------------------------------------------------------------------

                 Key: CASSANDRA-3851
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3851
             Project: Cassandra
          Issue Type: Bug
          Components: Hadoop, Tools
    Affects Versions: 1.1
            Reporter: Samarth Gahire
            Assignee: Samarth Gahire
            Priority: Minor
             Fix For: 1.1


I have merge the committed changes of 
[CASSANDRA-3828|https://issues.apache.org/jira/browse/CASSANDRA-3828] into my 
cassadra-trunk. Also the changes for the OutputLocation.
But when I tried to load the sstables with hadoop job it results into the 
following exception:
{code}
12/02/04 11:19:12 INFO mapred.JobClient:  map 6% reduce 0%
12/02/04 11:19:14 INFO mapred.JobClient: Task Id : 
attempt_201202041114_0001_m_000001_1, Status : FAILED
java.lang.RuntimeException: Could not retrieve endpoint ranges:
        at 
org.apache.cassandra.hadoop.BulkRecordWriter$ExternalClient.init(BulkRecordWriter.java:252)
        at 
org.apache.cassandra.io.sstable.SSTableLoader.stream(SSTableLoader.java:117)
        at 
org.apache.cassandra.io.sstable.SSTableLoader.stream(SSTableLoader.java:112)
        at 
org.apache.cassandra.hadoop.BulkRecordWriter.close(BulkRecordWriter.java:182)
        at 
org.apache.cassandra.hadoop.BulkRecordWriter.close(BulkRecordWriter.java:167)
        at 
org.apache.hadoop.mapred.MapTask$NewDirectOutputCollector.close(MapTask.java:650)
        at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:765)
        at org.apache.hadoop.mapred.MapTask.run(MapTask.java:369)
        at org.apache.hadoop.mapred.Child$4.run(Child.java:259)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:396)
        at 
org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1059)
        at org.apache.hadoop.mapred.Child.main(Child.java:253)
Caused by: InvalidRequestException (*why:There is no ring for the keyspace: 
tmp*)
        at 
org.apache.cassandra.thrift.Cassandra$describe_ring_result.read(Cassandra.java:24053)
        at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
        at 
org.apache.cassandra.thrift.Cassandra$Client.recv_describe_ring(Cassandra.java:1065)
        at 
org.apache.cassandra.thrift.Cassandra$Client.describe_ring(Cassandra.java:1052)
        at 
org.apache.cassandra.hadoop.BulkRecordWriter$ExternalClient.init(BulkRecordWriter.java:225)
        ... 12 more
{code}

After looking into the code I figured out that as we are setting the 
OUTPUTLOCATION with system property "java.io.tmpdir" the output directory is 
getting created as: /tmp/Keyspace_Name
So in SSTableLoader while generating the kespace name like
{code}
this.keyspace = directory.getParentFile().getName();
{code}

It is setting the keyspace name as "tmp" and results into the above exception.

I have changed the code as:
{code}this.keyspace = directory.getName();{code}
and it works perfect.
But I am wondering how it was working fine previously? Am I doing anything 
wrong ? or is it a bug? 


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to