fixed bug with init of tx datastructs + changed actor id management
This commit is contained in:
parent
924661368b
commit
b4a46016eb
11 changed files with 33 additions and 20 deletions
|
|
@ -29,11 +29,12 @@ public class PersistentSimpleService {
|
|||
private String KEY = "COUNTER";
|
||||
|
||||
private boolean hasStartedTicking = false;
|
||||
private PersistentMap<byte[], byte[]> storage = CassandraStorage.newMap();
|
||||
private PersistentMap<byte[], byte[]> storage;
|
||||
|
||||
@GET
|
||||
@Produces({"application/html"})
|
||||
public String count() {
|
||||
if (storage == null) storage = CassandraStorage.newMap();
|
||||
if (!hasStartedTicking) {
|
||||
storage.put(KEY.getBytes(), ByteBuffer.allocate(2).putInt(0).array());
|
||||
hasStartedTicking = true;
|
||||
|
|
|
|||
|
|
@ -27,11 +27,12 @@ public class SimpleService {
|
|||
private String KEY = "COUNTER";
|
||||
|
||||
private boolean hasStartedTicking = false;
|
||||
private TransactionalMap storage = TransactionalState.newMap();
|
||||
private TransactionalMap<String, Integer> storage;
|
||||
|
||||
@GET
|
||||
@Produces({"application/json"})
|
||||
public String count() {
|
||||
if (storage == null) storage = TransactionalState.newMap();
|
||||
if (!hasStartedTicking) {
|
||||
storage.put(KEY, 0);
|
||||
hasStartedTicking = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue