public void addLocksToRequest(LockRequest request) { for (TableTrie tab : trie.values()) { for (PartTrie part : tab.values()) { for (LockComponent lock : part.values()) { request.addToComponent(lock); } } } }
private void setPart(LockComponent comp, PartTrie parts) { LockComponent existing = parts.get(comp.getPartitionname()); if (existing == null) { // No existing lock for this partition. parts.put(comp.getPartitionname(), comp); } else if (existing.getType() != LockType.EXCLUSIVE && (comp.getType() == LockType.EXCLUSIVE || comp.getType() == LockType.SHARED_WRITE)) { // We only need to promote if comp.type is > existing.type. For // efficiency we check if existing is exclusive (in which case we // need never promote) or if comp is exclusive or shared_write (in // which case we can promote even though they may both be shared // write). If comp is shared_read there's never a need to promote. parts.put(comp.getPartitionname(), comp); } }
private void setPart(LockComponent comp, PartTrie parts) { LockComponent existing = parts.get(comp.getPartitionname()); if (existing == null) { // No existing lock for this partition. parts.put(comp.getPartitionname(), comp); } else if (existing.getType() != LockType.EXCLUSIVE && (comp.getType() == LockType.EXCLUSIVE || comp.getType() == LockType.SHARED_WRITE)) { // We only need to promote if comp.type is > existing.type. For // efficiency we check if existing is exclusive (in which case we // need never promote) or if comp is exclusive or shared_write (in // which case we can promote even though they may both be shared // write). If comp is shared_read there's never a need to promote. parts.put(comp.getPartitionname(), comp); } }
private void setPart(LockComponent comp, PartTrie parts) { LockComponent existing = parts.get(comp.getPartitionname()); if (existing == null) { // No existing lock for this partition. parts.put(comp.getPartitionname(), comp); } else if (existing.getType() != LockType.EXCLUSIVE && (comp.getType() == LockType.EXCLUSIVE || comp.getType() == LockType.SHARED_WRITE)) { // We only need to promote if comp.type is > existing.type. For // efficiency we check if existing is exclusive (in which case we // need never promote) or if comp is exclusive or shared_write (in // which case we can promote even though they may both be shared // write). If comp is shared_read there's never a need to promote. parts.put(comp.getPartitionname(), comp); } }
private void setTable(LockComponent comp, TableTrie tabs) { PartTrie parts = tabs.get(comp.getTablename()); if (parts == null) { parts = new PartTrie(); tabs.put(comp.getTablename(), parts); } setPart(comp, parts); }
private void setTable(LockComponent comp, TableTrie tabs) { PartTrie parts = tabs.get(comp.getTablename()); if (parts == null) { parts = new PartTrie(); tabs.put(comp.getTablename(), parts); } setPart(comp, parts); }
public void addLocksToRequest(LockRequest request) { for (TableTrie tab : trie.values()) { for (PartTrie part : tab.values()) { for (LockComponent lock : part.values()) { request.addToComponent(lock); } } } }
private void setTable(LockComponent comp, TableTrie tabs) { PartTrie parts = tabs.get(comp.getTablename()); if (parts == null) { parts = new PartTrie(); tabs.put(comp.getTablename(), parts); } setPart(comp, parts); }
public void addLocksToRequest(LockRequest request) { for (TableTrie tab : trie.values()) { for (PartTrie part : tab.values()) { for (LockComponent lock : part.values()) { request.addToComponent(lock); } } } }
public void addLocksToRequest(LockRequest request) { for (TableTrie tab : trie.values()) { for (PartTrie part : tab.values()) { for (LockComponent lock : part.values()) { request.addToComponent(lock); } } } }
private void setPart(LockComponent comp, PartTrie parts) { LockComponent existing = parts.get(comp.getPartitionname()); if (existing == null) { // No existing lock for this partition. parts.put(comp.getPartitionname(), comp); } else if (existing.getType() != LockType.EXCLUSIVE && (comp.getType() == LockType.EXCLUSIVE || comp.getType() == LockType.SHARED_WRITE)) { // We only need to promote if comp.type is > existing.type. For // efficiency we check if existing is exclusive (in which case we // need never promote) or if comp is exclusive or shared_write (in // which case we can promote even though they may both be shared // write). If comp is shared_read there's never a need to promote. parts.put(comp.getPartitionname(), comp); } }
private void setTable(LockComponent comp, TableTrie tabs) { PartTrie parts = tabs.get(comp.getTablename()); if (parts == null) { parts = new PartTrie(); tabs.put(comp.getTablename(), parts); } setPart(comp, parts); }