[GitHub] incubator-trafodion pull request #1229: [TRAFODION-2734] Create *Trafodion L...

2017-09-18 Thread DaveBirdsall
Github user DaveBirdsall commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r139535246
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* 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 implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
--- End diff --

It seems ungrammatical to my ear. An imperative tense would clearly not be 
correct. We aren't telling the reader to "Work with LOBs!" (note the plural 
would be required, or alternatively the indefinite article, "Work with a 
LOB!"). Rather we are trying to describe how one works with LOBs. To me using 
the gerund seems most natural (in all cases, not just here); I would recommend 
changing the style to do that. Another possibility is to use the infinitive, 
e.g. "How to work with LOBs" (note again the plural). That might be more 
natural for English-as-a-second-language users whose native language lacks 
gerund-like inflections.


---


[GitHub] incubator-trafodion pull request #1229: [TRAFODION-2734] Create *Trafodion L...

2017-09-18 Thread DaveBirdsall
Github user DaveBirdsall commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r139533345
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* 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 implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
+
++
+External LOB object that are not managed by Trafodion.
+
+* `_empty_`
+
++
+Number of bytes specified by the numeric literal.
+
+* `_K_`
+
++
+Numeric literal value * 1024.
+
+* `_M_`
+
++
+Numeric literal value * 1024 * 1024.
+
+* `_G_`
+
++
+Numeric literal value * 1024 * 1024 * 1024.
+
+[#examples]
+=== Examples
+
+* This example creates a table tlob1 with 2 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob1 (c1 INT NOT NULL, c2 BLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob2 with 3 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob2 (c1 INT NOT NULL, c2 BLOB, c3 CLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob130txt_limit50 with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130txt_limit50 (c1 INT NOT NULL, c2 CLOB(50), PRIMARY KEY 
(c1));
+```
+
+* This example creates a table tlob130bin_limit1K with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130bin_limit1K (c1 INT NOT NULL, c2 BLOB(1 K), PRIMARY 
KEY (c1));
+```
+
+* This example creates a table tlob130ext with 4 columns and primary key 
on the c1.
+
++
+
+```
+CREATE TABLE tlob130ext (c1 INT NOT NULL, c2 BLOB, c3 CLOB, c4 BLOB 
STORAGE 'EXTERNAL', PRIMARY KEY (c1));
+```
+
+[#hdfs location of lob data]
+=== HDFS Location of LOB Data
+
+When a LOB table is created, the underlying LOB data needs to be stored in 
HDFS.It is in the /user/trafodion/lobs by default. 
+
+All columns of a table that are declared as LOB types will have all their 
data in one file derived from the Object UID and the LOB number of that column 
which gets assigned during creation.
+
+The following is a LOB file with 2 columns you will see 2 files in HDFS:
+
+/user/trafodion/lobs /LOBP_03683514167332904796_0001
+
+/user/trafodion/lobs/LOBP_03683514167332904796_0002
+
+As rows are added to this column, the LOB data for each row gets appended 
to the corresponding column’s LOB data file. 
+
+[#insert into a sql table containing lob columns]
+== Insert into a SQL Table Containing LOB Columns
+
+[#syntax]
+=== Syntax
+
+```
+INSERT INTO table-name [(target-col-list)] insert-source
+```
+
+```
+target-col-list is: 
+colname[, colname]... 
+
+insert-source is: 
+VALUES(lob_query-expr[, lob_query-expr])
+
+lob_query-expr is: 
+NULL | ?   
  |
+EMPTY_BLOB() 

[GitHub] incubator-trafodion pull request #1229: [TRAFODION-2734] Create *Trafodion L...

2017-09-18 Thread DaveBirdsall
Github user DaveBirdsall commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r139533238
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* 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 implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
+
++
+External LOB object that are not managed by Trafodion.
+
+* `_empty_`
+
++
+Number of bytes specified by the numeric literal.
+
+* `_K_`
+
++
+Numeric literal value * 1024.
+
+* `_M_`
+
++
+Numeric literal value * 1024 * 1024.
+
+* `_G_`
+
++
+Numeric literal value * 1024 * 1024 * 1024.
+
+[#examples]
+=== Examples
+
+* This example creates a table tlob1 with 2 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob1 (c1 INT NOT NULL, c2 BLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob2 with 3 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob2 (c1 INT NOT NULL, c2 BLOB, c3 CLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob130txt_limit50 with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130txt_limit50 (c1 INT NOT NULL, c2 CLOB(50), PRIMARY KEY 
(c1));
+```
+
+* This example creates a table tlob130bin_limit1K with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130bin_limit1K (c1 INT NOT NULL, c2 BLOB(1 K), PRIMARY 
KEY (c1));
+```
+
+* This example creates a table tlob130ext with 4 columns and primary key 
on the c1.
+
++
+
+```
+CREATE TABLE tlob130ext (c1 INT NOT NULL, c2 BLOB, c3 CLOB, c4 BLOB 
STORAGE 'EXTERNAL', PRIMARY KEY (c1));
+```
+
+[#hdfs location of lob data]
+=== HDFS Location of LOB Data
+
+When a LOB table is created, the underlying LOB data needs to be stored in 
HDFS.It is in the /user/trafodion/lobs by default. 
+
+All columns of a table that are declared as LOB types will have all their 
data in one file derived from the Object UID and the LOB number of that column 
which gets assigned during creation.
+
+The following is a LOB file with 2 columns you will see 2 files in HDFS:
+
+/user/trafodion/lobs /LOBP_03683514167332904796_0001
+
+/user/trafodion/lobs/LOBP_03683514167332904796_0002
+
+As rows are added to this column, the LOB data for each row gets appended 
to the corresponding column’s LOB data file. 
+
+[#insert into a sql table containing lob columns]
+== Insert into a SQL Table Containing LOB Columns
+
+[#syntax]
+=== Syntax
+
+```
+INSERT INTO table-name [(target-col-list)] insert-source
+```
+
+```
+target-col-list is: 
+colname[, colname]... 
+
+insert-source is: 
+VALUES(lob_query-expr[, lob_query-expr])
+
+lob_query-expr is: 
+NULL | ?   
  |
+EMPTY_BLOB() 

[GitHub] incubator-trafodion pull request #1229: [TRAFODION-2734] Create *Trafodion L...

2017-09-18 Thread DaveBirdsall
Github user DaveBirdsall commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r139533296
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* 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 implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
+
++
+External LOB object that are not managed by Trafodion.
+
+* `_empty_`
+
++
+Number of bytes specified by the numeric literal.
+
+* `_K_`
+
++
+Numeric literal value * 1024.
+
+* `_M_`
+
++
+Numeric literal value * 1024 * 1024.
+
+* `_G_`
+
++
+Numeric literal value * 1024 * 1024 * 1024.
+
+[#examples]
+=== Examples
+
+* This example creates a table tlob1 with 2 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob1 (c1 INT NOT NULL, c2 BLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob2 with 3 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob2 (c1 INT NOT NULL, c2 BLOB, c3 CLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob130txt_limit50 with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130txt_limit50 (c1 INT NOT NULL, c2 CLOB(50), PRIMARY KEY 
(c1));
+```
+
+* This example creates a table tlob130bin_limit1K with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130bin_limit1K (c1 INT NOT NULL, c2 BLOB(1 K), PRIMARY 
KEY (c1));
+```
+
+* This example creates a table tlob130ext with 4 columns and primary key 
on the c1.
+
++
+
+```
+CREATE TABLE tlob130ext (c1 INT NOT NULL, c2 BLOB, c3 CLOB, c4 BLOB 
STORAGE 'EXTERNAL', PRIMARY KEY (c1));
+```
+
+[#hdfs location of lob data]
+=== HDFS Location of LOB Data
+
+When a LOB table is created, the underlying LOB data needs to be stored in 
HDFS.It is in the /user/trafodion/lobs by default. 
+
+All columns of a table that are declared as LOB types will have all their 
data in one file derived from the Object UID and the LOB number of that column 
which gets assigned during creation.
+
+The following is a LOB file with 2 columns you will see 2 files in HDFS:
+
+/user/trafodion/lobs /LOBP_03683514167332904796_0001
+
+/user/trafodion/lobs/LOBP_03683514167332904796_0002
+
+As rows are added to this column, the LOB data for each row gets appended 
to the corresponding column’s LOB data file. 
+
+[#insert into a sql table containing lob columns]
+== Insert into a SQL Table Containing LOB Columns
+
+[#syntax]
+=== Syntax
+
+```
+INSERT INTO table-name [(target-col-list)] insert-source
+```
+
+```
+target-col-list is: 
+colname[, colname]... 
+
+insert-source is: 
+VALUES(lob_query-expr[, lob_query-expr])
+
+lob_query-expr is: 
+NULL | ?   
  |
+EMPTY_BLOB() 

[GitHub] incubator-trafodion pull request #1229: [TRAFODION-2734] Create *Trafodion L...

2017-09-18 Thread DaveBirdsall
Github user DaveBirdsall commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r139533191
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* 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 implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
+```
+
+```
+lob-column-spec is:
+column {lob type}
+
+lob type is:
+BLOB | CLOB [({numeric literal} [unit])] [STORAGE 'storage literal']
+
+unit is:
+empty | 
+K | 
+M | 
+G 
+```
+
+[#semantics]
+=== Semantics
+
+* `_storage literal_`
+
++
+Currently Trafodion only support `'EXTERNAL'` here. 
+
++
+External LOB object that are not managed by Trafodion.
+
+* `_empty_`
+
++
+Number of bytes specified by the numeric literal.
+
+* `_K_`
+
++
+Numeric literal value * 1024.
+
+* `_M_`
+
++
+Numeric literal value * 1024 * 1024.
+
+* `_G_`
+
++
+Numeric literal value * 1024 * 1024 * 1024.
+
+[#examples]
+=== Examples
+
+* This example creates a table tlob1 with 2 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob1 (c1 INT NOT NULL, c2 BLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob2 with 3 columns and primary key on the 
c1.
+
++
+
+```
+CREATE TABLE tlob2 (c1 INT NOT NULL, c2 BLOB, c3 CLOB, PRIMARY KEY (c1));
+```
+
+* This example creates a table tlob130txt_limit50 with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130txt_limit50 (c1 INT NOT NULL, c2 CLOB(50), PRIMARY KEY 
(c1));
+```
+
+* This example creates a table tlob130bin_limit1K with 2 columns and 
primary key on the c1.
+
++
+
+```
+CREATE TABLE tlob130bin_limit1K (c1 INT NOT NULL, c2 BLOB(1 K), PRIMARY 
KEY (c1));
+```
+
+* This example creates a table tlob130ext with 4 columns and primary key 
on the c1.
+
++
+
+```
+CREATE TABLE tlob130ext (c1 INT NOT NULL, c2 BLOB, c3 CLOB, c4 BLOB 
STORAGE 'EXTERNAL', PRIMARY KEY (c1));
+```
+
+[#hdfs location of lob data]
+=== HDFS Location of LOB Data
+
+When a LOB table is created, the underlying LOB data needs to be stored in 
HDFS.It is in the /user/trafodion/lobs by default. 
+
+All columns of a table that are declared as LOB types will have all their 
data in one file derived from the Object UID and the LOB number of that column 
which gets assigned during creation.
+
+The following is a LOB file with 2 columns you will see 2 files in HDFS:
+
+/user/trafodion/lobs /LOBP_03683514167332904796_0001
+
+/user/trafodion/lobs/LOBP_03683514167332904796_0002
+
+As rows are added to this column, the LOB data for each row gets appended 
to the corresponding column’s LOB data file. 
+
+[#insert into a sql table containing lob columns]
+== Insert into a SQL Table Containing LOB Columns
+
+[#syntax]
+=== Syntax
+
+```
+INSERT INTO table-name [(target-col-list)] insert-source
+```
+
+```
+target-col-list is: 
+colname[, colname]... 
+
+insert-source is: 
+VALUES(lob_query-expr[, lob_query-expr])
--- End diff --

Looks good to me.


---


[GitHub] incubator-trafodion pull request #1229: [TRAFODION-2734] Create *Trafodion L...

2017-09-18 Thread DaveBirdsall
Github user DaveBirdsall commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1229#discussion_r139532497
  
--- Diff: docs/lob_guide/src/asciidoc/_chapters/work_with_lob.adoc ---
@@ -0,0 +1,738 @@
+
+/**
+* @@@ START COPYRIGHT @@@
+*
+* 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 implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+* @@@ END COPYRIGHT @@@
+*/
+
+
+[#work with lob]
+= Work with LOB
+
+[#create a sql table with lob columns]
+== Create a SQL Table with LOB Columns
+
+When creating a SQL table with LOB columns, following relevant tables and 
files are created as well:
+
+* One LOB MD table.
+* Two dependent descriptor tables.
+* HDFS data file (locates at /user/trafodion/lobs) for each column.
+
+[#syntax]
+== Syntax
+
+```
+CREATE TABLE table-name (lob-column-spec[, lob-column-spec]…)
--- End diff --

I think this is fine.


---


[GitHub] incubator-trafodion pull request #1209: TRAFODION-2717 odbc give wrong data ...

2017-09-18 Thread selvaganesang
Github user selvaganesang commented on a diff in the pull request:


https://github.com/apache/incubator-trafodion/pull/1209#discussion_r139488348
  
--- Diff: 
dcs/src/main/java/org/trafodion/dcs/master/listener/ListenerWorker.java ---
@@ -86,39 +86,43 @@ public void run() {
 DataEvent dataEvent;
 
 while(true) {
-// Wait for data to become available
-synchronized(queue) {
-while(queue.isEmpty()) {
-try {
-queue.wait();
-} catch (InterruptedException e) {
+try {
+// Wait for data to become available
+synchronized(queue) {
+while(queue.isEmpty()) {
+try {
+queue.wait();
+} catch (InterruptedException e) {
+}
 }
+dataEvent = queue.remove(0);
 }
-dataEvent = queue.remove(0);
-}
-SelectionKey key = dataEvent.key;
-SocketChannel client = (SocketChannel) key.channel();
-Socket s = client.socket();
-ClientData clientData = (ClientData) key.attachment();
-ListenerService server = dataEvent.server;
-dataEvent.key = null;
-dataEvent.server = null;
-
-switch (clientData.hdr.getOperationId()){
-case ListenerConstants.DCS_MASTER_GETSRVRAVAILABLE:
-clientData = 
requestGetObjectRef.processRequest(clientData, s);
-break;
-case ListenerConstants.DCS_MASTER_CANCELQUERY:
-clientData = 
requestCancelQuery.processRequest(clientData, s);
-break;
-default:
-clientData = requestUnknown.processRequest(clientData, 
s);
-break;
+SelectionKey key = dataEvent.key;
+SocketChannel client = (SocketChannel) key.channel();
+Socket s = client.socket();
+ClientData clientData = (ClientData) key.attachment();
+ListenerService server = dataEvent.server;
+dataEvent.key = null;
+dataEvent.server = null;
+
+switch (clientData.hdr.getOperationId()){
+case ListenerConstants.DCS_MASTER_GETSRVRAVAILABLE:
+clientData = 
requestGetObjectRef.processRequest(clientData, s);
+break;
+case ListenerConstants.DCS_MASTER_CANCELQUERY:
+clientData = 
requestCancelQuery.processRequest(clientData, s);
+break;
+default:
+clientData = 
requestUnknown.processRequest(clientData, s);
+break;
+}
+// Return to sender
+int requestReply = clientData.requestReply;
+key.attach(clientData);
+server.send(new PendingRequest(key, requestReply));
+} catch (Exception e){
+LOG.error("Unexpected Exception", e);
--- End diff --

I am unable to follow the explanation. I will let the community to decide 
on this PR going forward


---


[GitHub] incubator-trafodion pull request #1232: [TRAFODION-2738] Rowset buffer size ...

2017-09-18 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/incubator-trafodion/pull/1232


---


[GitHub] incubator-trafodion pull request #1238: [TRAFODION-2730] process loop when i...

2017-09-18 Thread sureshsubbiah
GitHub user sureshsubbiah opened a pull request:

https://github.com/apache/incubator-trafodion/pull/1238

[TRAFODION-2730] process loop when infer_charset cqd is ON and query …

…invalidation is done

This PR also includes fixes for [TRAFODION-2747] and [TRAFODION-2748].
The changes are small and the problems not severe.
Please see JIRA for an explanation

Add aditional change has been made to explain output.
cache_blocks ON is now added to explain for HBase scans. Previously
explain would only show cache_blocks OFF, if blockcache was disabled for a
HBase scan.

Files
2730 - QCache.cpp
2747 - ExSequence.cpp, ExAtp.h
2748 - GenPreCode.cpp
cache_block - GenExplain.cpp, 4 regression EXPECTED files

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/sureshsubbiah/incubator-trafodion misc1

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-trafodion/pull/1238.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1238


commit e68aa43ae2f99e571095763b6e7acd51114295da
Author: Suresh Subbiah 
Date:   2017-09-18T16:27:49Z

[TRAFODION-2730] process loop when infer_charset cqd is ON and query 
invalidation is done

This PR also includes fixes for [TRAFODION-2747] and [TRAFODION-2748].
The changes are small and the problems not severe.
Please see JIRA for an explanation

Add aditional change has been made to explain output.
cache_blocks ON is now added to explain for HBase scans. Previously
explain would only show cache_blocks OFF, if blockcache was disabled for a
HBase scan.

Files
2730 - QCache.cpp
2747 - ExSequence.cpp, ExAtp.h
2748 - GenPreCode.cpp
cache_block - GenExplain.cpp, 4 regression EXPECTED files




---


[GitHub] incubator-trafodion pull request #1237: [TRAFODION-2726] odb support to load...

2017-09-18 Thread SuJinpei
GitHub user SuJinpei opened a pull request:

https://github.com/apache/incubator-trafodion/pull/1237

[TRAFODION-2726] odb support to load json file

**1. Why support json?**
1. custormer needed.
2. JSON is a data inter-exchange format. When compared to XML, it is 
very lightweight and more human-readable.

**2. Why not use existing c json lib?**
Considered using the json-c and json-glibc, but seems neither them 
support stream parse.  For a large file, the memory may not enough.

**3. How odb support json loading function?**
   1. Create table tbjson(id int, name char(20));
   2. cat test.json
   {
  "test":[
  { "id":1 , "name":"hello" },
  { "id":2 , "name":"world" },
  ]
  }
   3.
  `./odb64luo -l src=test.json:tgt=tbjson:jsonkey=test
odb [parseopt(14249)] - Warning: this function is not fully tested "jsonkey"
odb [2017-09-18 15:28:39]: starting ODBC connection(s)... 0
Connected to Trafodion
[0] 2 records inserted [commit]
[0] odb version 1.1.0 Load(X) statistics:
[0] Target table: (null).(null).TBJSON
[0] Source: test.json
[0] Pre-loading time: 0.308 s (00:00:00.308)
[0] Loading time: 0.021 s(00:00:00.021)
[0] Total records read: 0
[0] Total records inserted: 2
[0] Total number of columns: 2
[0] Average input row size: NaN B
[0] ODBC row size: 31 B (data) + 16 B (len ind)
[0] Rowset size: 100
[0] Rowset buffer size: 4.59 KiB
[0] Load throughput (real data): 0.000 KiB/s
[0] Load throughput (ODBC): 2.883 KiB/s
odb [2017-09-18 15:28:39]: exiting. Session Elapsed time 0.338 seconds 
(00:00:00.338)
-bash-4.1$ ./odb64luo -x "select * from tbjson"   
odb [2017-09-18 15:29:28]: starting ODBC connection(s)... 0
1,hello   
2,world   
[0.0.0]--- 2 row(s) selected in 0.025s (prep 0.006s, exec 0.008s, fetch 
0.011s/0.006s)
odb [2017-09-18 15:29:28]: exiting. Session Elapsed time 0.284 seconds 
(00:00:00.284)`


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/SuJinpei/incubator-trafodion trafodion-2726

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-trafodion/pull/1237.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1237






---