public long Boundary_test(long value, long index, long count)
        {
            var longArray = Enumerable.Range(0, 100)
                            .Select(i => (long)i * 10).ToArray();

            var col = MockFixedCol(longArray);

            return(ColumnValueBinarySearch.LongBinarySerach(
                       col, value, index, count));
        }
예제 #2
0
        public long BinarySearchTimestamp(DateTime value, IReadTransactionContext tx)
        {
            if (!_isStorageInitialized)
            {
                InitializeStorage();
            }

            if (_timestampColumn == null)
            {
                throw new NFSdbConfigurationException("timestampColumn is not configured for journal in "
                                                      + DirectoryPath);
            }

            var  hi            = tx.GetRowCount(PartitionID);
            var  timestampType = _timestampColumn.FieldType;
            long values        = timestampType == EFieldType.Int64 ||
                                 timestampType == EFieldType.DateTimeEpochMs
                ? DateUtils.DateTimeToUnixTimeStamp(value)
                : DateUtils.ToUnspecifiedDateTicks(value);

            return(ColumnValueBinarySearch.LongBinarySerach(_timestampColumn, values, 0L, hi));
        }