Get the absolute value of the given number.
Get the absolute value of the given number. If the number is Int.MinValue return 0. This is different from java.lang.Math.abs or scala.math.abs in that they return Int.MinValue (!).
Turn a properties map into a string
Create a circular (looping) iterator over a collection.
Create a circular (looping) iterator over a collection.
An iterable over the underlying collection.
A circular iterator over the collection.
Compute the CRC32 of the segment of the byte array given by the specificed size and offset
Compute the CRC32 of the segment of the byte array given by the specificed size and offset
The bytes to checksum
the offset at which to begin checksumming
the number of bytes to checksum
The CRC32
Compute the CRC32 of the byte array
Compute the CRC32 of the byte array
The array to compute the checksum for
The CRC32
Create a file with the given path
Create a file with the given path
The path to create
The created file
If the file create fails
Create an instance of the class with the given class name
Print an error message and shutdown the JVM
Print an error message and shutdown the JVM
The error message
Create a daemon thread
Create a daemon thread
The name of the thread
The runction to execute in the thread
The unstarted thread
Create a daemon thread
Create a daemon thread
The name of the thread
The runnable to execute in the background
The unstarted thread
Create a daemon thread
Create a daemon thread
The runnable to execute in the background
The unstarted thread
Test if two byte buffers are equal.
Test if two byte buffers are equal. In this case equality means having the same bytes from the current position to the limit
Group the given values by keys extracted with the given function
Compute the hash code for the given items
Execute the given function inside the lock
Read a properties file from the given path
Read a properties file from the given path
The path of the file to read
Create a new thread
Create a new thread
The work for the thread to do
Should the thread block JVM shutdown?
The unstarted thread
Create a new thread
Create a new thread
The name of the thread
The work for the thread to do
Should the thread block JVM shutdown?
The unstarted thread
Throw an exception if the given value is null, else return it.
Throw an exception if the given value is null, else return it. You can use this like: val myValue = Utils.notNull(expressionThatShouldntBeNull)
Is the given string null or empty ("")?
Open a channel for the given file
Parse a comma separated string into a sequence of strings.
Parse a comma separated string into a sequence of strings. Whitespace surrounding the comma will be removed.
This method gets comma separated values which contains key,value pairs and returns a map of key value pairs.
This method gets comma separated values which contains key,value pairs and returns a map of key value pairs. the format of allCSVal is key1:val1, key2:val2 ....
Read some bytes into the provided buffer, and return the number of bytes read.
Read some bytes into the provided buffer, and return the number of bytes read. If the channel has been closed or we get -1 on the read for any reason, throw an EOFException
Read a byte array from the given offset and size in the buffer
Read the given byte buffer into a byte array
Attempt to read a file as a string
Read a big-endian integer from a byte array
Read some properties with the given default values
Translate the given buffer into a string
Translate the given buffer into a string
The buffer to translate
The encoding to use in translating bytes to characters
Read an unsigned integer from the given position without modifying the buffers position
Read an unsigned integer from the given position without modifying the buffers position
the buffer to read from
the index from which to read the integer
The integer read, as a long to avoid signedness
Read an unsigned integer from the current position in the buffer, incrementing the position by 4 bytes
Read an unsigned integer from the current position in the buffer, incrementing the position by 4 bytes
The buffer to read from
The integer read, as a long to avoid signedness
Register the given mbean with the platform mbean server, unregistering any mbean that was there before.
Register the given mbean with the platform mbean server, unregistering any mbean that was there before. Note, this method will not throw an exception if the registration fails (since there is nothing you can do and it isn't fatal), instead it just returns false indicating the registration failed.
The object to register as an mbean
The name to register this mbean with
true if the registration succeeded
Replace the given string suffix with the new suffix.
Replace the given string suffix with the new suffix. If the string doesn't end with the given suffix throw an exception.
Recursively delete the given file/directory and any subfiles (if any exist)
Recursively delete the given file/directory and any subfiles (if any exist)
The root file at which to begin deleting
Recursively delete the list of files/directories and any subfiles (if any exist)
Recursively delete the given file/directory and any subfiles (if any exist)
Recursively delete the given file/directory and any subfiles (if any exist)
The root file at which to begin deleting
Wrap the given function in a java.
Wrap the given function in a java.lang.Runnable
A function
A Runnable that just executes the function
Get the stack trace from an exception as a string
Do the given action and log any exceptions thrown without rethrowing them
Do the given action and log any exceptions thrown without rethrowing them
The log method to use for logging. E.g. logger.warn
The action to execute
Unregister the mbean with the given name, if there is one registered
Unregister the mbean with the given name, if there is one registered
The mbean name to unregister
Write the given long value as a 4 byte unsigned integer.
Write the given long value as a 4 byte unsigned integer. Overflow is ignored.
The buffer to write to
The position in the buffer at which to begin writing
The value to write
Write the given long value as a 4 byte unsigned integer.
Write the given long value as a 4 byte unsigned integer. Overflow is ignored.
The buffer to write to
The value to write
General helper functions!
This is for general helper functions that aren't specific to Kafka logic. Things that should have been included in the standard library etc.
If you are making a new helper function and want to add it to this class please ensure the following: 1. It has documentation 2. It is the most general possible utility, not just the thing you needed in one particular place 3. You have tests for it if it is nontrivial in any way