Exemple #1
0
 public static async Task HasNoValuesAsync(
     BigtableClient client,
     TableName tableName,
     BigtableByteString rowKey)
 {
     Assert.Null(await client.ReadRowAsync(tableName, rowKey));
 }
Exemple #2
0
        public static async Task HasNoValuesAsync(
            BigtableClient client,
            TableName tableName,
            BigtableByteString rowKey,
            string familyName = null)
        {
            var filter = familyName == null
                ? RowFilters.PassAllFilter()
                : RowFilters.FamilyNameExact(familyName);

            Assert.Null(await client.ReadRowAsync(tableName, rowKey, filter));
        }
Exemple #3
0
        public static async Task HasSingleValueAsync(
            BigtableClient client,
            TableName tableName,
            BigtableByteString rowKey,
            string familyName,
            BigtableByteString columnQualifier,
            BigtableByteString value,
            BigtableVersion?version = null)
        {
            var row = await client.ReadRowAsync(tableName, rowKey);

            Assert.Equal(rowKey.Value, row.Key);

            HasSingleValue(row, familyName, columnQualifier, value, version);
        }
Exemple #4
0
        private static async Task <bool> HasValueHelperAsync(
            BigtableClient client,
            TableName tableName,
            BigtableByteString rowKey,
            string familyName,
            BigtableByteString columnQualifier,
            BigtableByteString value,
            BigtableVersion?version)
        {
            var row = await client.ReadRowAsync(tableName, rowKey);

            Assert.Equal(rowKey.Value, row.Key);

            var cells = row
                        .Families.SingleOrDefault(f => f.Name == familyName)
                        ?.Columns.SingleOrDefault(c => c.Qualifier == columnQualifier)
                        ?.Cells;
            var cell = version != null
                ? cells?.SingleOrDefault(c => c.TimestampMicros == version.Value.Micros)
                : cells?.SingleOrDefault();

            return(cell != null && cell.Value == value);
        }