コード例 #1
0
 protected DbBase(
     Container container,
     DbSerializerBase serializer,
     bool isReadOnly,
     bool validateStateBeforeSave)
 {
     Container  = container ?? throw new ArgumentNullException(nameof(container));
     Serializer = serializer ?? throw new ArgumentNullException(nameof(serializer));
     IsReadOnly = isReadOnly;
     ValidateStateBeforeSave = validateStateBeforeSave;
 }
コード例 #2
0
    protected DbPartitionBase(DbBase db, string partitionKey, DbSerializerBase serializer)
    {
        if (string.IsNullOrEmpty(partitionKey))
        {
            throw new ArgumentNullException(nameof(partitionKey));
        }

        DB = db ?? throw new ArgumentNullException(nameof(db));
        PartitionKeyString = partitionKey;
        Serializer         = serializer ?? throw new ArgumentNullException(nameof(serializer));
        PartitionKey       = new PartitionKey(partitionKey);
    }
コード例 #3
0
    protected ChangeFeedProcessorBase(
        BatchProcessor batchProcessor,
        DbSerializerBase serializer,
        Container databaseContainer,
        Container leaseContainer,
        string processorName,
        int maxItemsPerBatch  = DefaultMaxItemsPerBatch,
        TimeSpan?pollInterval = null,
        DateTime?startTime    = null)
    {
        if (string.IsNullOrWhiteSpace(processorName))
        {
            throw new ArgumentNullException(nameof(processorName));
        }

        if (maxItemsPerBatch < 1)
        {
            throw new ArgumentOutOfRangeException(nameof(maxItemsPerBatch));
        }
        if (maxItemsPerBatch > MaxMaxItemsPerBatch)
        {
            maxItemsPerBatch = MaxMaxItemsPerBatch;
        }
        MaxItemsPerBatch = maxItemsPerBatch;
        Serializer       = serializer ?? throw new ArgumentNullException(nameof(serializer));

        PollInterval = pollInterval ?? DefaultPollInterval;
        if (PollInterval < TimeSpan.Zero)
        {
            throw new ArgumentOutOfRangeException(nameof(pollInterval));
        }
        if (PollInterval < MinPollInterval)
        {
            PollInterval = MinPollInterval;
        }
        else if (PollInterval > MaxPollInterval)
        {
            PollInterval = MaxPollInterval;
        }
        StartTime         = startTime ?? IsoDateCheater.MinValue;
        BatchProcessor    = batchProcessor ?? throw new ArgumentNullException(nameof(batchProcessor));
        ProcessorName     = processorName;
        DatabaseContainer = databaseContainer ?? throw new ArgumentNullException(nameof(databaseContainer));
        LeaseContainer    = leaseContainer ?? throw new ArgumentNullException(nameof(leaseContainer));
    }
コード例 #4
0
 public ReadByIdsAsyncDb(Container container, DbSerializerBase serializer, bool isReadOnly, bool validateStateBeforeSave) : base(container, serializer, isReadOnly, validateStateBeforeSave)
 {
 }
コード例 #5
0
 public TestChangeFeed(DbSerializerBase serializer, Container databaseContainer, Container leaseContainer, string processorName, int maxItemsPerBatch, TimeSpan?pollInterval, DateTime?startTime, BatchProcessor batchProcessor) : base(batchProcessor, serializer, databaseContainer, leaseContainer, processorName, maxItemsPerBatch, pollInterval, startTime)
 {
 }
コード例 #6
0
 public TestBatch(DbSerializerBase serializer, TransactionalBatch transactionalBatch, string partitionKey) : base(serializer, transactionalBatch, partitionKey, true)
 {
 }
コード例 #7
0
 public TestPartition(DbBase db, string partitionKey, DbSerializerBase serializer) : base(db, partitionKey, serializer)
 {
 }