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

Method DiskData

basex-core/src/main/java/org/basex/data/DiskData.java:65–96  ·  view source on GitHub ↗

Default constructor, called from Open#open. @param meta meta data @throws IOException I/O Exception

(final MetaData meta)

Source from the content-addressed store, hash-verified

63 * @throws IOException I/O Exception
64 */
65 public DiskData(final MetaData meta) throws IOException {
66 super(meta);
67
68 try(DataInput in = new DataInput(meta.dbFile(DATAINF))) {
69 meta.read(in);
70 while(true) {
71 final String k = string(in.readToken());
72 if(k.isEmpty()) break;
73 switch(k) {
74 case DBTAGS -> elemNames = new Names(in, meta);
75 case DBATTS -> attrNames = new Names(in, meta);
76 case DBPATH -> paths = new PathIndex(this, in);
77 case DBNS -> nspaces = new Namespaces(in);
78 case DBDOCS -> resources.read(in);
79 }
80 }
81 }
82
83 // open data and indexes
84 init();
85 if(meta.updindex) {
86 idmap = new IdPreMap(meta.dbFile(DATAIDP));
87 if(meta.textindex) textIndex = new UpdatableDiskValues(this, IndexType.TEXT);
88 if(meta.attrindex) attrIndex = new UpdatableDiskValues(this, IndexType.ATTRIBUTE);
89 if(meta.tokenindex) tokenIndex = new UpdatableDiskValues(this, IndexType.TOKEN);
90 } else {
91 if(meta.textindex) textIndex = new DiskValues(this, IndexType.TEXT);
92 if(meta.attrindex) attrIndex = new DiskValues(this, IndexType.ATTRIBUTE);
93 if(meta.tokenindex) tokenIndex = new DiskValues(this, IndexType.TOKEN);
94 }
95 if(meta.ftindex) ftIndex = new FTIndex(this);
96 }
97
98 /**
99 * Internal database constructor, called from {@link DiskBuilder#build}.

Callers

nothing calls this directly

Calls 7

initMethod · 0.95
dbFileMethod · 0.80
readMethod · 0.65
stringMethod · 0.45
readTokenMethod · 0.45
isEmptyMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected