/** * The given DatabaseClient is used to construct a BatchWriter that writes to MarkLogic via the REST API. The * expectation is that the client will then either call setDocumentFileReader or will rely on the default one * that's created by this class if one has not yet been set. * * @param client */ public GenericFileLoader(DatabaseClient client) { RestBatchWriter restBatchWriter = new RestBatchWriter(client); restBatchWriter.setReleaseDatabaseClients(false); this.batchWriter = restBatchWriter; }
@Override public void write(List<? extends DocumentWriteOperation> items) { initialize(); DatabaseClient client = determineDatabaseClientToUse(); Runnable runnable = buildRunnable(client, items); executeRunnable(runnable, items); }
RestBatchWriter assetBatchWriter = new RestBatchWriter(appConfig.newModulesDatabaseClient(), false); assetBatchWriter.setThreadCount(threadCount); AssetFileLoader assetFileLoader = new AssetFileLoader(assetBatchWriter, modulesManager); if (appConfig.getModulesLoaderBatchSize() != null) {