Package io.openems.shared.influxdb
Class AbstractMergePointsWorker<T>
java.lang.Object
io.openems.common.worker.AbstractWorker
io.openems.common.worker.AbstractImmediateWorker
io.openems.shared.influxdb.AbstractMergePointsWorker<T>
- All Implemented Interfaces:
MergePointsWorker
- Direct Known Subclasses:
ForceMergePointsWorker
,SafeMergePointsWorker
public abstract class AbstractMergePointsWorker<T>
extends AbstractImmediateWorker
implements MergePointsWorker
-
Field Summary
Modifier and TypeFieldDescriptionprotected final InfluxConnector
protected final com.influxdb.client.write.WriteParameters
Fields inherited from class io.openems.common.worker.AbstractWorker
ALWAYS_WAIT_FOR_TRIGGER_NEXT_RUN, DO_NOT_WAIT, thread
-
Constructor Summary
ConstructorDescriptionAbstractMergePointsWorker
(InfluxConnector parent, String name, com.influxdb.client.write.WriteParameters writeParameters, Consumer<com.influxdb.exceptions.BadRequestException> onWriteError) -
Method Summary
Modifier and TypeMethodDescriptionvoid
activate()
Activates the worker.debugLog()
Simple debug log string.protected void
forever()
This method is called in a loop forever until the Thread gets interrupted.boolean
Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions, returning true upon success and false if no space is currently available.protected void
onWriteError
(Throwable t, List<T> points) protected abstract List
<com.influxdb.client.write.Point> writePoints
(List<T> points) Methods inherited from class io.openems.common.worker.AbstractImmediateWorker
activate, deactivate, getCycleTime
Methods inherited from class io.openems.common.worker.AbstractWorker
activate, modified, modified, setPriority, triggerNextRun
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.openems.shared.influxdb.MergePointsWorker
deactivate, offer
-
Field Details
-
parent
-
writeParameters
protected final com.influxdb.client.write.WriteParameters writeParameters
-
-
Constructor Details
-
Method Details
-
activate
public void activate()Description copied from interface:MergePointsWorker
Activates the worker.- Specified by:
activate
in interfaceMergePointsWorker
-
forever
Description copied from class:AbstractWorker
This method is called in a loop forever until the Thread gets interrupted.- Specified by:
forever
in classAbstractImmediateWorker
- Throws:
InterruptedException
-
writePoints
-
onWriteError
-
offer
Inserts the specified element into this queue if it is possible to do so immediately without violating capacity restrictions, returning true upon success and false if no space is currently available.- Parameters:
point
- the point to add- Returns:
- true if the point was added to this queue, else false
-
debugLog
Description copied from interface:MergePointsWorker
Simple debug log string.- Specified by:
debugLog
in interfaceMergePointsWorker
- Returns:
- the debug string
-