コード例 #1
0
        public void CreateClientWithEmptyOptions()
        {
            GoogleCredential credential = GoogleCredential.GetApplicationDefault();

            invoker = new GcpCallInvoker(Target, credential.ToChannelCredentials());
            client  = new Bigtable.BigtableClient(invoker);

            MutateRowRequest mutateRowRequest = new MutateRowRequest
            {
                TableName = TableName,
                RowKey    = ByteString.CopyFromUtf8(RowKey)
            };

            Mutation mutation = new Mutation
            {
                SetCell = new Mutation.Types.SetCell
                {
                    FamilyName      = ColumnFamily,
                    ColumnQualifier = ByteString.CopyFromUtf8(ColumnQualifier),
                    Value           = ByteString.CopyFromUtf8(TestValue),
                }
            };

            mutateRowRequest.Mutations.Add(mutation);

            client.MutateRow(mutateRowRequest);
            Assert.AreEqual(1, invoker.GetChannelRefsForTest().Count);
        }
コード例 #2
0
        private void PrepareTestData()
        {
            MutateRowRequest mutateRowRequest = new MutateRowRequest
            {
                TableName = TableName,
                RowKey    = ByteString.CopyFromUtf8(LargeRowKey)
            };

            string largeValue = new string('x', PayloadBytes);

            Mutation mutation = new Mutation
            {
                SetCell = new Mutation.Types.SetCell
                {
                    FamilyName      = ColumnFamily,
                    ColumnQualifier = ByteString.CopyFromUtf8(ColumnQualifier),
                    Value           = ByteString.CopyFromUtf8(largeValue),
                }
            };

            mutateRowRequest.Mutations.Add(mutation);
            client.MutateRow(mutateRowRequest);
        }
コード例 #3
0
        public void MutateRow()
        {
            MutateRowRequest mutateRowRequest = new MutateRowRequest
            {
                TableName = TableName,
                RowKey    = ByteString.CopyFromUtf8(RowKey)
            };

            Mutation mutation = new Mutation
            {
                SetCell = new Mutation.Types.SetCell
                {
                    FamilyName      = ColumnFamily,
                    ColumnQualifier = ByteString.CopyFromUtf8(ColumnQualifier),
                    Value           = ByteString.CopyFromUtf8(TestValue),
                }
            };

            mutateRowRequest.Mutations.Add(mutation);

            client.MutateRow(mutateRowRequest);
            Assert.AreEqual(1, invoker.GetChannelRefsForTest().Count);
        }