public ConcurrentMap<String, ConcurrentMap<String, Row>> getDatabase(String dbName) {
TableDB tdb = dbCache.get(dbName);
- if (tdb == null) return null;
+ if (tdb == null) {
+ return null;
+ }
return tdb.getTableCache();
}
public ConcurrentMap<String, Row> getTableCache(String dbName, String tableName) {
ConcurrentMap<String, ConcurrentMap<String,Row>> tdbMap = getDatabase(dbName);
- if (tdbMap == null) return null;
+ if (tdbMap == null) {
+ return null;
+ }
return tdbMap.get(tableName);
}
public Row getRow (String dbName, String tableName, String uuid) {
ConcurrentMap<String, Row> tdb = this.getTableCache(dbName, tableName);
- if (tdb == null) return null;
+ if (tdb == null) {
+ return null;
+ }
return tdb.get(uuid);
}
public void removeRow(String dbName, String tableName, String uuid) {
TableDB db = dbCache.get(dbName);
- if (db == null) return;
+ if (db == null) {
+ return;
+ }
db.removeRow(tableName, uuid);
}
for (String dbName : dbCache.keySet()) {
System.out.println("Database "+dbName);
ConcurrentMap<String, ConcurrentMap<String,Row>> tableDB = this.getDatabase(dbName);
- if (tableDB == null) continue;
+ if (tableDB == null) {
+ continue;
+ }
for (String tableName : tableDB.keySet()) {
ConcurrentMap<String, Row> tableRows = this.getTableCache(dbName, tableName);
System.out.println("\tTable "+tableName);
Collection<Column> columns = row.getColumns();
System.out.print("\t\t"+uuid+ "==");
for (Column column : columns) {
- if (column.getData() != null) System.out.print(column.getSchema().getName()+" : "+ column.getData()+" ");
+ if (column.getData() != null) {
+ System.out.print(column.getSchema().getName()+" : "+ column.getData()+" ");
+ }
}
System.out.println("");
}
MapUtils.debugPrint(System.out, null, cache);
}
}
-}
\ No newline at end of file
+}