static private async void ProduceTest(ShardedDatasetClient client) { Expression <Func <int, IntKeyedDataset <int, int> > > sharder = x => new IntKeyedDataset <int, int>(x); var shardedIntKeyedDS = client.CreateShardedDataset <int, int, IntKeyedDataset <int, int> >(sharder); var deployedDS = await shardedIntKeyedDS.Deploy(); await deployedDS.Subscribe(() => new WriteToConsoleObserver <int, int>()); }
static private async void TransformTest1(ShardedDatasetClient client) { Expression <Func <int, IntKeyedDataset <int, int> > > sharder = x => new IntKeyedDataset <int, int>(x); var shardedIntKeyedDS = client.CreateShardedDataset <int, int, IntKeyedDataset <int, int> >(sharder); var deployedDS = await shardedIntKeyedDS.Transform <int, int, IntKeyedDataset <int, int> >(a => a.ShiftUp(1)) .Deploy(); await deployedDS.Subscribe(() => new WriteToConsoleObserver <int, int>()); }
static private async void TransformTest2(ShardedDatasetClient client) { Expression <Func <int, IntKeyedDataset <int, int> > > sharder = x => new IntKeyedDataset <int, int>(x); var shardedIntKeyedDS = client.CreateShardedDataset <int, int, IntKeyedDataset <int, int> >(sharder); var shardedIntKeyedDS1 = client.CreateShardedDataset <int, int, IntKeyedDataset <int, int> >(sharder) .Transform <int, int, IntKeyedDataset <int, int> >(a => a.ShiftUp(1)); var shardedIntKeyedDS2 = client.CreateShardedDataset <int, int, IntKeyedDataset <int, int> >(sharder) .Transform <int, int, IntKeyedDataset <int, int> >(a => a.ShiftUp(1)); var deployedDS = await shardedIntKeyedDS.Transform <int, int, IntKeyedDataset <int, int> >(a => a.ShiftUp(1)) .Transform <int, int, IntKeyedDataset <int, int>, int, int, IntKeyedDataset <int, int> >(shardedIntKeyedDS1, (a, b) => a.BinaryShiftUp(b, 1)) .Move <int, int, IntKeyedDataset <int, int>, int, int, IntKeyedDataset <int, int> >( (s, d) => s.Splitter(d), (m, d) => m.Merger(d), MoveDescriptor.MoveBase()) .Transform <int, int, IntKeyedDataset <int, int> >(a => a.ShiftUp(1)) .Transform <int, int, IntKeyedDataset <int, int>, int, int, IntKeyedDataset <int, int> >(shardedIntKeyedDS2, (a, b) => a.BinaryShiftUp(b, 1)) .Deploy(); await deployedDS.Subscribe(() => new WriteToConsoleObserver <int, int>()); }