Пример #1
0
        public static Guid GenerateTimeBasedGuid()
        {
            switch (GuidGeneration)
            {
            case GuidGeneration.Fast:
                return(GenerateTimeBasedGuid(TimestampHelper.UtcNow(), ClockSequenceBytes, NodeBytes));

            case GuidGeneration.NoDuplicates:
            default:
                lock (Lock)
                {
                    var ts = TimestampHelper.UtcNow();

                    if (ts <= _lastTimestampForNoDuplicatesGeneration)
                    {
                        ClockSequenceBytes = GenerateClockSequenceBytes();
                    }

                    _lastTimestampForNoDuplicatesGeneration = ts;

                    return(GenerateTimeBasedGuid(ts, ClockSequenceBytes, NodeBytes));
                }
            }
        }
 /// <summary>
 ///
 /// </summary>
 internal FluentMutation()
 {
     ColumnTimestamp = TimestampHelper.UtcNow();
 }
 public static void InsertColumn(this CassandraColumnFamily family, CassandraObject key, CassandraObject columnName, BytesType columnValue)
 {
     InsertColumn(family, key, columnName, columnValue, TimestampHelper.UtcNow(), null);
 }
Пример #4
0
 public static void InsertColumn(this CassandraSuperColumnFamily family, CassandraObject key, CassandraObject superColumnName, CassandraObject name, BytesType value)
 {
     InsertColumn(family, key, superColumnName, name, value, TimestampHelper.UtcNow(), null);
 }