Util¶
-
check_not_none
(val, message)¶ Tests if an argument is not
None
.- Parameters
val – (object), the argument tested to see if it is not
None
.message – (str), the error message.
-
check_true
(val, message)¶ Tests whether the provided expression is
true
.- Parameters
val – (bool), the expression tested to see if it is
true
.message – (str), the error message.
-
check_not_negative
(val, message)¶ Tests if a value is not negative.
- Parameters
val – (Number), the value tested to see if it is not negative.
message – (str), the error message.
-
check_not_empty
(collection, message)¶ Tests if a collection is not empty.
- Parameters
collection – (Collection), the collection tested to see if it is not empty.
message – (str), the error message.
-
current_time
()¶ Returns the current time of the system.
- Returns
(float), current time of the system.
-
current_time_in_millis
()¶ Returns the current time of the system in millis. :return: (int), current time of the system in millis.
-
thread_id
()¶ Returns the current thread’s id.
- Returns
(int), current thread’s id.
-
to_millis
(seconds)¶ Converts the time parameter in seconds to milliseconds.
- Parameters
seconds – (Number), the given time in seconds.
- Returns
(int), result of the conversation in milliseconds.
-
to_nanos
(seconds)¶ Converts the time parameter in seconds to nanoseconds.
- Parameters
seconds – (Number), the given time in seconds.
- Returns
(int), result of the conversation in nanoseconds.
-
validate_type
(_type)¶ Validates the type.
- Parameters
_type – (Type), the type to be validated.
-
validate_serializer
(serializer, _type)¶ Validates the serializer for given type.
- Parameters
serializer – (Serializer), the serializer to be validated.
_type – (Type), type to be used for serializer validation.
-
class
AtomicInteger
(initial=0)¶ Bases:
object
AtomicInteger is an Integer which can work atomically.
-
get_and_increment
()¶ Returns the current value and increment it.
- Returns
(int), current value of AtomicInteger.
-
set
(value)¶ Sets the value of this AtomicInteger. :param value: (int), the new value of AtomicInteger.
-
-
enum
(**enums)¶ Utility method for defining enums. :param enums: Parameters of enumeration. :return: (Enum), the created enumerations.
-
get_possible_addresses
(addresses=[], member_list=[])¶
-
get_provider_addresses
(providers=[])¶
-
parse_addresses
(addresses=[])¶
-
class
ImmutableLazyDataList
(list_data, to_object)¶ Bases:
collections.abc.Sequence
-
get_portable_version
(portable, default_version)¶
-
class
TimeUnit
¶ Bases:
object
Represents the time durations at given units in seconds.
-
NANOSECOND
= 1e-09¶
-
MICROSECOND
= 1e-06¶
-
MILLISECOND
= 0.001¶
-
SECOND
= 1.0¶
-
MINUTE
= 60.0¶
-
HOUR
= 3600.0¶
-
static
to_seconds
(value, time_unit)¶ - Parameters
value – (Number), value to be translated to seconds
time_unit – Time duration in seconds
- Returns
Value of the value in seconds
-
-
calculate_version
(version_str)¶
-
class
VersionMessageFilter
(name='')¶ Bases:
logging.Filter
Initialize a filter.
Initialize with the name of the logger which, together with its children, will have its events allowed through the filter. If no name is specified, allow every event.
-
filter
(record)¶ Determine if the specified record is to be logged.
Is the specified record to be logged? Returns 0 for no, nonzero for yes. If deemed appropriate, the record may be modified in-place.
-
-
class
HazelcastFormatter
(fmt=None, datefmt=None, style='%')¶ Bases:
logging.Formatter
Initialize the formatter with specified format strings.
Initialize the formatter either with the specified format string, or a default as described above. Allow for specialized date formatting with the optional datefmt argument. If datefmt is omitted, you get an ISO8601-like (or RFC 3339-like) format.
Use a style parameter of ‘%’, ‘{‘ or ‘$’ to specify that you want to use one of %-formatting,
str.format()
({}
) formatting orstring.Template
formatting in your format string.Changed in version 3.2: Added the
style
parameter.-
format
(record)¶ Format the specified record as text.
The record’s attribute dictionary is used as the operand to a string formatting operation which yields the returned string. Before formatting the dictionary, a couple of preparatory steps are carried out. The message attribute of the record is computed using LogRecord.getMessage(). If the formatting string uses the time (as determined by a call to usesTime(), formatTime() is called to format the event time. If there is exception information, it is formatted using formatException() and appended to the message.
-
-
create_git_info
()¶