Repository: celery/celery

Issue:
Use Cassandra as backend to store  task results
setting

```
CELERY_RESULT_BACKEND = 'cassandra',
CASSANDRA_SERVERS = ['localhost:9160'],
CASSANDRA_KEYSPACE = 'celery',
CASSANDRA_COLUMN_FAMILY = 'task_results',
CASSANDRA_READ_CONSISTENCY = 'ONE',
CASSANDRA_WRITE_CONSISTENCY = 'ONE',
CASSANDRA_OPTIONS = {
    'timeout': 300,
    'max_retries': 10
}
```

then

```
CREATE KEYSPACE celery WITH 
    replication = {'class': 'SimpleStrategy', 'replication_factor' : 3};
```

when send a task to celery 

```
Cassandra error: NotFoundException(_message=None,   
    why='Column family task_results not found.')
```

Why didn't automatically creates column family 'task_results' like database backend does, 
and how do I create the column family and set what column_name in it?

Document headers argument
At the moment there's no much information regarding headers argument for apply_async (and I think also applies to retry).

I found out about this reading the changelog for version 3.1, but maybe it could be specified as an optional property for apply_async in the documentation.

I can provide the PR for this if you want. Let me know if you agree.



Discussion:
I don't know, I don't have experience with cassandra so maybe you could contact the authors?

The celery mailing-list would also be an option to see if there are others with experience.

I was able to solve this problem by doing:

```
CREATE TABLE task_results ( task_id text, name text, value text, primary key(task_id, name)  ) WITH compact STORAGE ;
```

I guess the cassandra backend could solve this problem by doing a CREATE TABLE IF NOT EXISTS.

New Cassandra backend will create the column family by default. Refer to #2669 .

Docs improvements are always welcome!

@malinoff Awesome. I'm trying to build the changes I applied but I'm getting the following error:

```
$ make html
mkdir -p .build/html .build/doctrees
sphinx-build -b html -d .build/doctrees   . .build/html
Running Sphinx v1.3.1

Extension error:
Could not import extension celery.contrib.sphinx (exception: cannot import name get_fdmax)
make: *** [html] Error 1
```

I searched a little but wasn't able to find any information regarding that error. I'm using Mac OS X 10.10.3 with virtualenv (All docs requirements installed) and Python 2.7.6. Should I use Python 3? Thanks.

I followed those steps and got that error
On Aug 7, 2015 12:13 AM, "Dmitry Malinovsky" notifications@github.com
wrote:

> https://github.com/celery/celery/blob/master/CONTRIBUTING.rst#building-the-documentation
> 
> —
> Reply to this email directly or view it on GitHub
> https://github.com/celery/celery/issues/2750#issuecomment-128576768.

@juanrossi yeah sorry, you need Celery installed to build docs.

@malinoff worked great with celery installed, thanks. I added the PR.


Resolving patch:
diff --git a/celery/app/task.py b/celery/app/task.py
--- a/celery/app/task.py
+++ b/celery/app/task.py
@@ -437,13 +437,18 @@ def apply_async(self, args=None, kwargs=None, task_id=None, producer=None,
                       if an error occurs while executing the task.
 
         :keyword producer: :class:`kombu.Producer` instance to use.
+
         :keyword add_to_parent: If set to True (default) and the task
             is applied while executing another task, then the result
             will be appended to the parent tasks ``request.children``
             attribute.  Trailing can also be disabled by default using the
             :attr:`trail` attribute
+
         :keyword publisher: Deprecated alias to ``producer``.
 
+        :keyword headers: Message headers to be sent in the
+            task (a :class:`dict`)
+
         :rtype :class:`celery.result.AsyncResult`: if
             :setting:`CELERY_ALWAYS_EAGER` is not set, otherwise
             :class:`celery.result.EagerResult`:


Test patch: