use of com.hazelcast.internal.util.UUIDSerializationUtil.readUUID in project hazelcast by hazelcast.
the class MapChunk method readWriteBehindState.
private void readWriteBehindState(ObjectDataInput in) throws IOException {
hasWriteBehindState = in.readBoolean();
if (!hasWriteBehindState) {
return;
}
// read delayed entries
int listSize = in.readInt();
delayedEntriesList = new ArrayList<>(listSize);
for (int j = 0; j < listSize; j++) {
Data key = IOUtil.readData(in);
Data value = IOUtil.readData(in);
long expirationTime = in.readLong();
long storeTime = in.readLong();
int partitionId = in.readInt();
long sequence = in.readLong();
UUID txnId = UUIDSerializationUtil.readUUID(in);
DelayedEntry<Data, Data> entry = newAddedDelayedEntry(key, value, expirationTime, storeTime, partitionId, txnId);
entry.setSequence(sequence);
delayedEntriesList.add(entry);
}
// read sequences
int setSize = in.readInt();
sequences = new ArrayDeque<>(setSize);
for (int j = 0; j < setSize; j++) {
sequences.add(new WriteBehindStore.Sequence(in.readLong(), in.readBoolean()));
}
// read txn reservations
int numOfCounters = in.readInt();
counterByTxnId = createHashMap(numOfCounters);
for (int j = 0; j < numOfCounters; j++) {
counterByTxnId.put(readUUID(in), in.readLong());
}
}
use of com.hazelcast.internal.util.UUIDSerializationUtil.readUUID in project hazelcast by hazelcast.
the class WriteBehindStateHolder method readData.
@Override
public void readData(ObjectDataInput in) throws IOException {
int size = in.readInt();
delayedEntries = createHashMap(size);
for (int i = 0; i < size; i++) {
String mapName = in.readString();
int listSize = in.readInt();
List<DelayedEntry> delayedEntriesList = new ArrayList<>(listSize);
for (int j = 0; j < listSize; j++) {
Data key = IOUtil.readData(in);
Data value = IOUtil.readData(in);
long expirationTime = in.readLong();
long storeTime = in.readLong();
int partitionId = in.readInt();
long sequence = in.readLong();
UUID txnId = UUIDSerializationUtil.readUUID(in);
DelayedEntry<Data, Data> entry = newAddedDelayedEntry(key, value, expirationTime, storeTime, partitionId, txnId);
entry.setSequence(sequence);
delayedEntriesList.add(entry);
}
delayedEntries.put(mapName, delayedEntriesList);
}
int expectedSize = in.readInt();
flushSequences = createHashMap(expectedSize);
for (int i = 0; i < expectedSize; i++) {
String mapName = in.readString();
int setSize = in.readInt();
Queue<WriteBehindStore.Sequence> queue = new ArrayDeque<>(setSize);
for (int j = 0; j < setSize; j++) {
queue.add(new WriteBehindStore.Sequence(in.readLong(), in.readBoolean()));
}
flushSequences.put(mapName, queue);
}
int mapCount = in.readInt();
reservationsByTxnIdPerMap = mapCount == 0 ? Collections.emptyMap() : new HashMap<>(mapCount);
for (int i = 0; i < mapCount; i++) {
String mapName = in.readString();
int numOfCounters = in.readInt();
Map<UUID, Long> counterByTxnId = createHashMap(numOfCounters);
for (int j = 0; j < numOfCounters; j++) {
counterByTxnId.put(readUUID(in), in.readLong());
}
reservationsByTxnIdPerMap.put(mapName, counterByTxnId);
}
}
Aggregations