DocumentStoreCollectionCreator implements SchemaCreator { @Override public void createTimelineSchema(String[] args) { try { Configuration conf = new YarnConfiguration(); LOG.info("Creating database and collections for DocumentStore : {}", DocumentStoreUtils.getStoreVendor(conf)); try(DocumentStoreWriter documentStoreWriter = DocumentStoreFactory .createDocumentStoreWriter(conf)) { documentStoreWriter.createDatabase(); documentStoreWriter.createCollection( CollectionType.APPLICATION.getCollectionName()); documentStoreWriter.createCollection( CollectionType.ENTITY.getCollectionName()); documentStoreWriter.createCollection( CollectionType.FLOW_ACTIVITY.getCollectionName()); documentStoreWriter.createCollection( CollectionType.FLOW_RUN.getCollectionName()); } } catch (Exception e) { LOG.error("Error while creating Timeline Collections", e); } }  @Override void createTimelineSchema(String[] args);  }
@Test public void collectionCreatorTest() { new DocumentStoreCollectionCreator().createTimelineSchema(new String[]{}); }