Package dev.getelements.elements.rt
Interface InstanceMetadataContext
- All Known Implementing Classes:
SimpleInstanceMetadataContext
public interface InstanceMetadataContext
Provides data for an Instance, which is representative of the physical machine running one or more nodes. Each
Node will have a special
NodeId
that allows the remote services to access the information about the
underlying instance.-
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.default void
start()
Starts thisInstanceMetadataContext
.default void
stop()
Stops thisInstanceMetadataContext
.
-
Method Details
-
start
default void start()Starts thisInstanceMetadataContext
. -
stop
default void stop()Stops thisInstanceMetadataContext
. -
getNodeIds
Gets allNodeId
s housed within the instance. -
getInstanceQuality
double getInstanceQuality()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.- Returns:
- the instance's load
-
getInstanceMetadataAsync
AsyncOperation getInstanceMetadataAsync(Consumer<InstanceMetadata> success, Consumer<Throwable> failure) Asynchronous method to fetch the- Parameters:
success
-failure
-- Returns:
-