From issues-return-3447-archive-asf-public=cust-asf.ponee.io@phoenix.apache.org Tue Dec 18 20:27:06 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 5BE3C180669 for ; Tue, 18 Dec 2018 20:27:06 +0100 (CET) Received: (qmail 9046 invoked by uid 500); 18 Dec 2018 19:27:05 -0000 Mailing-List: contact issues-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list issues@phoenix.apache.org Received: (qmail 9037 invoked by uid 99); 18 Dec 2018 19:27:05 -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, 18 Dec 2018 19:27:05 +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 1847AC033A for ; Tue, 18 Dec 2018 19:27:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.301 X-Spam-Level: X-Spam-Status: No, score=-110.301 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, 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 NwPomrVvWPlQ for ; Tue, 18 Dec 2018 19:27:03 +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 A8AFA60DA2 for ; Tue, 18 Dec 2018 19:27:02 +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 60A6CE2635 for ; Tue, 18 Dec 2018 19:27:01 +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 69C7923FE5 for ; Tue, 18 Dec 2018 19:27:00 +0000 (UTC) Date: Tue, 18 Dec 2018 19:27:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (PHOENIX-3623) Integrate Omid with Phoenix 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/PHOENIX-3623?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D16= 724403#comment-16724403 ]=20 ASF GitHub Bot commented on PHOENIX-3623: ----------------------------------------- Github user JamesRTaylor commented on a diff in the pull request: https://github.com/apache/phoenix/pull/418#discussion_r242673332 =20 --- Diff: phoenix-core/src/main/java/org/apache/phoenix/transaction/Omi= dTransactionProvider.java --- @@ -63,26 +83,106 @@ public PhoenixTransactionContext getTransactionCon= text(PhoenixConnection connect =20 @Override public PhoenixTransactionClient getTransactionClient(Configuration= config, ConnectionInfo connectionInfo) throws SQLException{ - return new OmidTransactionClient(); + if (transactionManager =3D=3D null) { + try { + HBaseOmidClientConfiguration clientConf =3D new HBaseO= midClientConfiguration(); + clientConf.setConflictAnalysisLevel(OmidClientConfigur= ation.ConflictDetectionLevel.ROW); + transactionManager =3D (HBaseTransactionManager) HBase= TransactionManager.newInstance(clientConf); + } catch (IOException | InterruptedException e) { + throw new SQLExceptionInfo.Builder( + SQLExceptionCode.TRANSACTION_FAILED) + .setMessage(e.getMessage()).setRootCause(e).bu= ild() + .buildException(); + } + } + + return new OmidTransactionClient(transactionManager); } =20 static class OmidTransactionClient implements PhoenixTransactionCl= ient { + private final HBaseTransactionManager transactionManager; + + public OmidTransactionClient(HBaseTransactionManager transacti= onManager) { + this.transactionManager =3D transactionManager; + } + + public HBaseTransactionManager getTransactionClient() { + return transactionManager; + } + @Override public void close() throws IOException {} } =20 + // For testing only + public CommitTable.Client getCommitTableClient() { + return commitTableClient; + } + =20 @Override public PhoenixTransactionService getTransactionService(Configurati= on config, ConnectionInfo connectionInfo, int port) throws SQLException{ - return new OmidTransactionService(); + TSOServerConfig tsoConfig =3D new TSOServerConfig(); + TSOServer tso; + + tsoConfig.setPort(port); + tsoConfig.setConflictMapSize(config.getInt(OMID_TSO_CONFLICT_M= AP_SIZE, DEFAULT_OMID_TSO_CONFLICT_MAP_SIZE)); + tsoConfig.setTimestampType(config.get(OMID_TSO_TIMESTAMP_TYPE,= DEFAULT_OMID_TSO_TIMESTAMP_TYPE)); + + Injector injector =3D Guice.createInjector(new TSOMockModule(t= soConfig)); + tso =3D injector.getInstance(TSOServer.class); + tso.startAndWait(); + + OmidClientConfiguration clientConfig =3D new OmidClientConfigu= ration(); + clientConfig.setConnectionString("localhost:" + port); + clientConfig.setConflictAnalysisLevel(OmidClientConfiguration.= ConflictDetectionLevel.ROW); + + InMemoryCommitTable commitTable =3D (InMemoryCommitTable) inje= ctor.getInstance(CommitTable.class); --- End diff -- =20 The InMemoryCommitTable is only used during testing. > Integrate Omid with Phoenix > --------------------------- > > Key: PHOENIX-3623 > URL: https://issues.apache.org/jira/browse/PHOENIX-3623 > Project: Phoenix > Issue Type: New Feature > Reporter: Ohad Shacham > Assignee: Ohad Shacham > Priority: Major > Fix For: 4.15.0 > > Attachments: 4.x-HBase-1.2.patch, 4.x-HBase-1.3.patch, 4.x-HBase-= 1.4.patch, master.patch > > > The purpose of this Jira is to propose a work plan for connecting Omid to= Phoenix. > Each task of the following will be handled in a seperate sub Jira. Subtas= ks 4.* are related to augmenting Omid to support features required by Phoen= ix and therefore, their corresponding Jiras will appear under Omid and not = under Phoenix.=20 > Each task is completed by a commit. > Task 1: Adding transaction abstraction layer (TAL) - Currently Tephra cal= ls are integrated inside Phoenix code. Therefore, in order to support both = Omid and Tephra, we need to add another abstraction layer that later-on wil= l be connected to both Tephra and Omid. The first tasks is to define such a= n interface. > Task 2: Implement TAL functionality for Tephra.=20 > Task 3: Refactor Phoenix to use TAL instead of direct calls to Tephra. > Task 4: Implement Omid required features for Phoenix: > Task 4.1: Add checkpoints to Omid. A checkpoint is a point in a transacti= on where every write occurs after the checkpoint is not visible by the tran= saction. Explanations for this feature can be seen in [TEPHRA-96]. > Task 4.2: Add an option to mark a key as non-conflicting. The motivation = is to reduce the size of the write set needed by the transaction manager up= on commit as well as reduce the conflict detection work. > Task 4.3: Add support for transactions that never abort. Such transaction= s will only make other inflight transactions abort and will abort only in c= ase of a transaction manager failure.=20 > These transactions are needed for =E2=80=98create index=E2=80=99 and the = scenario was discussed in [TEPHRA-157] and [PHOENIX-2478]. Augmenting Omid = with this kind of transactions was also discussed in [OMID-56]. > Task 4.4: Add support for returning multiple versions in a scan. The use = case is described in [TEPHRA-134]. > Task 4.5: Change Omid's timestamp mechanism to return real time based tim= estamp, while keeping monotonicity. > Task 5: Implement TAL functionality for Omid. > Task 6: Implement performance tests and tune Omid for Phoenix use. This t= ask requires understanding of common usage scenarios in Phoenix as well as = defining the tradeoff between throughput and latency.=20 > Could you please review the proposed work plan? > Also, could you please let me know whether I missed any augmentation need= ed for Omid in order to support Phoenix operations? > I opened a jira [OMID-82] that encapsulates all Omid related development = for Phoenix. -- This message was sent by Atlassian JIRA (v7.6.3#76005)