|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cassandra.utils.FBUtilities
public class FBUtilities
Field Summary | |
---|---|
static int |
MAX_UNSIGNED_SHORT
|
static java.math.BigInteger |
TWO
|
Constructor Summary | |
---|---|
FBUtilities()
|
Method Summary | ||
---|---|---|
static
|
classForName(java.lang.String classname,
java.lang.String readable)
|
|
static
|
closeableIterator(java.util.Iterator<T> iterator)
|
|
static int |
compareUnsigned(byte[] bytes1,
byte[] bytes2,
int offset1,
int offset2,
int len1,
int len2)
|
|
static
|
construct(java.lang.String classname,
java.lang.String readable)
Constructs an instance of the given class, which must have a no-arg constructor. |
|
static void |
deserialize(org.apache.thrift.TDeserializer deserializer,
org.apache.thrift.TBase struct,
java.io.DataInput in)
|
|
static int |
encodedUTF8Length(java.lang.String st)
|
|
static java.util.List<java.lang.String> |
fromJsonList(java.lang.String json)
|
|
static java.util.Map<java.lang.String,java.lang.String> |
fromJsonMap(java.lang.String json)
|
|
static java.net.InetAddress |
getBroadcastAddress()
|
|
static java.net.InetAddress |
getLocalAddress()
Please use getBroadcastAddress instead. |
|
static java.lang.reflect.Field |
getProtectedField(java.lang.Class klass,
java.lang.String fieldName)
Used to get access to protected/private field of the specified class |
|
static java.lang.String |
getReleaseVersionString()
|
|
static byte[] |
hash(java.nio.ByteBuffer... data)
|
|
static java.math.BigInteger |
hashToBigInteger(java.nio.ByteBuffer data)
|
|
static java.lang.String |
json(java.lang.Object object)
|
|
static Pair<java.math.BigInteger,java.lang.Boolean> |
midpoint(java.math.BigInteger left,
java.math.BigInteger right,
int sigbits)
Given two bit arrays represented as BigIntegers, containing the given number of significant bits, calculate a midpoint. |
|
static IRowCacheProvider |
newCacheProvider(java.lang.String cache_provider)
|
|
static java.security.MessageDigest |
newMessageDigest(java.lang.String algorithm)
|
|
static IPartitioner |
newPartitioner(java.lang.String partitionerClassName)
|
|
static void |
renameWithConfirm(java.lang.String tmpFilename,
java.lang.String filename)
|
|
static java.lang.String |
resourceToFile(java.lang.String filename)
|
|
static
|
serialize(T object,
IVersionedSerializer<T> serializer,
int version)
|
|
static void |
serialize(org.apache.thrift.TSerializer serializer,
org.apache.thrift.TBase struct,
java.io.DataOutput out)
|
|
static
|
singleton(T column)
|
|
static void |
sortSampledKeys(java.util.List<DecoratedKey> keys,
Range<Token> range)
|
|
static java.security.MessageDigest |
threadLocalMD5Digest()
|
|
static java.util.Random |
threadLocalRandom()
|
|
static long |
timestampMicros()
|
|
static java.lang.String |
toString(java.util.Map<?,?> map)
|
|
static java.lang.RuntimeException |
unchecked(java.lang.Exception e)
|
|
static void |
waitOnFuture(java.util.concurrent.Future<?> future)
|
|
static void |
waitOnFutures(java.lang.Iterable<java.util.concurrent.Future<?>> futures)
|
|
static void |
waitOnFutures(java.util.List<CreationTimeAwareFuture<?>> hintFutures,
long timeout,
java.util.concurrent.TimeUnit timeUnit)
Waits for the futures to complete. |
|
static void |
waitOnFutures(java.util.List<IAsyncResult> results,
long ms)
|
|
static byte[] |
xor(byte[] left,
byte[] right)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.math.BigInteger TWO
public static final int MAX_UNSIGNED_SHORT
Constructor Detail |
---|
public FBUtilities()
Method Detail |
---|
public static java.security.MessageDigest threadLocalMD5Digest()
public static java.security.MessageDigest newMessageDigest(java.lang.String algorithm)
public static java.util.Random threadLocalRandom()
public static java.net.InetAddress getLocalAddress()
public static java.net.InetAddress getBroadcastAddress()
public static Pair<java.math.BigInteger,java.lang.Boolean> midpoint(java.math.BigInteger left, java.math.BigInteger right, int sigbits)
left
- The left point.right
- The right point.sigbits
- The number of bits in the points that are significant.
public static int compareUnsigned(byte[] bytes1, byte[] bytes2, int offset1, int offset2, int len1, int len2)
public static byte[] xor(byte[] left, byte[] right)
public static java.math.BigInteger hashToBigInteger(java.nio.ByteBuffer data)
public static byte[] hash(java.nio.ByteBuffer... data)
public static void renameWithConfirm(java.lang.String tmpFilename, java.lang.String filename) throws java.io.IOException
java.io.IOException
public static void serialize(org.apache.thrift.TSerializer serializer, org.apache.thrift.TBase struct, java.io.DataOutput out) throws java.io.IOException
java.io.IOException
public static void deserialize(org.apache.thrift.TDeserializer deserializer, org.apache.thrift.TBase struct, java.io.DataInput in) throws java.io.IOException
java.io.IOException
public static void sortSampledKeys(java.util.List<DecoratedKey> keys, Range<Token> range)
public static int encodedUTF8Length(java.lang.String st)
public static java.lang.String resourceToFile(java.lang.String filename) throws ConfigurationException
ConfigurationException
public static java.lang.String getReleaseVersionString()
public static long timestampMicros()
public static void waitOnFutures(java.lang.Iterable<java.util.concurrent.Future<?>> futures)
public static void waitOnFuture(java.util.concurrent.Future<?> future)
public static void waitOnFutures(java.util.List<IAsyncResult> results, long ms) throws java.util.concurrent.TimeoutException
java.util.concurrent.TimeoutException
public static void waitOnFutures(java.util.List<CreationTimeAwareFuture<?>> hintFutures, long timeout, java.util.concurrent.TimeUnit timeUnit) throws java.util.concurrent.TimeoutException
timeout
- the timeout expressed in TimeUnit
unitstimeUnit
- TimeUnit
java.util.concurrent.TimeoutException
- if the waiting time exceeds timeout
public static IPartitioner newPartitioner(java.lang.String partitionerClassName) throws ConfigurationException
ConfigurationException
public static <T> java.lang.Class<T> classForName(java.lang.String classname, java.lang.String readable) throws ConfigurationException
classname
- Fully qualified classname.readable
- Descriptive noun for the role the class plays.
ConfigurationException
- If the class cannot be found.public static <T> T construct(java.lang.String classname, java.lang.String readable) throws ConfigurationException
classname
- Fully qualified classname.readable
- Descriptive noun for the role the class plays.
ConfigurationException
- If the class cannot be found.public static <T extends java.lang.Comparable> java.util.SortedSet<T> singleton(T column)
public static java.lang.String toString(java.util.Map<?,?> map)
public static java.lang.reflect.Field getProtectedField(java.lang.Class klass, java.lang.String fieldName)
klass
- - name of the classfieldName
- - name of the field
public static IRowCacheProvider newCacheProvider(java.lang.String cache_provider) throws ConfigurationException
ConfigurationException
public static <T> CloseableIterator<T> closeableIterator(java.util.Iterator<T> iterator)
public static java.util.Map<java.lang.String,java.lang.String> fromJsonMap(java.lang.String json)
public static java.util.List<java.lang.String> fromJsonList(java.lang.String json)
public static java.lang.String json(java.lang.Object object)
public static <T> byte[] serialize(T object, IVersionedSerializer<T> serializer, int version) throws java.io.IOException
java.io.IOException
public static java.lang.RuntimeException unchecked(java.lang.Exception e)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |