public synchronized void clear(Transaction tx) throws IOException { assertLoaded(); for (int i = 0; i < metadata.binCapacity; i++) { long pageId = metadata.binPageId + i; clearBinAtPage(tx, pageId); } metadata.size = 0; metadata.binsActive = 0; }
public synchronized boolean containsKey(Transaction tx, Key key) throws IOException { assertLoaded(); return getBin(tx, key).containsKey(key); }
public synchronized Value get(Transaction tx, Key key) throws IOException { assertLoaded(); return getBin(tx, key).get(key); }
synchronized public Value put(Transaction tx, Key key, Value value) throws IOException { assertLoaded(); HashBin<Key,Value> bin = getBin(tx, key); int originalSize = bin.size(); Value result = bin.put(key,value); store(tx, bin); int newSize = bin.size(); if (newSize != originalSize) { metadata.size++; if (newSize == 1) { metadata.binsActive++; } } if (metadata.binsActive >= this.increaseThreshold) { newSize = Math.min(maximumBinCapacity, metadata.binCapacity*2); if(metadata.binCapacity!=newSize) { resize(tx, newSize); } } return result; }
synchronized public Value remove(Transaction tx, Key key) throws IOException { assertLoaded(); HashBin<Key,Value> bin = getBin(tx, key); int originalSize = bin.size(); Value result = bin.remove(key); int newSize = bin.size(); if (newSize != originalSize) { store(tx, bin); metadata.size--; if (newSize == 0) { metadata.binsActive--; } } if (metadata.binsActive <= this.decreaseThreshold) { newSize = Math.max(minimumBinCapacity, metadata.binCapacity/2); if(metadata.binCapacity!=newSize) { resize(tx, newSize); } } return result; }
public synchronized void clear(Transaction tx) throws IOException { assertLoaded(); for (int i = 0; i < metadata.binCapacity; i++) { long pageId = metadata.binPageId + i; clearBinAtPage(tx, pageId); } metadata.size = 0; metadata.binsActive = 0; }
public synchronized void clear(Transaction tx) throws IOException { assertLoaded(); for (int i = 0; i < metadata.binCapacity; i++) { long pageId = metadata.binPageId + i; clearBinAtPage(tx, pageId); } metadata.size = 0; metadata.binsActive = 0; }
public synchronized void clear(Transaction tx) throws IOException { assertLoaded(); for (int i = 0; i < metadata.binCapacity; i++) { long pageId = metadata.binPageId + i; clearBinAtPage(tx, pageId); } metadata.size = 0; metadata.binsActive = 0; }
public synchronized Value get(Transaction tx, Key key) throws IOException { assertLoaded(); return getBin(tx, key).get(key); }
public synchronized boolean containsKey(Transaction tx, Key key) throws IOException { assertLoaded(); return getBin(tx, key).containsKey(key); }
public synchronized boolean containsKey(Transaction tx, Key key) throws IOException { assertLoaded(); return getBin(tx, key).containsKey(key); }
public synchronized Value get(Transaction tx, Key key) throws IOException { assertLoaded(); return getBin(tx, key).get(key); }
public synchronized Value get(Transaction tx, Key key) throws IOException { assertLoaded(); return getBin(tx, key).get(key); }
public synchronized boolean containsKey(Transaction tx, Key key) throws IOException { assertLoaded(); return getBin(tx, key).containsKey(key); }
synchronized public Value remove(Transaction tx, Key key) throws IOException { assertLoaded(); HashBin<Key,Value> bin = getBin(tx, key); int originalSize = bin.size(); Value result = bin.remove(key); int newSize = bin.size(); if (newSize != originalSize) { store(tx, bin); metadata.size--; if (newSize == 0) { metadata.binsActive--; } } if (metadata.binsActive <= this.decreaseThreshold) { newSize = Math.max(minimumBinCapacity, metadata.binCapacity/2); if(metadata.binCapacity!=newSize) { resize(tx, newSize); } } return result; }
synchronized public Value put(Transaction tx, Key key, Value value) throws IOException { assertLoaded(); HashBin<Key,Value> bin = getBin(tx, key); int originalSize = bin.size(); Value result = bin.put(key,value); store(tx, bin); int newSize = bin.size(); if (newSize != originalSize) { metadata.size++; if (newSize == 1) { metadata.binsActive++; } } if (metadata.binsActive >= this.increaseThreshold) { newSize = Math.min(maximumBinCapacity, metadata.binCapacity*2); if(metadata.binCapacity!=newSize) { resize(tx, newSize); } } return result; }
synchronized public Value remove(Transaction tx, Key key) throws IOException { assertLoaded(); HashBin<Key,Value> bin = getBin(tx, key); int originalSize = bin.size(); Value result = bin.remove(key); int newSize = bin.size(); if (newSize != originalSize) { store(tx, bin); metadata.size--; if (newSize == 0) { metadata.binsActive--; } } if (metadata.binsActive <= this.decreaseThreshold) { newSize = Math.max(minimumBinCapacity, metadata.binCapacity/2); if(metadata.binCapacity!=newSize) { resize(tx, newSize); } } return result; }
synchronized public Value remove(Transaction tx, Key key) throws IOException { assertLoaded(); HashBin<Key,Value> bin = getBin(tx, key); int originalSize = bin.size(); Value result = bin.remove(key); int newSize = bin.size(); if (newSize != originalSize) { store(tx, bin); metadata.size--; if (newSize == 0) { metadata.binsActive--; } } if (metadata.binsActive <= this.decreaseThreshold) { newSize = Math.max(minimumBinCapacity, metadata.binCapacity/2); if(metadata.binCapacity!=newSize) { resize(tx, newSize); } } return result; }
synchronized public Value put(Transaction tx, Key key, Value value) throws IOException { assertLoaded(); HashBin<Key,Value> bin = getBin(tx, key); int originalSize = bin.size(); Value result = bin.put(key,value); store(tx, bin); int newSize = bin.size(); if (newSize != originalSize) { metadata.size++; if (newSize == 1) { metadata.binsActive++; } } if (metadata.binsActive >= this.increaseThreshold) { newSize = Math.min(maximumBinCapacity, metadata.binCapacity*2); if(metadata.binCapacity!=newSize) { resize(tx, newSize); } } return result; }
synchronized public Value put(Transaction tx, Key key, Value value) throws IOException { assertLoaded(); HashBin<Key,Value> bin = getBin(tx, key); int originalSize = bin.size(); Value result = bin.put(key,value); store(tx, bin); int newSize = bin.size(); if (newSize != originalSize) { metadata.size++; if (newSize == 1) { metadata.binsActive++; } } if (metadata.binsActive >= this.increaseThreshold) { newSize = Math.min(maximumBinCapacity, metadata.binCapacity*2); if(metadata.binCapacity!=newSize) { resize(tx, newSize); } } return result; }