MCPcopy Create free account
hub / github.com/e2wugui/zeze / openTable

Method openTable

ZezeJava/ZezeJava/src/main/java/Zeze/Dbh2/Database.java:155–168  ·  view source on GitHub ↗
(String name, int id)

Source from the content-addressed store, hash-verified

153 private final ConcurrentHashMap<String, Dbh2Table> tables = new ConcurrentHashMap<>();
154
155 @Override
156 public Table openTable(String name, int id) {
157 if (name.contains("@"))
158 throw new RuntimeException("'@' is reserve.");
159
160 var special = "___"; // prefix table 使用这个最后
161 var idx = name.indexOf(special);
162 if (idx >= 0) {
163 var tableName = name.substring(idx + special.length());
164 return new Dbh2PrefixTable(tables.computeIfAbsent(tableName, Dbh2Table::new), id);
165 }
166 // 这里不使用tables,保留的旧的逻辑不变。
167 return new Dbh2Table(name);
168 }
169
170 @Override
171 public Transaction beginTransaction() {

Callers 15

testBenchMethod · 0.95
testFullMethod · 0.95
mainMethod · 0.45
mainMethod · 0.45
achillesHeelDaemonMethod · 0.45
acquireShareMethod · 0.45
acquireModifyMethod · 0.45
releaseMethod · 0.45
ProcessLoginRequestMethod · 0.45

Calls 3

containsMethod · 0.65
computeIfAbsentMethod · 0.65
indexOfMethod · 0.45

Tested by 4

testBenchMethod · 0.76
testFullMethod · 0.76
mainMethod · 0.36