Class RowMutation

    • Method Detail

      • create

        public static RowMutation create​(@Nonnull
                                         String tableId,
                                         @Nonnull
                                         com.google.protobuf.ByteString key)
        Creates a new instance of the mutation builder.
      • create

        public static RowMutation create​(@Nonnull
                                         String tableId,
                                         @Nonnull
                                         String key,
                                         @Nonnull
                                         Mutation mutation)
        Creates new instance of mutation builder by wrapping existing set of row mutations. The builder will be owned by this RowMutation and should not be used by the caller after this call. This functionality is intended for advanced usage.

        Sample code:

        
         Mutation mutation = Mutation.create()
             .setCell("[FAMILY_NAME]", "[QUALIFIER]", [TIMESTAMP], "[VALUE]");
         RowMutation rowMutation = RowMutation.create("[TABLE]", "[ROW_KEY]", mutation);
         
      • create

        public static RowMutation create​(@Nonnull
                                         String tableId,
                                         @Nonnull
                                         com.google.protobuf.ByteString key,
                                         @Nonnull
                                         Mutation mutation)
        Creates new instance of mutation builder by wrapping existing set of row mutations. The builder will be owned by this RowMutation and should not be used by the caller after this call. This functionality is intended for advanced usage.

        Sample code:

        
         Mutation mutation = Mutation.create()
             .setCell("[FAMILY_NAME]", "[QUALIFIER]", [TIMESTAMP], "[VALUE]");
         RowMutation rowMutation = RowMutation.create("[TABLE]", [BYTE_STRING_ROW_KEY], mutation);
         
      • setCell

        public RowMutation setCell​(@Nonnull
                                   String familyName,
                                   @Nonnull
                                   String qualifier,
                                   long timestamp,
                                   @Nonnull
                                   String value)
        Description copied from interface: MutationApi
        Adds a mutation which sets the value of the specified cell.

        This is a convenience override that converts Strings to ByteStrings.

        Note: The timestamp values are in microseconds but must match the granularity of the table(defaults to `MILLIS`). Therefore, the given value must be a multiple of 1000 (millisecond granularity). For example: `1571902339435000`.

        Specified by:
        setCell in interface MutationApi<RowMutation>
      • setCell

        public RowMutation setCell​(@Nonnull
                                   String familyName,
                                   @Nonnull
                                   com.google.protobuf.ByteString qualifier,
                                   long timestamp,
                                   @Nonnull
                                   com.google.protobuf.ByteString value)
        Description copied from interface: MutationApi
        Adds a mutation which sets the value of the specified cell.

        Note: The timestamp values are in microseconds but must match the granularity of the table(defaults to `MILLIS`). Therefore, the given value must be a multiple of 1000 (millisecond granularity). For example: `1571902339435000`.

        Specified by:
        setCell in interface MutationApi<RowMutation>
      • setCell

        public RowMutation setCell​(@Nonnull
                                   String familyName,
                                   @Nonnull
                                   String qualifier,
                                   long value)
        Description copied from interface: MutationApi
        Adds a mutation which sets the value of the specified cell.

        This a convenience method that converts Strings to ByteStrings and uses microseconds since epoch as the timestamp. Also it accepts long value.

        Specified by:
        setCell in interface MutationApi<RowMutation>
      • setCell

        public RowMutation setCell​(@Nonnull
                                   String familyName,
                                   @Nonnull
                                   String qualifier,
                                   long timestamp,
                                   long value)
        Description copied from interface: MutationApi
        Adds a mutation which sets the value of the specified cell.

        This is a convenience override that converts Strings to ByteStrings.

        Note: The timestamp values are in microseconds but must match the granularity of the table(defaults to `MILLIS`). Therefore, the given value must be a multiple of 1000 (millisecond granularity). For example: `1571902339435000`.

        Specified by:
        setCell in interface MutationApi<RowMutation>
      • setCell

        public RowMutation setCell​(@Nonnull
                                   String familyName,
                                   @Nonnull
                                   com.google.protobuf.ByteString qualifier,
                                   long timestamp,
                                   long value)
        Description copied from interface: MutationApi
        Adds a mutation which sets the value of the specified cell.

        Note: The timestamp values are in microseconds but must match the granularity of the table(defaults to `MILLIS`). Therefore, the given value must be a multiple of 1000 (millisecond granularity). For example: `1571902339435000`.

        Specified by:
        setCell in interface MutationApi<RowMutation>
      • toProto

        @InternalApi
        public MutateRowRequest toProto​(com.google.cloud.bigtable.data.v2.internal.RequestContext requestContext)
      • toBulkProto

        @InternalApi
        public MutateRowsRequest toBulkProto​(com.google.cloud.bigtable.data.v2.internal.RequestContext requestContext)
        Creates a single entry bulk MutateRowsRequest, which will be merged by the batching logic in the callable chain.
      • fromProto

        @BetaApi
        public static RowMutation fromProto​(@Nonnull
                                            MutateRowRequest request)
        Wraps the protobuf MutateRowRequest.

        This is meant for advanced usage only. Please ensure that the MutateRowRequest does not use server side timestamps. The BigtableDataClient assumes that RowMutations are idempotent and is configured to enable retries by default. If serverside timestamps are enabled, this can lead to duplicate mutations.

        WARNING: when applied, the resulting mutation object will ignore the project id and instance id in the table_name and instead apply the configuration in the client.