Package com.google.cloud.bigtable.data.v2.models (2.28.0)

Classes

BulkMutation

Represents a list of mutations for multiple rows. Each mutation contains multiple changes that will be atomically applied to each row. However, ordering between rows is not guaranteed.

This class is meant for manual batching.

ChangeStreamContinuationToken

A simple wrapper for StreamContinuationToken.

ChangeStreamMutation

A ChangeStreamMutation represents a list of mods(represented by List<Entry>) targeted at a single row, which is concatenated by ChangeStreamRecordMerger. It represents a logical row mutation and can be converted to the original write request(i.e. RowMutation or RowMutationEntry.

A ChangeStreamMutation can be constructed in two ways, depending on whether it's a user initiated mutation or a Garbage Collection mutation. Either way, the caller should explicitly set token and estimatedLowWatermark before build(), otherwise it'll raise an error.

Case 1) User initiated mutation.


 ChangeStreamMutation.Builder builder = ChangeStreamMutation.createUserMutation(...);
 builder.setCell(...);
 builder.deleteFamily(...);
 builder.deleteCells(...);
 ChangeStreamMutation changeStreamMutation = builder.setToken(...).setEstimatedLowWatermark().build();
 

Case 2) Garbage Collection mutation.


 ChangeStreamMutation.Builder builder = ChangeStreamMutation.createGcMutation(...);
 builder.setCell(...);
 builder.deleteFamily(...);
 builder.deleteCells(...);
 ChangeStreamMutation changeStreamMutation = builder.setToken(...).setEstimatedLowWatermark().build();
 

CloseStream

A simple wrapper for ReadChangeStreamResponse.CloseStream. This message is received when the stream reading is finished(i.e. read past the stream end time), or an error has occurred.

ConditionalRowMutation

Mutates a row atomically based on the output of a condition filter.

DefaultChangeStreamRecordAdapter

Default implementation of a ChangeStreamRecordAdapter that uses ChangeStreamRecords to represent change stream records.

DefaultRowAdapter

Default implementation of a RowAdapter that uses Rows to represent logical rows.

DefaultRowAdapter.DefaultRowBuilder

Internal implementation detail for DefaultRowAdapter.

DeleteCells

Representation of a DeleteCells mod in a data change.

DeleteFamily

Representation of a DeleteFamily mod in a data change.

Filters

A Fluent DSL to create a hierarchy of filters for the CheckAndMutateRow RPCs and ReadRows Query.

Intended usage is to statically import, or in case of conflict, assign the static variable FILTERS and use its fluent API to build filters.

Sample code:


 import static com.google.cloud.bigtable.data.v2.models.Filters.FILTERS;

 void main() {
   // Build the filter expression
   RowFilter filter = FILTERS.chain()
     .filter(FILTERS.qualifier().regex("prefix.*"))
     .filter(FILTERS.limit().cellsPerRow(10));

   // Use it in a Query
   Query query = Query.create("[TABLE]")
     .filter(filter);
 }

 

Filters.ChainFilter

DSL for adding filters to a chain.

Filters.ConditionFilter

DSL for configuring a conditional filter.

Filters.FamilyFilter

Filters.InterleaveFilter

DSL for adding filters to the interleave list.

Filters.KeyFilter

Filters.LimitFilter

Filters.OffsetFilter

Filters.QualifierFilter

Filters.QualifierRangeFilter

Matches only cells from columns within the given range.

Filters.TimestampFilter

Filters.TimestampRangeFilter

Matches only cells with microsecond timestamps within the given range.

Filters.ValueFilter

Filters.ValueRangeFilter

Matches only cells with values that fall within the given value range.

Heartbeat

A simple wrapper for ReadChangeStreamResponse.Heartbeat.

KeyOffset

Represents the offset of a row key in a table.

MutateRowsException.FailedMutation

Identifies which mutation failed and the reason it failed. The mutation is identified by it's index in the original request's MutateRowsRequest#getEntriesList().

Mutation

The concrete implementation of MutationApi that can be used to create and represent a list of mutations. It used by RowMutation and ConditionalRowMutation to encapsulate a list of mutations that will to be applied to a single row.

Query

A simple wrapper to construct a query for the ReadRows RPC.

Query.QueryPaginator

A Query Paginator that will split a query into small chunks. See Query#createPaginator(int) for example usage.

Range<T,R>

Range API.

This base class represents the API for all ranges in the Cloud Bigtable client. Please note this mutable type. It's intended to support fluent DSLs.For example:


 // A Range that encloses all strings
 ByteStringRange.unbounded();

 // Range that includes all strings including "begin" up until "end"
 ByteStringRange.unbounded().of("start", "end");

 // Create a Bytestring range with an unbounded start and the inclusive end "end"
 ByteStringRange.unbounded().endClosed("end");

 // Ranges are mutable, so take care to clone them to get a new instance
 ByteStringRange r1 = ByteStringRange.of("a", "z");
 ByteStringRange r2 = r1.clone().endUnbounded();
 

Range.ByteStringRange

Concrete Range for ByteStrings

Range.TimestampRange

Concrete Range for timestamps

ReadChangeStreamQuery

A simple wrapper to construct a query for the ReadChangeStream RPC.

ReadModifyWriteRow

Wraps a ReadModifyWriteRowRequest.

Row

Default representation of a logical row.

The cells contained within, will be sorted by the native order. Please see RowCell#compareByNative() for details.

RowCell

Default representation of a cell in a Row.

RowMutation

Represents a list of mutations targeted at a single row. It's meant to be used as an parameter for com.google.cloud.bigtable.data.v2.BigtableDataClient#mutateRowAsync(RowMutation).

RowMutationEntry

Represents a list of mutations targeted at a single row. It is meant to be used as an parameter for com.google.cloud.bigtable.data.v2.BigtableDataClient#newBulkMutationBatcher(String).

Note: The changes in the mutation will be applied atomically but the ordering between different RowMutationEntry instances is not guaranteed.

SetCell

Representation of a SetCell mod in a data change, whose value is concatenated by ChangeStreamRecordMerger in case of SetCell value chunking.

Interfaces

ChangeStreamRecord

Default representation of a change stream record, which can be a Heartbeat, a CloseStream, or a logical mutation.

ChangeStreamRecordAdapter<ChangeStreamRecordT>

An extension point that allows end users to plug in a custom implementation of logical change stream records. This is useful in cases where the user would like to apply advanced client side filtering(for example, only keep DeleteFamily in the mutations). This adapter acts like a factory for a SAX style change stream record builder.

ChangeStreamRecordAdapter.ChangeStreamRecordBuilder<ChangeStreamRecordT>

A SAX style change stream record factory. It is responsible for creating one of the three types of change stream record: heartbeat, close stream, and a change stream mutation.

State management is handled external to the implementation of this class:

    Case 1: Heartbeat
  1. Exactly 1 onHeartbeat.
    Case 2: CloseStream
  1. Exactly 1 onCloseStream.
    Case 3: ChangeStreamMutation. A change stream mutation consists of one or more mods, where the SetCells might be chunked. There are 3 different types of mods that a ReadChangeStream response can have:
  1. DeleteFamily -> Exactly 1 deleteFamily
  2. DeleteCell -> Exactly 1 deleteCell
  3. SetCell -> Exactly 1 startCell, At least 1 CellValue, Exactly 1 finishCell.

The whole flow of constructing a ChangeStreamMutation is:

  1. Exactly 1 startUserMutation or startGcMutation.
  2. At least 1 DeleteFamily/DeleteCell/SetCell mods.
  3. Exactly 1 finishChangeStreamMutation.

Note: For a non-chunked SetCell, only 1 CellValue will be called. For a chunked SetCell, more than 1 CellValues will be called.

Note: DeleteRow's won't appear in data changes since they'll be converted to multiple DeleteFamily's.

Entry

Default representation of a mod in a data change, which can be a DeleteFamily, a DeleteCells, or a SetCell This class will be used by ChangeStreamMutation to represent a list of mods in a logical change stream mutation.

Filters.Filter

MutationApi<T>

The API for creating mutations for a single row.

RowAdapter<RowT>

An extension point that allows end users to plug in a custom implementation of logical rows. This useful in cases where the user would like to apply advanced client side filtering of cells. This adapter acts like a factory for a SAX style row builder.

RowAdapter.RowBuilder<RowT>

A SAX style row factory. It is responsible for creating two types of rows: standard data rows and special marker rows. Marker rows are emitted when skipping lots of rows due to filters. The server notifies the client of the last row it skipped to help client resume in case of error.

State management is handled external to the implementation of this class and guarantees the following order:

  1. Exactly 1 startRow for each row.
  2. Exactly 1 startCell for each cell.
  3. At least 1 cellValue for each cell.
  4. Exactly 1 finishCell for each cell.
  5. Exactly 1 finishRow for each row.

createScanMarkerRow can be called one or more times between finishRow and startRow. reset can be called at any point and can be invoked multiple times in a row.

Enums

ChangeStreamMutation.MutationType

Range.BoundType

Exceptions

MutateRowsException

Thrown by the MutateRows when at least one Mutation failed. If the last failure was caused by an RPC error (as opposed to a single entry failing), then this exception's cause will be set to that error and #getFailedMutations() will contain synthetic errors for all of the entries that were part of that RPC.