public static DocumentTypeManager configureNewManager(DocumentmanagerConfig config) { DocumentTypeManager manager = new DocumentTypeManager(); if (config == null) { return manager; } configureNewManager(config, manager); return manager; }
public SDDocumentTypeOrderer(List<SDDocumentType> sdTypes, DeployLogger deployLogger) { this.deployLogger = deployLogger; for (SDDocumentType type : sdTypes) { createdSDTypes.put(type.getDocumentName(), type); } DocumentTypeManager dtm = new DocumentTypeManager(); for (DataType type : dtm.getDataTypes()) { seenTypes.add(type.getId()); } }
/** * <p>Constructs a new document access object.</p> * * @param params The parameters to use for setup. */ protected DocumentAccess(DocumentAccessParams params) { super(); if (params.documentmanagerConfig().isPresent()) { // our config has been injected into the creator documentTypeManager = new DocumentTypeManager(params.documentmanagerConfig().get()); documentTypeConfigSubscriber = null; } else { // fallback to old style subscription documentTypeManager = new DocumentTypeManager(); documentTypeConfigSubscriber = DocumentTypeManagerConfigurer.configure(documentTypeManager, params.getDocumentManagerConfigId()); } }
/** * Called by the configuration system to register document types based on documentmanager.cfg. * * @param config the instance representing config in documentmanager.cfg. */ @Override public void configure(DocumentmanagerConfig config) { DocumentTypeManager manager = configureNewManager(config); int defaultTypeCount = new DocumentTypeManager().getDataTypes().size(); if (this.managerToConfigure.getDataTypes().size() != defaultTypeCount) { log.log(LogLevel.DEBUG, "Live document config overwritten with new config."); } managerToConfigure.assign(manager); }
public FeedHandlerV3( LoggingRequestHandler.Context parentCtx, DocumentmanagerConfig documentManagerConfig, SessionCache sessionCache, ThreadpoolConfig threadpoolConfig, DocumentApiMetrics metricsHelper) throws Exception { super(parentCtx); docTypeManager = new DocumentTypeManager(documentManagerConfig); this.sessionCache = sessionCache; feedReplyHandler = new FeedReplyReader(parentCtx.getMetric(), metricsHelper); cron = new ScheduledThreadPoolExecutor(1, ThreadFactoryFactory.getThreadFactory("feedhandlerv3.cron")); cron.scheduleWithFixedDelay(this::removeOldClients, 16, 11, TimeUnit.MINUTES); this.metric = parentCtx.getMetric(); // 40% of the threads can be blocking on feeding before we deny requests. if (threadpoolConfig != null) { threadsAvailableForFeeding = new AtomicInteger(Math.max((int) (0.4 * threadpoolConfig.maxthreads()), 1)); } else { log.warning("No config for threadpool, using 200 for max blocking threads for feeding."); threadsAvailableForFeeding = new AtomicInteger(200); } }
@Inject public RestApi(LoggingRequestHandler.Context parentCtx, DocumentmanagerConfig documentManagerConfig, LoadTypeConfig loadTypeConfig, ThreadpoolConfig threadpoolConfig, AllClustersBucketSpacesConfig bucketSpacesConfig, ClusterListConfig clusterListConfig, MetricReceiver metricReceiver) { super(parentCtx); MessageBusParams params = new MessageBusParams(new LoadTypeSet(loadTypeConfig)); params.setDocumentmanagerConfig(documentManagerConfig); this.operationHandler = new OperationHandlerImpl( new MessageBusDocumentAccess(params), fixedClusterEnumeratorFromConfig(clusterListConfig), fixedBucketSpaceResolverFromConfig(bucketSpacesConfig), metricReceiver); this.singleDocumentParser = new SingleDocumentParser(new DocumentTypeManager(documentManagerConfig)); // 40% of the threads can be blocked before we deny requests. if (threadpoolConfig != null) { threadsAvailableForApi = new AtomicInteger(Math.max((int) (0.4 * threadpoolConfig.maxthreads()), 1)); } else { log.warning("No config for threadpool, using 200 for max blocking threads for document rest API."); threadsAvailableForApi = new AtomicInteger(200); } }
.setContainerCoreMemoryMb(containerMbusConfig.containerCoreMemory()) .setMaxQueueTimeMs(docprocConfig.maxqueuetimems()) .setDocumentTypeManager(new DocumentTypeManager(docManConfig)) .setChainsModel(buildFromConfig(chainsConfig)).setSchemaMap(configureMapping(mappingConfig)) .setStatisticsManager(manager)
this.docMan = docMan; } else { this.docMan = new DocumentTypeManager(); DocumentTypeManagerConfigurer.configure(this.docMan, cfg);