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 thedouble
Represents the instance's current load factor.Gets allNodeId
s housed within the instance.void
setInstanceId
(InstanceId instanceId) void
setLoadMonitorService
(LoadMonitorService loadMonitorService) void
void
start()
Starts thisInstanceMetadataContext
.void
stop()
Stops thisInstanceMetadataContext
.
-
Constructor Details
-
SimpleInstanceMetadataContext
public SimpleInstanceMetadataContext()
-
-
Method Details
-
start
public void start()Description copied from interface:InstanceMetadataContext
Starts thisInstanceMetadataContext
.- Specified by:
start
in interfaceInstanceMetadataContext
-
stop
public void stop()Description copied from interface:InstanceMetadataContext
Stops thisInstanceMetadataContext
.- Specified by:
stop
in interfaceInstanceMetadataContext
-
getNodeIds
Description copied from interface:InstanceMetadataContext
Gets allNodeId
s housed within the instance.- Specified by:
getNodeIds
in interfaceInstanceMetadataContext
- Returns:
- the
Set<NodeId>
of all running and active nodes on the instance
-
getInstanceQuality
public double getInstanceQuality()Description copied from interface:InstanceMetadataContext
Represents 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:
getInstanceQuality
in interfaceInstanceMetadataContext
- Returns:
- the instance's load
-
getInstanceMetadataAsync
public AsyncOperation getInstanceMetadataAsync(Consumer<InstanceMetadata> success, Consumer<Throwable> failure) Description copied from interface:InstanceMetadataContext
Asynchronous method to fetch the- Specified by:
getInstanceMetadataAsync
in interfaceInstanceMetadataContext
- Parameters:
success
-failure
-- Returns:
-
getWorker
-
setWorker
-
setInstanceId
-
getLoadMonitorService
-
setLoadMonitorService
-