use of com.tvd12.calabash.persist.BytesMapPersist in project calabash by youngmonkeys.
the class SimpleBytesMapFactory method newMapPersist.
protected void newMapPersist(String mapName) {
BytesMapPersist mapPersist = bytesMapPersistFactory.newMapPersist(mapName);
mapPersistManager.addMapPersist(mapName, mapPersist);
}
use of com.tvd12.calabash.persist.BytesMapPersist in project calabash by youngmonkeys.
the class SimpleBytesMapPersistExecutor method delete.
@Override
public void delete(MapSetting mapSetting, ByteArray key) {
BytesMapPersist mapPersist = getMapPersist(mapSetting);
if (mapPersist != null) {
PersistDeleteOneAction action = new PersistDeleteOneAction(key);
addPersistActionToQueue(mapSetting, action);
}
}
use of com.tvd12.calabash.persist.BytesMapPersist in project calabash by youngmonkeys.
the class PersistDeleteActionBulk method execute.
@Override
public void execute() {
Set keys = new HashSet<>();
for (PersistAction action : actions) {
if (action.getType() == PersistActionType.DELETE_ONE) {
keys.add(((PersistDeleteOneAction) action).getKey());
} else {
keys.addAll(((PersistDeleteManyAction) action).getKeys());
}
}
((BytesMapPersist) mapPersist).delete(keys);
}
use of com.tvd12.calabash.persist.BytesMapPersist in project calabash by youngmonkeys.
the class PersistSaveActionBulk method execute.
@Override
public void execute() {
Map keyValues = new HashMap<>();
for (PersistAction action : actions) {
if (action.getType() == PersistActionType.SAVE_ONE) {
PersistSaveOneAction one = (PersistSaveOneAction) action;
keyValues.put(one.getKey(), one.getValue());
} else {
PersistSaveManyAction many = (PersistSaveManyAction) action;
keyValues.putAll(many.getKeyValues());
}
}
((BytesMapPersist) mapPersist).persist(keyValues);
}
use of com.tvd12.calabash.persist.BytesMapPersist in project calabash by youngmonkeys.
the class SimpleBytesMapPersistExecutor method persist.
@Override
public void persist(MapSetting mapSetting, Map<ByteArray, byte[]> m) {
BytesMapPersist mapPersist = getMapPersist(mapSetting);
if (mapPersist != null) {
PersistSaveManyAction action = new PersistSaveManyAction(m);
addPersistActionToQueue(mapSetting, action);
}
}
Aggregations