- private void writeData(WriteData message, boolean returnSerialized) {
- LOG.debug("writeData at path : {}", message.getPath());
- if (checkClosed()) {
- return;
- }
-
- compositeModification.addModification(
- new WriteModification(message.getPath(), message.getData()));
- try {
- transaction.getSnapshot().write(message.getPath(), message.getData());
- WriteDataReply writeDataReply = WriteDataReply.INSTANCE;
- getSender().tell(returnSerialized ? writeDataReply.toSerializable(message.getVersion()) :
- writeDataReply, getSelf());
- }catch(Exception e){
- getSender().tell(new akka.actor.Status.Failure(e), getSelf());
- }
- }
-
- private void mergeData(MergeData message, boolean returnSerialized) {
- LOG.debug("mergeData at path : {}", message.getPath());
- if (checkClosed()) {
- return;
- }
-
- compositeModification.addModification(
- new MergeModification(message.getPath(), message.getData()));
-
- try {
- transaction.getSnapshot().merge(message.getPath(), message.getData());
- MergeDataReply mergeDataReply = MergeDataReply.INSTANCE;
- getSender().tell(returnSerialized ? mergeDataReply.toSerializable(message.getVersion()) :
- mergeDataReply, getSelf());
- }catch(Exception e){
- getSender().tell(new akka.actor.Status.Failure(e), getSelf());
- }
- }
-
- private void deleteData(DeleteData message, boolean returnSerialized) {
- LOG.debug("deleteData at path : {}", message.getPath());
- if (checkClosed()) {
- return;
- }
-
- compositeModification.addModification(new DeleteModification(message.getPath()));
- try {
- transaction.getSnapshot().delete(message.getPath());
- DeleteDataReply deleteDataReply = DeleteDataReply.INSTANCE;
- getSender().tell(returnSerialized ? deleteDataReply.toSerializable(message.getVersion()) :
- deleteDataReply, getSelf());
- } catch(Exception e) {
- getSender().tell(new akka.actor.Status.Failure(e), getSelf());
- }
- }
-
- private void readyTransaction(boolean returnSerialized, boolean doImmediateCommit) {
- String transactionID = getTransactionID();