コード例 #1
0
        public async Task InserStreamReaderPropertiesAsync(string streamName, EventStreamReaderId readerId, StreamVersion version)
        {
            var operation = m_table.PrepareBatchOperation();

            operation.Insert(
                streamName,
                "RDR|" + readerId,
                EventJournalTableRowPropertyNames.Version,
                (int)version);

            await operation.ExecuteAsync();
        }
コード例 #2
0
        public Task AddAsync(string streamName, StreamVersion streamVersion, int eventCount)
        {
            Require.NotEmpty(streamName, "streamName");
            Require.Positive(eventCount, "eventCount");

            var operation = m_table.PrepareBatchOperation();
            var toVersion = streamVersion.Increment(eventCount);

            operation.InsertOrReplace(
                partitionKey: GetPartitionKey(streamName),
                rowKey: GetRowKey(streamName, streamVersion),
                propertyName: "ToVersion",
                propertyValue: (int)toVersion);

            return(operation.ExecuteAsync());
        }
コード例 #3
0
        private static async Task InsertValues(ICloudTable table, string partition)
        {
            foreach (var i in Enumerable.Range(1, 20))
            {
                var operation = table.PrepareBatchOperation();

                foreach (var j in Enumerable.Range(1, 100))
                {
                    operation.Insert(partition, i + ":" + j, EmptyDictionary.Get<string, object>());
                }

                await operation.ExecuteAsync();
            }
        }
コード例 #4
0
        private static async Task <int> InsertValues(ICloudTable table, string partition, int x = 20, int y = 100)
        {
            foreach (var i in Enumerable.Range(1, x))
            {
                var operation = table.PrepareBatchOperation();

                foreach (var j in Enumerable.Range(1, y))
                {
                    operation.Insert(partition, i + ":" + j, EmptyDictionary.Get <string, object>());
                }

                await operation.ExecuteAsync();
            }

            return(x * y);
        }
コード例 #5
0
        private async Task InsertConsumerId(string consumerName, EventStreamReaderId consumerId)
        {
            var operation = m_consumerMetadataTable.PrepareBatchOperation();

            operation.Insert(
                partitionKey: Constants.StorageEntities.MetadataTable.EVENT_STREAM_CONSUMERS_IDS_PK,
                rowKey: consumerName,
                properties: new Dictionary <string, object>
            {
                { Constants.StorageEntities.MetadataTableProperties.EVENT_STREAM_READER_ID, consumerId.ToString() }
            });

            operation.Insert(
                partitionKey: Constants.StorageEntities.MetadataTable.EVENT_STREAM_CONSUMERS_IDS_PK,
                rowKey: consumerId.ToString(),
                properties: new Dictionary <string, object>
            {
                {
                    Constants.StorageEntities.MetadataTableProperties.EVENT_STREAM_CONSUMER_NAME, consumerName
                }
            });

            await operation.ExecuteAsync();
        }
コード例 #6
0
 protected void PrepareBatchOperation()
 {
     m_operation = m_table.PrepareBatchOperation();
 }