use of io.nosqlbench.docapi.DocsBinder in project nosqlbench by nosqlbench.
the class BundledMarkdownZipExporter method exportDocs.
public void exportDocs(Path out) {
ZipOutputStream zipstream;
try {
OutputStream stream = Files.newOutputStream(out, StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING);
zipstream = new ZipOutputStream(stream);
zipstream.setMethod(ZipOutputStream.DEFLATED);
zipstream.setLevel(9);
DocsBinder docsNameSpaces = BundledMarkdownLoader.loadBundledMarkdown();
for (DocsNameSpace docs_ns : docsNameSpaces) {
for (Path p : docs_ns) {
addEntry(p, p.getParent(), zipstream);
}
}
zipstream.finish();
stream.close();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
use of io.nosqlbench.docapi.DocsBinder in project nosqlbench by nosqlbench.
the class BundledDriverAdapterDocs method getDocs.
@Override
public DocsBinder getDocs() {
Docs docs = new Docs().namespace("adapter-docs");
SimpleServiceLoader<DriverAdapter> loader = new SimpleServiceLoader<>(DriverAdapter.class, Maturity.Any);
List<SimpleServiceLoader.Component<? extends DriverAdapter>> namedProviders = loader.getNamedProviders();
for (SimpleServiceLoader.Component<? extends DriverAdapter> namedProvider : namedProviders) {
DriverAdapter driverAdapter = namedProvider.provider.get();
DocsBinder bundledDocs = driverAdapter.getBundledDocs();
docs.merge(bundledDocs);
}
return docs;
}
Aggregations