proofpoint/kairosdb — pull request #26 by warmans (2014-02-11 19:56:51+00:00)
Title: Null Column Exception Caused by Invaid String Buffer

When using Cassandra and the REST API if any client appends a trailing slash to their datapoints POST requests they will trigger an exception when the string_index write buffer is flushed. The sting index is updated as a result of the kairosdb.protocol.http_request_count metric being created with a blank value for it's method tag (see MonitorFilter).

```
[Thread-5] ERROR [WriteBuffer.java:201] - Error sending data to Cassandra
me.prettyprint.hector.api.exceptions.HInvalidRequestException: InvalidRequestException(why:column name must not be empty)
at me.prettyprint.cassandra.service.ExceptionsTranslatorImpl.translate(ExceptionsTranslatorImpl.java:52) ~[hector-core-1.1-4.jar:na]
at me.prettyprint.cassandra.connection.HConnectionManager.operateWithFailover(HConnectionManager.java:260) ~[hector-core-1.1-4.jar:na]
at me.prettyprint.cassandra.model.ExecutingKeyspace.doExecuteOperation(ExecutingKeyspace.java:113) ~[hector-core-1.1-4.jar:na]
at me.prettyprint.cassandra.model.MutatorImpl.execute(MutatorImpl.java:243) ~[hector-core-1.1-4.jar:na]
at org.kairosdb.datastore.cassandra.WriteBuffer.run(WriteBuffer.java:195) ~[kairosdb.jar:0.9.3.20140116214226]
at java.lang.Thread.run(Unknown Source) [na:1.7.0_45]
Caused by: org.apache.cassandra.thrift.InvalidRequestException: null
at org.apache.cassandra.thrift.Cassandra$batch_mutate_result.read(Cassandra.java:20833) ~[cassandra-thrift-1.2.5.jar:1.2.5]
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78) ~[libthrift-0.7.0.jar:0.7.0]
at org.apache.cassandra.thrift.Cassandra$Client.recv_batch_mutate(Cassandra.java:964) ~[cassandra-thrift-1.2.5.jar:1.2.5]
at org.apache.cassandra.thrift.Cassandra$Client.batch_mutate(Cassandra.java:950) ~[cassandra-thrift-1.2.5.jar:1.2.5]
at me.prettyprint.cassandra.model.MutatorImpl$3.execute(MutatorImpl.java:246) ~[hector-core-1.1-4.jar:na]
at me.prettyprint.cassandra.model.MutatorImpl$3.execute(MutatorImpl.java:243) ~[hector-core-1.1-4.jar:na]
at me.prettyprint.cassandra.service.Operation.executeAndSetResult(Operation.java:104) ~[hector-core-1.1-4.jar:na]
at me.prettyprint.cassandra.connection.HConnectionManager.operateWithFailover(HConnectionManager.java:253) ~[hector-core-1.1-4.jar:na]
... 4 common frames omitted
```

The fix prevents blank method tags from being added, adds additional debug information to show when something is attempting to insert invalid data into cassandra and discards any rows from the write buffer if they are not valid.