[GitHub] trafodion pull request #1407: Add hibernate dialect support.

2018-01-18 Thread kevinxu021
Github user kevinxu021 commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1407#discussion_r162537585
  
--- Diff: tools/hibernate-dialect/pom.xml ---
@@ -0,0 +1,30 @@
+http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
--- End diff --

License head is required for every file.


---


[GitHub] trafodion pull request #1427: TRAFODION-2940 In HA env, one node lose networ...

2018-03-06 Thread kevinxu021
Github user kevinxu021 commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1427#discussion_r172734228
  
--- Diff: dcs/src/main/java/org/trafodion/dcs/master/DcsMaster.java ---
@@ -203,8 +244,8 @@ public void run() {
 } catch (KeeperException.NodeExistsException e) {
 // do nothing...some other server has created znodes
--- End diff --

it should be better to add warning for this exception that we could what 
happened. Any events happened should be reflected in log files.


---


[GitHub] trafodion pull request #1427: TRAFODION-2940 In HA env, one node lose networ...

2018-03-06 Thread kevinxu021
Github user kevinxu021 commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1427#discussion_r172736393
  
--- Diff: 
dcs/src/main/java/org/trafodion/dcs/master/listener/ListenerService.java ---
@@ -263,14 +264,20 @@ else if ((key.interestOps() & SelectionKey.OP_WRITE) 
== SelectionKey.OP_WRITE) {
 }
 }
 }
+if (this.isInterrupted()) {
+throw new InterruptedException();
+}
 //gc();
 }
+} catch (InterruptedException e) {
--- End diff --

Log what happens by info level at least.


---


[GitHub] trafodion pull request #1427: TRAFODION-2940 In HA env, one node lose networ...

2018-03-06 Thread kevinxu021
Github user kevinxu021 commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1427#discussion_r172736451
  
--- Diff: 
dcs/src/main/java/org/trafodion/dcs/master/listener/ListenerService.java ---
@@ -263,14 +264,20 @@ else if ((key.interestOps() & SelectionKey.OP_WRITE) 
== SelectionKey.OP_WRITE) {
 }
 }
 }
+if (this.isInterrupted()) {
+throw new InterruptedException();
+}
 //gc();
 }
+} catch (InterruptedException e) {
 } catch (IOException e) {
 LOG.error(e);
--- End diff --

it's better to use 2 parameters API for LOG.error


---


[GitHub] trafodion pull request #1427: TRAFODION-2940 In HA env, one node lose networ...

2018-03-06 Thread kevinxu021
Github user kevinxu021 commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1427#discussion_r172736344
  
--- Diff: 
dcs/src/main/java/org/trafodion/dcs/master/listener/ListenerService.java ---
@@ -263,14 +264,20 @@ else if ((key.interestOps() & SelectionKey.OP_WRITE) 
== SelectionKey.OP_WRITE) {
 }
 }
 }
+if (this.isInterrupted()) {
+throw new InterruptedException();
--- End diff --

Add some specific message for this exception.


---


[GitHub] trafodion pull request #1427: TRAFODION-2940 In HA env, one node lose networ...

2018-03-06 Thread kevinxu021
Github user kevinxu021 commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1427#discussion_r172729543
  
--- Diff: dcs/src/main/java/org/trafodion/dcs/master/DcsMaster.java ---
@@ -111,11 +104,59 @@ public DcsMaster(String[] args) {
 trafodionHome = System.getProperty(Constants.DCS_TRAFODION_HOME);
 jvmShutdownHook = new JVMShutdownHook();
 Runtime.getRuntime().addShutdownHook(jvmShutdownHook);
-thrd = new Thread(this);
-thrd.start();
+
+ExecutorService executorService = Executors.newFixedThreadPool(1);
+CompletionService completionService = new 
ExecutorCompletionService(executorService);
+
+while (true) {
+completionService.submit(this);
+Future f = null;
+try {
+f = completionService.take();
+if (f != null) {
+Integer status = f.get();
+if (status <= 0) {
+System.exit(status);
+} else {
+// 35000 * 15mins ~= 1 years
+RetryCounter retryCounter = 
RetryCounterFactory.create(35000, 15, TimeUnit.MINUTES);
+while (true) {
+try {
+ZkClient tmpZkc = new ZkClient();
+tmpZkc.connect();
+tmpZkc.close();
+tmpZkc = null;
+LOG.info("Connected to ZooKeeper 
successful, restart DCS Master.");
+// reset lock
+isLeader = new CountDownLatch(1);
+break;
--- End diff --

As we discussed, Zookeeper connection lost has been covered by session 
expired event, so this loop is useless.


---


[GitHub] trafodion pull request #1427: TRAFODION-2940 In HA env, one node lose networ...

2018-03-06 Thread kevinxu021
Github user kevinxu021 commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1427#discussion_r172737025
  
--- Diff: dcs/src/main/java/org/trafodion/dcs/zookeeper/ZkClient.java ---
@@ -176,7 +208,19 @@ public ZooKeeper getZk() {
public void process(WatchedEvent event) {
if(event.getState() == Watcher.Event.KeeperState.SyncConnected) 
{
connectedSignal.countDown();
-   }
+   } else if (event.getState() == 
Watcher.Event.KeeperState.Expired) {
+LOG.info("session expired. now rebuilding");
+// session expired, may be never happending. but if it happen 
there
+// need to close old client and rebuild new client
+try {
+connect(true);
+} catch (IOException e) {
+setSessionRecoverSuccessful(false);
+LOG.error("session expired and throw IOException while do 
reconnect: " + e.getMessage());
--- End diff --

Use 2 params API for log. If it doesn't matter for whatever the message is, 
it should be LOG.warn.


---


[GitHub] trafodion pull request #1427: TRAFODION-2940 In HA env, one node lose networ...

2018-03-06 Thread kevinxu021
Github user kevinxu021 commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1427#discussion_r172735971
  
--- Diff: dcs/src/main/java/org/trafodion/dcs/master/DcsMaster.java ---
@@ -262,12 +308,38 @@ public void run() {
 future.get();// block
 
 } catch (Exception e) {
-LOG.error(e);
-e.printStackTrace();
+LOG.error(e.getMessage(), e);
+try {
+FloatingIp floatingIp = FloatingIp.getInstance(this);
+floatingIp.unbindScript();
+} catch (Exception e1) {
+if (LOG.isErrorEnabled()) {
+LOG.error("Error creating class FloatingIp [" + 
e.getMessage() + "]", e1);
+}
+}
 if (pool != null)
 pool.shutdown();
-System.exit(0);
+if (ls != null) {
+ListenerWorker lw = ls.getWorker();
+if (lw != null) {
+lw.interrupt();
+LOG.info("Interrupt listenerWorker.");
+}
+ls.interrupt();
+LOG.info("Interrupt listenerService.");
+}
+if (infoServer != null) {
+try {
+infoServer.stop();
+LOG.info("Stop infoServer.");
+} catch (Exception e1) {
+LOG.error(e1.getMessage(), e1);
+}
+}
+return 1;
+
--- End diff --

Add try-catch for each progress.


---


[GitHub] trafodion pull request #1427: TRAFODION-2940 In HA env, one node lose networ...

2018-03-06 Thread kevinxu021
Github user kevinxu021 commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1427#discussion_r172733924
  
--- Diff: dcs/src/main/java/org/trafodion/dcs/master/DcsMaster.java ---
@@ -129,19 +170,19 @@ public void run() {
 instance = "1";
 } catch (NullPointerException e) {
 LOG.error("No args found: ", e);
-System.exit(1);
+return -1;
 } catch (ParseException e) {
 LOG.error("Could not parse: ", e);
-System.exit(1);
+return -1;
 }
 
 try {
 zkc = new ZkClient();
 zkc.connect();
 LOG.info("Connected to ZooKeeper");
 } catch (Exception e) {
-LOG.error(e);
-System.exit(1);
+LOG.error(e.getMessage(), e);
+return 1;
--- End diff --

Close zk connection while any connection exception happens. it's better to 
use specific Exception for zookeeper.


---


[GitHub] trafodion pull request #1427: TRAFODION-2940 In HA env, one node lose networ...

2018-03-06 Thread kevinxu021
Github user kevinxu021 commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1427#discussion_r172737467
  
--- Diff: dcs/src/main/java/org/trafodion/dcs/zookeeper/ZkClient.java ---
@@ -176,7 +208,19 @@ public ZooKeeper getZk() {
public void process(WatchedEvent event) {
if(event.getState() == Watcher.Event.KeeperState.SyncConnected) 
{
connectedSignal.countDown();
-   }
+   } else if (event.getState() == 
Watcher.Event.KeeperState.Expired) {
+LOG.info("session expired. now rebuilding");
+// session expired, may be never happending. but if it happen 
there
+// need to close old client and rebuild new client
+try {
+connect(true);
--- End diff --

In connect(...), I saw it was catch for zookeeper exception, how can get 
exception here?


---


[GitHub] trafodion pull request #1427: TRAFODION-2940 In HA env, one node lose networ...

2018-03-06 Thread kevinxu021
Github user kevinxu021 commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1427#discussion_r172736627
  
--- Diff: 
dcs/src/main/java/org/trafodion/dcs/master/listener/ListenerWorker.java ---
@@ -93,6 +93,7 @@ public void run() {
 try {
 queue.wait();
 } catch (InterruptedException e) {
+return;
--- End diff --

Log message for what happened by debug level.


---


[GitHub] trafodion pull request #1427: TRAFODION-2940 In HA env, one node lose networ...

2018-03-06 Thread kevinxu021
Github user kevinxu021 commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1427#discussion_r172736094
  
--- Diff: dcs/src/main/java/org/trafodion/dcs/master/FloatingIp.java ---
@@ -61,6 +61,43 @@ public boolean isEnabled() {
 return isEnabled;
 }
 
+public synchronized int unbindScript() throws Exception {
+if (isEnabled)
+LOG.info("Floating IP is enabled");
+else {
+LOG.info("Floating IP is disabled");
+return 0;
+}
+
+ScriptContext scriptContext = new ScriptContext();
+scriptContext.setScriptName(Constants.SYS_SHELL_SCRIPT_NAME);
+scriptContext.setStripStdOut(false);
+scriptContext.setStripStdErr(false);
+
+String command = 
master.getConfiguration().get(Constants.DCS_MASTER_FLOATING_IP_COMMAND_UNBIND,
+Constants.DEFAULT_DCS_MASTER_FLOATING_IP_COMMAND_UNBIND);
+
+scriptContext.setCommand(command);
+LOG.info("Unbind Floating IP [" + scriptContext.getCommand() + 
"]");
+ScriptManager.getInstance().runScript(scriptContext);// Blocking 
call
+
+StringBuilder sb = new StringBuilder();
+sb.append("exit code [" + scriptContext.getExitCode() + "]");
+if (!scriptContext.getStdOut().toString().isEmpty())
+sb.append(", stdout [" + scriptContext.getStdOut().toString() 
+ "]");
+if (!scriptContext.getStdErr().toString().isEmpty())
+sb.append(", stderr [" + scriptContext.getStdErr().toString() 
+ "]");
+if (LOG.isErrorEnabled())
+LOG.info(sb.toString());
+
+if (scriptContext.getExitCode() == 0)
+LOG.info("Unbind Floating IP successful");
+else
+LOG.error("Unbind Floating IP failed");
--- End diff --

It's better to print exit code.


---


[GitHub] trafodion pull request #1427: TRAFODION-2940 In HA env, one node lose networ...

2018-03-06 Thread kevinxu021
Github user kevinxu021 commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1427#discussion_r172737047
  
--- Diff: dcs/src/main/java/org/trafodion/dcs/zookeeper/ZkClient.java ---
@@ -176,7 +208,19 @@ public ZooKeeper getZk() {
public void process(WatchedEvent event) {
if(event.getState() == Watcher.Event.KeeperState.SyncConnected) 
{
connectedSignal.countDown();
-   }
+   } else if (event.getState() == 
Watcher.Event.KeeperState.Expired) {
+LOG.info("session expired. now rebuilding");
+// session expired, may be never happending. but if it happen 
there
+// need to close old client and rebuild new client
+try {
+connect(true);
+} catch (IOException e) {
+setSessionRecoverSuccessful(false);
+LOG.error("session expired and throw IOException while do 
reconnect: " + e.getMessage());
+} catch (InterruptedException e) {
+LOG.error("session expired and throw InterruptedException 
while do reconnect: " + e.getMessage());
--- End diff --

The same as above.


---


[GitHub] trafodion pull request #1427: TRAFODION-2940 In HA env, one node lose networ...

2018-03-06 Thread kevinxu021
Github user kevinxu021 commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1427#discussion_r172736968
  
--- Diff: dcs/src/main/java/org/trafodion/dcs/zookeeper/ZkClient.java ---
@@ -151,8 +163,28 @@ public void connect() throws IOException, 
InterruptedException {
this.zk=null;
throw new IOException("Cannot connect to 
Zookeeper");
}
-   
-   LOG.debug("Zookeeper.State=" + this.zk.getState());
+
+// Solve the forcible reconnection
+// When zk reconn, the backup-master may take over the master,
+// so current master should restart, and queues in 
/dcs/master/leader
+if (LOG.isDebugEnabled()) {
+LOG.debug("force = [" + force + "]. checkPath = [" + 
checkPath + "]");
+}
+if (force && checkPath != null) {
+try {
+Stat stat = zk.exists(checkPath, false);
+if (LOG.isDebugEnabled()) {
+LOG.debug("stat = [" + stat + "].");
+}
+if (stat == null) {
+// this means master has change.
+setSessionRecoverSuccessful(false);
+}
+} catch (KeeperException e) {
+e.printStackTrace();
--- End diff --

Log messages in file.


---


[GitHub] trafodion pull request #1427: TRAFODION-2940 In HA env, one node lose networ...

2018-03-06 Thread kevinxu021
Github user kevinxu021 commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1427#discussion_r172736542
  
--- Diff: 
dcs/src/main/java/org/trafodion/dcs/master/listener/ListenerService.java ---
@@ -263,14 +264,20 @@ else if ((key.interestOps() & SelectionKey.OP_WRITE) 
== SelectionKey.OP_WRITE) {
 }
 }
 }
+if (this.isInterrupted()) {
+throw new InterruptedException();
+}
 //gc();
 }
+} catch (InterruptedException e) {
 } catch (IOException e) {
 LOG.error(e);
 System.exit(1);
 } finally {
+LOG.info("close ServerSocketChannel...");
 if (server != null) {
 try {
+server.socket().close();
 server.close();
 } catch (IOException e) {
 e.printStackTrace();
--- End diff --

it's better to print the message into log file.


---


[GitHub] trafodion pull request #1526: [TRAFODION-3029]Initialize debug parameters

2018-04-18 Thread kevinxu021
GitHub user kevinxu021 opened a pull request:

https://github.com/apache/trafodion/pull/1526

[TRAFODION-3029]Initialize debug parameters



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

$ git pull https://github.com/kevinxu021/incubator-trafodion debugParams

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

https://github.com/apache/trafodion/pull/1526.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 #1526


commit 02a7d8c7cc78ca2b44ba6c50029fed172a952d9f
Author: kevinxu021 
Date:   2018-04-19T04:06:04Z

Initialize debug params




---


[GitHub] trafodion pull request #1556: [TRAFODION-3063]support one more date pattern ...

2018-05-08 Thread kevinxu021
GitHub user kevinxu021 opened a pull request:

https://github.com/apache/trafodion/pull/1556

[TRAFODION-3063]support one more date pattern '-MM-dd:.*'



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

$ git pull https://github.com/kevinxu021/incubator-trafodion a_t4date

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

https://github.com/apache/trafodion/pull/1556.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 #1556






---


[GitHub] trafodion pull request #1559: [TRAFODION-3067]Print out original exceptions ...

2018-05-10 Thread kevinxu021
GitHub user kevinxu021 opened a pull request:

https://github.com/apache/trafodion/pull/1559

[TRAFODION-3067]Print out original exceptions for cert error

Attach original error on customized exception. 

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

$ git pull https://github.com/kevinxu021/incubator-trafodion a_t4cert

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

https://github.com/apache/trafodion/pull/1559.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 #1559


commit 05bf784292fb2fb5aa2121b20ec4cdac1d2b9448
Author: Kevin Xu 
Date:   2018-05-10T07:40:15Z

Print out original exceptions for cert error




---


[GitHub] trafodion pull request #1573: [TRAFODION-3080For debug in IDE,find jar by de...

2018-05-22 Thread kevinxu021
GitHub user kevinxu021 opened a pull request:

https://github.com/apache/trafodion/pull/1573

[TRAFODION-3080For debug in IDE,find jar by default



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

$ git pull https://github.com/kevinxu021/incubator-trafodion trafciIns

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

https://github.com/apache/trafodion/pull/1573.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 #1573


commit 53d7f7affd802656186e02612bc62b149d8b664b
Author: Kevin Xu 
Date:   2018-05-23T03:37:33Z

For debug in IDE,find jar by default




---


[GitHub] trafodion pull request #1574: [TRAFODION-3081]Support debug mode whatever yo...

2018-05-23 Thread kevinxu021
GitHub user kevinxu021 opened a pull request:

https://github.com/apache/trafodion/pull/1574

[TRAFODION-3081]Support debug mode whatever you were on win/linux

Support profiles in JDBCT4 and Trafci which allows developer working with 
IDE.

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

$ git pull https://github.com/kevinxu021/incubator-trafodion mvnProfile

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

https://github.com/apache/trafodion/pull/1574.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 #1574


commit 5a3988c8e7e5592db382188438d65b73ab7e56fa
Author: Kevin Xu 
Date:   2018-05-23T07:36:36Z

Support debug mode whatever you were on win/linux




---


[GitHub] trafodion pull request #1577: Isolated folder for trafodion-sql

2018-05-23 Thread kevinxu021
GitHub user kevinxu021 opened a pull request:

https://github.com/apache/trafodion/pull/1577

Isolated folder for trafodion-sql 

Move trafodion-sql* into an isolated folder for easy maintain.

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

$ git pull https://github.com/kevinxu021/incubator-trafodion isoTrafsql

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

https://github.com/apache/trafodion/pull/1577.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 #1577


commit 26c5c7336a720ff341790c5f7d4b5e94cccd75bd
Author: Kevin Xu 
Date:   2018-05-23T23:30:28Z

Isolated folder for trafodion-sql




---


[GitHub] trafodion pull request #1751: [TRAFODION-3239]set LC_ALL and LANG in case en...

2018-11-29 Thread kevinxu021
GitHub user kevinxu021 opened a pull request:

https://github.com/apache/trafodion/pull/1751

[TRAFODION-3239]set LC_ALL and LANG in case encoding error



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

$ git pull https://github.com/kevinxu021/incubator-trafodion encoding

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

https://github.com/apache/trafodion/pull/1751.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 #1751


commit e16a49213a873ab02e08cbec4cb6674ae1532329
Author: trafodion 
Date:   2018-11-29T11:09:47Z

set LC_ALL and LANG in case encoding error




---


[GitHub] trafodion pull request #1752: [TRAFODION-3240]hbcheck, file exists issue

2018-11-29 Thread kevinxu021
GitHub user kevinxu021 opened a pull request:

https://github.com/apache/trafodion/pull/1752

[TRAFODION-3240]hbcheck, file exists issue

When you were executing hbcheck, you see an error saying "file exists" as 
the JIRA described. 

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

$ git pull https://github.com/kevinxu021/incubator-trafodion 
hbcheckFileExists

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

https://github.com/apache/trafodion/pull/1752.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 #1752


commit b067074b92404c2602a3ce82c023d57bf374caf7
Author: Kevin Xu 
Date:   2018-11-29T18:48:33Z

hbcheck, file exists issue




---


[GitHub] trafodion pull request #1753: [TRAFODION-3241]support both jdk1.7 and jdk1.8

2018-11-30 Thread kevinxu021
GitHub user kevinxu021 opened a pull request:

https://github.com/apache/trafodion/pull/1753

[TRAFODION-3241]support both jdk1.7 and jdk1.8

Previously, it doesnot support jdk1.8 because of site. Here use profile as 
a solution. By the way, to accelerate to the compilation speed, add if-else in 
Makefile that if you want to re-compile, please do make clean first. With my 
experiences, most of the time if the error is not in DCS/JDBC, you might not 
want to recompile this module.

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

$ git pull https://github.com/kevinxu021/incubator-trafodion javadoc

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

https://github.com/apache/trafodion/pull/1753.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 #1753


commit b1a5d7b38e4efbdfad607907783f908c71b202e9
Author: Kevin Xu 
Date:   2018-11-30T09:20:15Z

support both jdk1.7 and jdk1.8




---


[GitHub] trafodion pull request #1755: [TRAFODION-3242]Do not make again before MAKE ...

2018-11-30 Thread kevinxu021
GitHub user kevinxu021 opened a pull request:

https://github.com/apache/trafodion/pull/1755

[TRAFODION-3242]Do not make again before MAKE CLEAN

Accelerate to the building time. Usually, the issue is nothing about maven 
project, if it has nothing about that, the project should not be built again.
If you want to build specified project, you should do 'make clean' first.

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

$ git pull https://github.com/kevinxu021/incubator-trafodion makeclean

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

https://github.com/apache/trafodion/pull/1755.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 #1755


commit 32c2debbfce0b636ad3f7f2d03ba7acc25393ac1
Author: kevinxu021 
Date:   2018-11-30T16:51:14Z

Do not make again before MAKE CLEAN




---


[GitHub] trafodion pull request #1753: [TRAFODION-3241]support both jdk1.7 and jdk1.8

2018-12-07 Thread kevinxu021
Github user kevinxu021 commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1753#discussion_r239762073
  
--- Diff: core/conn/jdbcT4/Makefile ---
@@ -26,17 +26,20 @@ include ../../macros.gmk #top level
 all: build_all
 
 build_all: LICENSE NOTICE 
-   echo "$(MAVEN) package -DskipTests"
-   set -o pipefail && $(MAVEN) package -DskipTests | tee build_jdbct4.log 
| grep --line-buffered -E -e '^\[[^WId]' -e '^\[INFO\] B[Uu][Ii][Ll][Dd]' -e 
'to compile'
-   cp target/jdbcT4-${TRAFODION_VER}.jar ${TRAF_HOME}/export/lib
-   mkdir -p ../clients
-   mv target/jdbcT4-${TRAFODION_VER}.zip ../clients
-   #ln -sf ${TRAF_HOME}/export/lib/jdbcT4-${TRAFODION_VER}.jar 
${TRAF_HOME}/export/lib/jdbcT4.jar
-   `cd ${TRAF_HOME}/export/lib;ln -sf jdbcT4-${TRAFODION_VER}.jar 
jdbcT4.jar`
+   @if [ ! -f target/*.jar ]; then \
+   echo "$(MAVEN) install -DskipTests"; \
+   set -o pipefail && $(MAVEN) install -DskipTests | tee 
build_jdbct4.log | grep --line-buffered -E -e '^\[[^WId]' -e '^\[INFO\] 
B[Uu][Ii][Ll][Dd]' -e 'to compile'; \
+   cp target/jdbcT4-${TRAFODION_VER}.jar ${TRAF_HOME}/export/lib; \
+   mkdir -p ../clients; \
+   mv target/jdbcT4-${TRAFODION_VER}.zip ../clients; \
+   cd ${TRAF_HOME}/export/lib;ln -sf jdbcT4-${TRAFODION_VER}.jar 
jdbcT4.jar; \
+   fi
 
 clean:
-   -$(MAVEN) clean | grep ERROR
-   $(RM) build_jdbct4.log ${TRAF_HOME}/export/lib/jdbcT4*.jar
+   @if [ -f target/*.jar ]; then \
--- End diff --

The classes are in folder "target". if this folder does not exist, 'mvn 
clean' actually will do nothing. So here yes it should b -d target.


---


[GitHub] trafodion pull request #1753: [TRAFODION-3241]support both jdk1.7 and jdk1.8

2018-12-07 Thread kevinxu021
Github user kevinxu021 commented on a diff in the pull request:

https://github.com/apache/trafodion/pull/1753#discussion_r239761192
  
--- Diff: core/conn/jdbcT4/Makefile ---
@@ -26,17 +26,20 @@ include ../../macros.gmk #top level
 all: build_all
 
 build_all: LICENSE NOTICE 
-   echo "$(MAVEN) package -DskipTests"
-   set -o pipefail && $(MAVEN) package -DskipTests | tee build_jdbct4.log 
| grep --line-buffered -E -e '^\[[^WId]' -e '^\[INFO\] B[Uu][Ii][Ll][Dd]' -e 
'to compile'
-   cp target/jdbcT4-${TRAFODION_VER}.jar ${TRAF_HOME}/export/lib
-   mkdir -p ../clients
-   mv target/jdbcT4-${TRAFODION_VER}.zip ../clients
-   #ln -sf ${TRAF_HOME}/export/lib/jdbcT4-${TRAFODION_VER}.jar 
${TRAF_HOME}/export/lib/jdbcT4.jar
-   `cd ${TRAF_HOME}/export/lib;ln -sf jdbcT4-${TRAFODION_VER}.jar 
jdbcT4.jar`
+   @if [ ! -f target/*.jar ]; then \
--- End diff --

@narendragoyal @svarnau  sure, it should be an exactly name.


---