I am running a spark job where some data is loaded from cassandra table. From that data, I make some insert and delete statements. and execute them. (using forEach)
boolean deleteStatus= connector.openSession().execute(delete).wasApplied();
boolean insertStatus = connector.openSession().execute(insert).wasApplied();
System.out.println(delete+":"+deleteStatus);
System.out.println(insert+":"+insertStatus);
When i run it locally, i see the respective results in the table.
However, when I run it on a cluster, sometimes the result is displayed and sometime the changes don't take place.
I saw the stdout from web-ui of spark, and the query along with true was printed for both the queries.(Data was loaded correctly. But sometimes, only insert is reflected, sometimes only delete, sometimes both, and most of the times none.)
Specifications:
- spark slaves on same machines as the cassandra nodes.(each node has two instances of slaves.)
- spark master on a separate machine.
- Repair done on all nodes.
- Cassandra restarted