Skip to content

Instantly share code, notes, and snippets.

DeleteListValue deleteList = DeleteListValue.builder().uid(uid)
.hobbies("Drawing").build();
if (daoOperation.deleteNode(deleteList)) {
]System.out.println("Update Transaction completed");
]}
//Helper Class for read and write operations for a file.
class FileStore {
private File storeFolder;
// Locks is used so that only one thread can update the file at a
// time.
private ReadWriteLock lock = new ReentrantReadWriteLock();
// Example of the executor service
class UserRepository implements Closeable {
private FileStore fileStore;
private ConcurrentHashMap<UUID, User> cache = new ConcurrentHashMap<>();
private ReadWriteLock lock = new ReentrantReadWriteLock();
private ExecutorService executors = Executors.newFixedThreadPool(2);
UserRepository(FileStore fnileStore) {
this.fileStore = fileStore;