Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 0E01E200CEE for ; Tue, 8 Aug 2017 00:13:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 0CDB616641B; Mon, 7 Aug 2017 22:13:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3602D16641C for ; Tue, 8 Aug 2017 00:13:44 +0200 (CEST) Received: (qmail 84322 invoked by uid 500); 7 Aug 2017 22:13:43 -0000 Mailing-List: contact commits-help@trafodion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: commits@trafodion.apache.org Delivered-To: mailing list commits@trafodion.apache.org Received: (qmail 84312 invoked by uid 99); 7 Aug 2017 22:13:43 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Aug 2017 22:13:43 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 002ECC07EB for ; Mon, 7 Aug 2017 22:13:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.222 X-Spam-Level: X-Spam-Status: No, score=-4.222 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id xa00RpfqxRFF for ; Mon, 7 Aug 2017 22:13:37 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id B16095F523 for ; Mon, 7 Aug 2017 22:13:36 +0000 (UTC) Received: (qmail 84213 invoked by uid 99); 7 Aug 2017 22:13:35 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Aug 2017 22:13:35 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 2ECB4F327A; Mon, 7 Aug 2017 22:13:34 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dbirdsall@apache.org To: commits@trafodion.incubator.apache.org Date: Mon, 07 Aug 2017 22:13:34 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/3] incubator-trafodion git commit: Make threshold of compression configurable in linux archived-at: Mon, 07 Aug 2017 22:13:45 -0000 Repository: incubator-trafodion Updated Branches: refs/heads/master 56183e291 -> d53816273 Make threshold of compression configurable in linux Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/a731155a Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/a731155a Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/a731155a Branch: refs/heads/master Commit: a731155a95df05b41ad780a8254a60faada79027 Parents: d86a0ba Author: CoderSong2015 <403438485@qq.com> Authored: Fri Aug 4 03:36:14 2017 +0000 Committer: CoderSong2015 <403438485@qq.com> Committed: Fri Aug 4 03:36:14 2017 +0000 ---------------------------------------------------------------------- .../odbc/odbcclient/unixcli/cli/cconnect.cpp | 4 +++ .../odbc/odbcclient/unixcli/cli/cconnect.h | 2 +- .../odbc/odbcclient/unixcli/cli/cdatasource.cpp | 38 ++++++++++++++++++-- .../odbc/odbcclient/unixcli/cli/cdatasource.h | 2 +- .../odbc/odbcclient/unixcli/cli/drvrglobal.cpp | 2 ++ .../odbc/odbcclient/unixcli/cli/drvrglobal.h | 1 + .../odbcclient/unixcli/common/TCPIPUnixDrvr.cpp | 5 +-- .../odbcclient/unixcli/common/TCPIPUnixDrvr.h | 1 + 8 files changed, 48 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a731155a/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/cconnect.cpp ---------------------------------------------------------------------- diff --git a/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/cconnect.cpp b/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/cconnect.cpp index 7fa0bb2..3245dee 100644 --- a/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/cconnect.cpp +++ b/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/cconnect.cpp @@ -772,6 +772,10 @@ SQLRETURN CConnect::Connect(SQLCHAR *ServerName, if (m_srvrTCPIPSystem != NULL) m_srvrTCPIPSystem->m_IOCompression = m_IOCompression; + if (m_asTCPIPSystem != NULL) + m_asTCPIPSystem->m_IOCompressionThreshold = m_DSValue.m_DSIOCompressionThreshold; + if (m_srvrTCPIPSystem != NULL) + m_srvrTCPIPSystem->m_IOCompressionThreshold= m_DSValue.m_DSIOCompressionThreshold; // Set the Assocation Service Object Reference strcpy(m_ASSvc_ObjRef, m_DSValue.m_DSServer); strcpy(buffer,m_DSValue.m_DSServer); http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a731155a/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/cconnect.h ---------------------------------------------------------------------- diff --git a/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/cconnect.h b/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/cconnect.h index 75d9c19..87c0a7e 100644 --- a/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/cconnect.h +++ b/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/cconnect.h @@ -469,7 +469,7 @@ private: SQLUINTEGER m_SecurityMode; bool m_RetryEncryption; SQLUINTEGER m_IOCompression; - + int m_IOCompressionThreshold; void reset(bool clearE=true); friend class CStmt; friend class CDesc; http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a731155a/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/cdatasource.cpp ---------------------------------------------------------------------- diff --git a/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/cdatasource.cpp b/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/cdatasource.cpp index 5413aec..b222fb4 100644 --- a/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/cdatasource.cpp +++ b/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/cdatasource.cpp @@ -34,9 +34,9 @@ #define CONNECTION_TIMEOUT_DEFAULT 60 #define LOGIN_TIMEOUT_DEFAULT 60 #define QUERY_TIMEOUT_DEFAULT 0 +#define IOCOMPRESSION_DEFAULT 1000 #define FETCH_BUFFER_SIZE_DEFAULT 512 * 1024 #define TCP_DEFAULT_PROCESS "$ZTC0" - // we are using the hpodbc driver manager extern int hpodbc_dmanager = 1; @@ -93,7 +93,7 @@ CDataSource::CDataSource() m_DSCertificateFileActive[0] = '\0'; strcpy(m_DSCertificateDir,"SYSTEM_DEFAULT"); m_DSIOCompression = 0; - + m_DSIOCompressionThreshold = 0; // // Read the ODBC section to get Certificate Directory Location // @@ -613,7 +613,7 @@ short CDataSource::readDSValues(char *DSName,CConnect* pConnection) keyValueLength, path); if (len > 0) - { + { if (strcmp((const char *)keyValueBuf, SYSTEM_DEFAULT) == 0) m_DSQueryTimeout = QUERY_TIMEOUT_DEFAULT; else @@ -788,6 +788,29 @@ short CDataSource::readDSValues(char *DSName,CConnect* pConnection) } } +//get threshold of compression ,default is 1000 + keyValueLength = sizeof(keyValueBuf); + len = GetMyPrivateProfileString( + searchKey, + "CompressionThreshold", + NULL, + keyValueBuf, + keyValueLength, + path); + + if (len > 0) + { + if (strcmp((const char *)keyValueBuf, SYSTEM_DEFAULT) == 0) + m_DSIOCompressionThreshold = IOCOMPRESSION_DEFAULT; + else + { + m_DSIOCompressionThreshold = atol((const char *)keyValueBuf); + } + + } + else + m_DSIOCompressionThreshold = IOCOMPRESSION_DEFAULT; + keyValueLength = sizeof(m_DSServiceName); len = GetMyPrivateProfileString( searchKey, @@ -993,6 +1016,15 @@ void CDataSource::updateDSValues(short DSNType, CONNECT_FIELD_ITEMS *connectFiel m_DSIOCompression = atol((const char *)AttrValue); } break; + case KEY_COMPRESSIONTHRESHOLD: + if (stricmp(AttrValue, SYSTEM_DEFAULT) == 0){ + m_DSIOCompressionThreshold = IOCOMPRESSION_DEFAULT; + } + else + { + m_DSIOCompressionThreshold = atol((const char *)AttrValue); + } + break; default: break; } http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a731155a/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/cdatasource.h ---------------------------------------------------------------------- diff --git a/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/cdatasource.h b/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/cdatasource.h index 67c4cef..5c072b2 100644 --- a/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/cdatasource.h +++ b/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/cdatasource.h @@ -88,7 +88,7 @@ private: char m_DSCertificateFile[MAX_SQL_IDENTIFIER_LEN + 1]; char m_DSCertificateFileActive[MAX_SQL_IDENTIFIER_LEN + 1]; SQLUINTEGER m_DSIOCompression; - + int m_DSIOCompressionThreshold; friend class CConnect; }; http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a731155a/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/drvrglobal.cpp ---------------------------------------------------------------------- diff --git a/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/drvrglobal.cpp b/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/drvrglobal.cpp index 0d4fcab..975d66b 100644 --- a/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/drvrglobal.cpp +++ b/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/drvrglobal.cpp @@ -192,6 +192,7 @@ char *ConnectKeywords[] = "CERTIFICATEFILE", "CERTIFICATEFILE_ACTIVE", "COMPRESSION", + "COMPRESSIONTHRESHOLD", NULL }; @@ -228,6 +229,7 @@ char *ConnectLocalizedIdentifier[] = "Certificate File", "Certificate File Active", "Compression", + "CompressionThreshold", NULL, }; http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a731155a/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/drvrglobal.h ---------------------------------------------------------------------- diff --git a/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/drvrglobal.h b/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/drvrglobal.h index a3c9dd0..c082a46 100644 --- a/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/drvrglobal.h +++ b/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/drvrglobal.h @@ -401,6 +401,7 @@ typedef enum CONNECT_KEYWORDS KEY_CERTIFICATEFILE, KEY_CERTIFICATEFILE_ACTIVE, KEY_COMPRESSION, + KEY_COMPRESSIONTHRESHOLD, KEY_MAX }; http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a731155a/core/conn/unixodbc/odbc/odbcclient/unixcli/common/TCPIPUnixDrvr.cpp ---------------------------------------------------------------------- diff --git a/core/conn/unixodbc/odbc/odbcclient/unixcli/common/TCPIPUnixDrvr.cpp b/core/conn/unixodbc/odbc/odbcclient/unixcli/common/TCPIPUnixDrvr.cpp index 6984b54..013f61b 100644 --- a/core/conn/unixodbc/odbc/odbcclient/unixcli/common/TCPIPUnixDrvr.cpp +++ b/core/conn/unixodbc/odbc/odbcclient/unixcli/common/TCPIPUnixDrvr.cpp @@ -59,6 +59,7 @@ CTCPIPUnixDrvr::CTCPIPUnixDrvr() m_hSocket = INVALID_SOCKET; m_IOCompression = 0; + m_IOCompressionThreshold = 1000; m_hEvents[0] = NULL; m_hEvents[1] = NULL; @@ -440,7 +441,7 @@ bool DoIO (CTCPIPUnixDrvr* pTCPIPSystem, IDL_char* wbuffer, IDL_long write_count RESET_ERRORS((long)pTCPIPSystem); - if (pTCPIPSystem->m_IOCompression != 0) + if ((pTCPIPSystem->m_IOCompression != 0)&&(pTCPIPSystem->odbcAPI != AS_API_GETOBJREF)) { wheader.compress_ind = COMP_YES; wheader.compress_type = pTCPIPSystem->m_IOCompression; @@ -459,7 +460,7 @@ bool DoIO (CTCPIPUnixDrvr* pTCPIPSystem, IDL_char* wbuffer, IDL_long write_count wheader.total_length = write_count; wheader.hdr_type = WRITE_REQUEST_FIRST; - if (wheader.compress_ind == COMP_YES && write_count > MIN_LENGTH_FOR_COMPRESSION) + if (wheader.compress_ind == COMP_YES && write_count > pTCPIPSystem->m_IOCompressionThreshold) DoCompression(pTCPIPSystem, wheader, (unsigned char*)wbuffer, (unsigned int&)write_count); else wheader.compress_type = COMP_NO_COMPRESSION; http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a731155a/core/conn/unixodbc/odbc/odbcclient/unixcli/common/TCPIPUnixDrvr.h ---------------------------------------------------------------------- diff --git a/core/conn/unixodbc/odbc/odbcclient/unixcli/common/TCPIPUnixDrvr.h b/core/conn/unixodbc/odbc/odbcclient/unixcli/common/TCPIPUnixDrvr.h index f53dc8a..50e3f0f 100644 --- a/core/conn/unixodbc/odbc/odbcclient/unixcli/common/TCPIPUnixDrvr.h +++ b/core/conn/unixodbc/odbc/odbcclient/unixcli/common/TCPIPUnixDrvr.h @@ -72,6 +72,7 @@ public: HEADER m_rheader; char m_object_ref[MAX_OBJECT_REF + 1]; int m_IOCompression; + int m_IOCompressionThreshold; CCompression m_compression; private: