This project is read-only.

TimeGenerator Class Usage

Cassandraemon.TimeGenerator class is able to generate UnixTime(milliseconds) and TimeUUID and sensitive ticks. Most OS clock is millisecnod level precision. But it rise chaos. If you get some TimeUUID for TimeUUIDType column, you may get duplicative TimeUUID. So, TimeGenerator has offset for ticks. If you call several times TimeGenerator.GetSensitiveTicks() method while one millisecond, the method return different ticks. And TimeGenerator.GetTimeUUID() method call TimeGenerator.GetSensitiveTicks() internally.
UnixTime is used to Column.Timestamp. But if you don't set timestamp at registration, timestamp is set automatically.

TimeGenerator Methods
  • GetUnixTime ()
  • GetTimeUUID ()
  • GetTimeUUID (DateTime datetime)
  • GetTimeUUID (long ticks)
  • GetDateTime (Guid timeUUID)
  • GetDateTime (Guid timeUUID, DateTimeKind kind)
  • GetDateTimeUtc (Guid timeUUID)
  • GetDateTimeLocal (Guid timeUUID)
  • GetSensitiveTicks ()

BigEndianBitConverter Class Usage

Cassandraemon convert numeric type to byte array in various scene. Then converter use big endian format becouse of interoperability with java. Otherwise LongType column is not sorted. Usually, you don't have to think it. Because Object.ToCassandraByte method and Byte[].ToInt32 method and so on use big endian format automatically. Only if you get raw byte[] from cassandra and convert yourself, you can use BigEndianBitConverter.

BigEndianBitConverter Methods
  • GetBytes (bool value)
  • GetBytes (char value)
  • GetBytes (short value)
  • GetBytes (int value)
  • GetBytes (long value)
  • GetBytes (ushort value)
  • GetBytes (uint value)
  • GetBytes (ulong value)
  • GetBytes (float value)
  • GetBytes (double value)
  • ToBoolean (byte[] value, int startIndex)
  • ToChar (byte[] value, int startIndex)
  • ToInt16 (byte[] value, int startIndex)
  • ToInt32 (byte[] value, int startIndex)
  • ToInt64 (byte[] value, int startIndex)
  • ToUInt16 (byte[] value, int startIndex)
  • ToUInt32 (byte[] value, int startIndex)
  • ToUInt64 (byte[] value, int startIndex)
  • ToSingle (byte[] value, int startIndex)
  • ToDouble (byte[] value, int startIndex)
  • ToString (byte[] value)
  • ToString (byte[] value, int startIndex)
  • ToString (byte[] value, int startIndex, int length)
  • ToBoolean (byte[] value, int startIndex)

Last edited Mar 22, 2011 at 3:31 AM by sabro, version 1


No comments yet.