Package dev.getelements.elements.rt
Class SimpleInstanceMetadataContext
java.lang.Object
dev.getelements.elements.rt.SimpleInstanceMetadataContext
- All Implemented Interfaces:
InstanceMetadataContext
Provides data for an Instance.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetInstanceMetadataAsync(Consumer<InstanceMetadata> success, Consumer<Throwable> failure) Asynchronous method to fetch thedoubleRepresents the instance's current load factor.Gets allNodeIds housed within the instance.voidsetInstanceId(InstanceId instanceId) voidsetLoadMonitorService(LoadMonitorService loadMonitorService) voidvoidstart()Starts thisInstanceMetadataContext.voidstop()Stops thisInstanceMetadataContext.
-
Constructor Details
-
SimpleInstanceMetadataContext
public SimpleInstanceMetadataContext()
-
-
Method Details
-
start
public void start()Description copied from interface:InstanceMetadataContextStarts thisInstanceMetadataContext.- Specified by:
startin interfaceInstanceMetadataContext
-
stop
public void stop()Description copied from interface:InstanceMetadataContextStops thisInstanceMetadataContext.- Specified by:
stopin interfaceInstanceMetadataContext
-
getNodeIds
Description copied from interface:InstanceMetadataContextGets allNodeIds housed within the instance.- Specified by:
getNodeIdsin interfaceInstanceMetadataContext- Returns:
- the
Set<NodeId>of all running and active nodes on the instance
-
getInstanceQuality
public double getInstanceQuality()Description copied from interface:InstanceMetadataContextRepresents the instance's current load factor. This returns a double in the range of [0, 1], with the higher number representing a greater load. Load represents a single average measurement of how loaded the system is and this number may not necessary equate to CPU load.- Specified by:
getInstanceQualityin interfaceInstanceMetadataContext- Returns:
- the instance's load
-
getInstanceMetadataAsync
public AsyncOperation getInstanceMetadataAsync(Consumer<InstanceMetadata> success, Consumer<Throwable> failure) Description copied from interface:InstanceMetadataContextAsynchronous method to fetch the- Specified by:
getInstanceMetadataAsyncin interfaceInstanceMetadataContext- Parameters:
success-failure-- Returns:
-
getWorker
-
setWorker
-
setInstanceId
-
getLoadMonitorService
-
setLoadMonitorService
-