public VolatileComponentStatusRepository(final NiFiProperties nifiProperties) { numDataPoints = nifiProperties.getIntegerProperty(NUM_DATA_POINTS_PROPERTY, DEFAULT_NUM_DATA_POINTS); gcStatuses = new RingBuffer<>(numDataPoints); timestamps = new RingBuffer<>(numDataPoints); }
@Override public void update(final ProvenanceEventRecord event, final StorageSummary storageSummary) { final String componentId = event.getComponentId(); final RingBuffer<Long> ringBuffer = latestRecords.computeIfAbsent(componentId, id -> new RingBuffer<>(1000)); ringBuffer.add(storageSummary.getEventId()); }
RingBuffer<Bulletin> bulletinBuffer = componentMap.get(CONTROLLER_BULLETIN_STORE_KEY); if (bulletinBuffer == null) { bulletinBuffer = new RingBuffer<>(CONTROLLER_BUFFER_SIZE); final RingBuffer<Bulletin> existingBuffer = componentMap.putIfAbsent(CONTROLLER_BULLETIN_STORE_KEY, bulletinBuffer); if (existingBuffer != null) { RingBuffer<Bulletin> bulletinBuffer = componentMap.get(bulletin.getSourceId()); if (bulletinBuffer == null) { bulletinBuffer = new RingBuffer<>(COMPONENT_BUFFER_SIZE); final RingBuffer<Bulletin> existingBuffer = componentMap.putIfAbsent(bulletin.getSourceId(), bulletinBuffer); if (existingBuffer != null) {
public VolatileProvenanceRepository(final NiFiProperties nifiProperties) { maxSize = nifiProperties.getIntegerProperty(BUFFER_SIZE, DEFAULT_BUFFER_SIZE); ringBuffer = new RingBuffer<>(maxSize); final String indexedFieldString = nifiProperties.getProperty(NiFiProperties.PROVENANCE_INDEXED_FIELDS); final String indexedAttrString = nifiProperties.getProperty(NiFiProperties.PROVENANCE_INDEXED_ATTRIBUTES); searchableFields = Collections.unmodifiableList(SearchableFieldParser.extractSearchableFields(indexedFieldString, true)); searchableAttributes = Collections.unmodifiableList(SearchableFieldParser.extractSearchableFields(indexedAttrString, false)); final ThreadFactory defaultThreadFactory = Executors.defaultThreadFactory(); queryExecService = Executors.newFixedThreadPool(2, new ThreadFactory() { private final AtomicInteger counter = new AtomicInteger(0); @Override public Thread newThread(final Runnable r) { final Thread thread = defaultThreadFactory.newThread(r); thread.setName("Provenance Query Thread-" + counter.incrementAndGet()); return thread; } }); scheduledExecService = Executors.newScheduledThreadPool(2); }
final RingBuffer<ProvenanceEventRecord> latestRecords = new RingBuffer<>(1000);
final RingBuffer<ProvenanceEventRecord> latestRecords = new RingBuffer<>(1000);