MCPcopy Create free account
hub / github.com/BaseXdb/basex / db

Method db

basex-core/src/main/java/org/basex/core/cmd/InfoDB.java:46–76  ·  view source on GitHub ↗

Creates a database information string. @param meta meta data @param bold header bold header flag @param index add index information @return info string

(final MetaData meta, final boolean bold, final boolean index)

Source from the content-addressed store, hash-verified

44 * @return info string
45 */
46 public static String db(final MetaData meta, final boolean bold, final boolean index) {
47 final TokenBuilder tb = new TokenBuilder();
48 final String header = (bold ? new TokenBuilder().bold().add('%').norm().toString() : "%") + NL;
49 tb.addExt(header, DB_PROPS);
50 info(tb, MetaProp.NAME, meta);
51 info(tb, MetaProp.SIZE.name(), Performance.formatHuman(meta.dbSize()));
52 info(tb, MetaProp.NODES, meta);
53 info(tb, MetaProp.DOCUMENTS, meta);
54 info(tb, MetaProp.BINARIES, meta);
55 info(tb, MetaProp.VALUES, meta);
56 info(tb, MetaProp.TIMESTAMP, meta);
57 info(tb, MetaProp.UPTODATE, meta);
58 if(meta.corrupt) tb.add(' ' + DB_CORRUPT + NL);
59
60 tb.add(NL).addExt(header, RES_PROPS);
61 info(tb, MetaProp.INPUTPATH, meta);
62 info(tb, MetaProp.INPUTSIZE.name(), Performance.formatHuman(meta.inputsize));
63 info(tb, MetaProp.INPUTDATE, meta);
64
65 if(index) {
66 tb.add(NL).addExt(header, INDEXES);
67 if(meta.oldindex()) {
68 tb.add(' ' + H_INDEX_FORMAT + NL);
69 } else {
70 for(final MetaProp prop : MetaProp.values()) {
71 if(prop.index) info(tb, prop, meta);
72 }
73 }
74 }
75 return tb.toString();
76 }
77
78 @Override
79 public void build(final CmdBuilder cb) {

Callers 4

runMethod · 0.95
itemMethod · 0.95
actionMethod · 0.95
actionMethod · 0.95

Calls 13

addExtMethod · 0.95
formatHumanMethod · 0.95
addMethod · 0.95
toStringMethod · 0.95
normMethod · 0.80
dbSizeMethod · 0.80
oldindexMethod · 0.80
toStringMethod · 0.65
addMethod · 0.65
infoMethod · 0.65
nameMethod · 0.65
boldMethod · 0.45

Tested by

no test coverage detected