WhileMatchFilterAdapter (Cloud Bigtable HBase Client for Java 1.12.0 API)


Class WhileMatchFilterAdapter

    • Constructor Detail

      • WhileMatchFilterAdapter

        public WhileMatchFilterAdapter(FilterAdapter subFilterAdapter)
        Constructor for WhileMatchFilterAdapter.
        subFilterAdapter - a FilterAdapter object.
    • Method Detail

      • adapt

        public com.google.cloud.bigtable.data.v2.models.Filters.Filter adapt(FilterAdapterContext context,
                                                                             WhileMatchFilter filter)
                                                                      throws IOException
        Adapt the given filter. Implementers of this method should assume that isFilterSupported has already been called with a result indicating it is in fact supproted.

        Adapt WhileMatchFilter as follow:

        | V +--------+--------+ | | | | label('id-in') wrappedFilter.filter() | | | | sink() +-----+-----+ + | | label('id-out') all() | | sink() | + v

        The above implementation gives enough information from the server side to determine whether the remaining rows should be filtered out. For each WhileMatchFilter instance, an unique ID is generated for labeling. The input label is the unique ID suffixed by "-in" and the output label is the unique ID suffixed by "-out". When wrappedFilter decides to filter out the rest of rows, there is no out label ("id-out") applied in the output. In other words, when there is a missing "id-out" for an input "id-in", WhileMatchFilter.filterAllRemaining() returns true. Since the server continues to send result even though WhileMatchFilter.filterAllRemaining() returns true, we need to replace this WhileMatchFilter instance with a "block all" filter and rescan from the next row.

        context - a FilterAdapterContext object.
        filter - a S object.
        a Filters.Filter object.
        IOException - if any.