From dev-return-1996-archive-asf-public=cust-asf.ponee.io@tephra.incubator.apache.org Tue Feb 20 01:32:05 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 42C60180607 for ; Tue, 20 Feb 2018 01:32:05 +0100 (CET) Received: (qmail 83632 invoked by uid 500); 20 Feb 2018 00:32:04 -0000 Mailing-List: contact dev-help@tephra.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tephra.incubator.apache.org Delivered-To: mailing list dev@tephra.incubator.apache.org Received: (qmail 83621 invoked by uid 99); 20 Feb 2018 00:32:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Feb 2018 00:32:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id E34EEC0042 for ; Tue, 20 Feb 2018 00:32:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.311 X-Spam-Level: X-Spam-Status: No, score=-110.311 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id iUsYhk-eSa4Q for ; Tue, 20 Feb 2018 00:32:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id E3C9F5F3CC for ; Tue, 20 Feb 2018 00:32:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id A0EE1E01A8 for ; Tue, 20 Feb 2018 00:32:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 1EB2821E5A for ; Tue, 20 Feb 2018 00:32:00 +0000 (UTC) Date: Tue, 20 Feb 2018 00:32:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@tephra.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (TEPHRA-272) Add HBase 2.0 compatibility module MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/TEPHRA-272?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1636= 9614#comment-16369614 ]=20 ASF GitHub Bot commented on TEPHRA-272: --------------------------------------- Github user poornachandra commented on a diff in the pull request: https://github.com/apache/incubator-tephra/pull/67#discussion_r16919501= 0 =20 --- Diff: tephra-hbase-compat-2.0/src/main/java/org/apache/tephra/hbase= /coprocessor/FilteredInternalScanner.java --- @@ -0,0 +1,80 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or imp= lied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.tephra.hbase.coprocessor; + +import org.apache.hadoop.hbase.Cell; +import org.apache.hadoop.hbase.filter.Filter; +import org.apache.hadoop.hbase.filter.Filter.ReturnCode; +import org.apache.hadoop.hbase.regionserver.InternalScanner; +import org.apache.hadoop.hbase.regionserver.ScannerContext; +import org.apache.tephra.hbase.coprocessor.TransactionProcessor.Includ= eInProgressFilter; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * Wrapper of InternalScanner to apply Transaction visibility filter f= or flush and compact + */ +public class FilteredInternalScanner implements InternalScanner { + + private InternalScanner delegate; + private Filter filter; + + public FilteredInternalScanner(InternalScanner internalScanner, Incl= udeInProgressFilter filter) { + this.delegate =3D internalScanner; + this.filter =3D filter; + } + + @Override + public void close() throws IOException { + this.delegate.close(); + } + + @Override + public boolean next(List result, ScannerContext scannerContext= ) throws IOException { + List outResult =3D new ArrayList(); + while (true) { + boolean next =3D delegate.next(outResult, scannerContext); + for (Cell cell : outResult) { + ReturnCode code =3D filter.filterKeyValue(cell); + switch (code) { + // included, so we are done + case INCLUDE: + case INCLUDE_AND_NEXT_COL: --- End diff -- =20 =F0=9F=91=8D Just confirmed that transaction filter does this > Add HBase 2.0 compatibility module > ---------------------------------- > > Key: TEPHRA-272 > URL: https://issues.apache.org/jira/browse/TEPHRA-272 > Project: Tephra > Issue Type: Improvement > Reporter: Ankit Singhal > Assignee: Ankit Singhal > Priority: Major > Labels: HBase-2.0 > Fix For: 0.14.0-incubating > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)