[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15176371#comment-15176371 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user asfgit closed the pull request at: https://github.com/apache/incubator-trafodion/pull/354 > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15176003#comment-15176003 ] ASF GitHub Bot commented on TRAFODION-1668: --- GitHub user svarnau opened a pull request: https://github.com/apache/incubator-trafodion/pull/354 [TRAFODION-1668] Emergency build fix The earlier pull request passed test, but then it was a long time before it merged. By time work for 1668 merged, it caused a build error. The branch is now broken for all builds without this small change. You can merge this pull request into a Git repository by running: $ git pull https://github.com/svarnau/incubator-trafodion fix1668 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-trafodion/pull/354.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 #354 commit 6b4db62477a80f2984fc6a6cfca1762ada1003fe Author: Steve Varnau Date: 2016-03-02T17:08:24Z [TRAFODION-1668] Emergency build fix The earlier pull request passed test, but then it was a long time before it merged. By time work for 1668 merged, it caused a build error. The branch is now broken for all builds without this small change. > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15174544#comment-15174544 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user asfgit closed the pull request at: https://github.com/apache/incubator-trafodion/pull/203 > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15173126#comment-15173126 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user zellerh commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r54516250 --- Diff: core/sql/lib_mgmt/src/main/resources/init_libmgmt.sh --- @@ -0,0 +1,196 @@ +#!/bin/bash +# @@@ 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 @@@ + +SERVER_JAR=${MY_SQROOT}/export/lib/lib_mgmt.jar +CI=sqlci +CATALOG_NAME=TRAFODION +LIB_SCHEMA="DB_LIBMGR" +DB__LIBMGRROLE=DB_LIBMGRROLE +LIB_NAME=LIBMGMTNAME + +function dropAndCreateSchema { +echo "Creating Schema for ${LIB_SCHEMA}" +${CI} << sqlciEOF + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'on'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'on'; + + DROP SCHEMA $CATALOG_NAME.$LIB_SCHEMA CLEANUP CASCADE; + CREATE SCHEMA $CATALOG_NAME.$LIB_SCHEMA; + set schema $CATALOG_NAME.$LIB_SCHEMA; + DROP LIBRARY ${LIB_NAME} CASCADE; + CREATE LIBRARY ${LIB_NAME} FILE '${SERVER_JAR}'; + CREATE ROLE ${DB__LIBMGRROLE}; + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'off'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'off'; + + exit; --- End diff -- Yes, this could add a bit of time to initialize trafodion, but I found that creating routines is relatively fast, because they don't create any HBase objects. So, I hope it should be fine. If we can avoid a separate initialization step for this it will be good. > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15173125#comment-15173125 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user zellerh commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r54516167 --- Diff: core/sql/lib_mgmt/src/main/resources/init_libmgmt.sh --- @@ -0,0 +1,206 @@ +#!/bin/bash +# @@@ 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 @@@ + +SERVER_JAR=${MY_SQROOT}/export/lib/lib_mgmt.jar +CI=sqlci +CATALOG_NAME=TRAFODION +LIB_SCHEMA="DB__LIBMGR" +DB__LIBMGRROLE=DB_LIBMGRROLE --- End diff -- Did you want it the other way round, one underscore on the left and two underscores on the right? Also change the code below where we reference ${DB__LIBMGRROLE}? > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15097715#comment-15097715 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user kevinxu021 commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r49692514 --- Diff: core/sql/lib_mgmt/src/main/resources/init_libmgmt.sh --- @@ -0,0 +1,196 @@ +#!/bin/bash +# @@@ 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 @@@ + +SERVER_JAR=${MY_SQROOT}/export/lib/lib_mgmt.jar +CI=sqlci +CATALOG_NAME=TRAFODION +LIB_SCHEMA="DB_LIBMGR" +DB__LIBMGRROLE=DB_LIBMGRROLE +LIB_NAME=LIBMGMTNAME + +function dropAndCreateSchema { +echo "Creating Schema for ${LIB_SCHEMA}" +${CI} << sqlciEOF + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'on'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'on'; + + DROP SCHEMA $CATALOG_NAME.$LIB_SCHEMA CLEANUP CASCADE; + CREATE SCHEMA $CATALOG_NAME.$LIB_SCHEMA; + set schema $CATALOG_NAME.$LIB_SCHEMA; + DROP LIBRARY ${LIB_NAME} CASCADE; + CREATE LIBRARY ${LIB_NAME} FILE '${SERVER_JAR}'; + CREATE ROLE ${DB__LIBMGRROLE}; + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'off'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'off'; + + exit; --- End diff -- Thanks. If this script could be running with "initialize trafodion" or with some options, it would be helpful. But it will slow initialization a little bit. Let's ask @zellerh for some comments. > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15097696#comment-15097696 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user kevinxu021 commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r49691664 --- Diff: core/sql/lib_mgmt/src/main/resources/init_libmgmt.sh --- @@ -0,0 +1,196 @@ +#!/bin/bash +# @@@ 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 @@@ + +SERVER_JAR=${MY_SQROOT}/export/lib/lib_mgmt.jar +CI=sqlci +CATALOG_NAME=TRAFODION +LIB_SCHEMA="DB_LIBMGR" +DB__LIBMGRROLE=DB_LIBMGRROLE +LIB_NAME=LIBMGMTNAME + +function dropAndCreateSchema { +echo "Creating Schema for ${LIB_SCHEMA}" +${CI} << sqlciEOF + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'on'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'on'; + + DROP SCHEMA $CATALOG_NAME.$LIB_SCHEMA CLEANUP CASCADE; + CREATE SCHEMA $CATALOG_NAME.$LIB_SCHEMA; + set schema $CATALOG_NAME.$LIB_SCHEMA; + DROP LIBRARY ${LIB_NAME} CASCADE; + CREATE LIBRARY ${LIB_NAME} FILE '${SERVER_JAR}'; + CREATE ROLE ${DB__LIBMGRROLE}; + --- End diff -- For role name, DB_LIBMGRROLE should be fine, since with prefix "DB__" cant be deleted. This project is working as a plugin which is nice to have. Schema name and role name might be modified. For the schema name, now it's back to double underscore because it's removable. > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15097684#comment-15097684 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user kevinxu021 commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r49691218 --- Diff: core/sql/lib_mgmt/README.rst --- @@ -0,0 +1,63 @@ +.. # @@@ 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 @@@ + += +Trafodion lib_mgmt README += + +How to build and initialize default SPJs + + Build +cd $MY_SQROOT/../sql/lib_mgmt +make clean && make all + + Initialization + +cds && ./init_libmgmt.sql + + SPJ Example + +DB_LIBMGR.HELP(INOUT COMMANDNAME VARCHAR) + +E.g. + +trafci>set param ?p1 help; + +trafci>call DB_LIBMGR.HELP(?p1) + +PUT - Upload a JAR. SHOWDDL PRODURE [SCHEMA NAME.]PUT for more info. + +LS - List JARs. SHOWDDL PRODURE [SCHEMA NAME.]LS for more info. + +LSALL - List all JARs. SHOWDDL PRODURE [SCHEMA NAME.]LSALL for more info. + +RM - Remove a JAR. SHOWDDL PRODURE [SCHEMA NAME.]RM for more info. + +RMREX - Remove JARs by a perticular pattern. SHOWDDL PRODURE [SCHEMA NAME.]RMREX for more info. + +GETFILE - Download a JAR. SHOWDDL PRODURE [SCHEMA NAME.]GETFILE for more info. + --- End diff -- Yes, typo issue. > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15096543#comment-15096543 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user robertamarton commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r49617919 --- Diff: core/sql/lib_mgmt/src/main/resources/init_libmgmt.sh --- @@ -0,0 +1,196 @@ +#!/bin/bash +# @@@ 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 @@@ + +SERVER_JAR=${MY_SQROOT}/export/lib/lib_mgmt.jar +CI=sqlci +CATALOG_NAME=TRAFODION +LIB_SCHEMA="DB_LIBMGR" +DB__LIBMGRROLE=DB_LIBMGRROLE +LIB_NAME=LIBMGMTNAME + +function dropAndCreateSchema { +echo "Creating Schema for ${LIB_SCHEMA}" +${CI} << sqlciEOF + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'on'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'on'; + + DROP SCHEMA $CATALOG_NAME.$LIB_SCHEMA CLEANUP CASCADE; + CREATE SCHEMA $CATALOG_NAME.$LIB_SCHEMA; + set schema $CATALOG_NAME.$LIB_SCHEMA; + DROP LIBRARY ${LIB_NAME} CASCADE; + CREATE LIBRARY ${LIB_NAME} FILE '${SERVER_JAR}'; + CREATE ROLE ${DB__LIBMGRROLE}; + --- End diff -- Apparently, git is removing the underscores, the name " (underscore)DB_LIBMGR(underscore)" > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15096539#comment-15096539 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user robertamarton commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r49617801 --- Diff: core/sql/lib_mgmt/src/main/resources/init_libmgmt.sh --- @@ -0,0 +1,196 @@ +#!/bin/bash +# @@@ 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 @@@ + +SERVER_JAR=${MY_SQROOT}/export/lib/lib_mgmt.jar +CI=sqlci +CATALOG_NAME=TRAFODION +LIB_SCHEMA="DB_LIBMGR" +DB__LIBMGRROLE=DB_LIBMGRROLE +LIB_NAME=LIBMGMTNAME + +function dropAndCreateSchema { +echo "Creating Schema for ${LIB_SCHEMA}" +${CI} << sqlciEOF + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'on'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'on'; + + DROP SCHEMA $CATALOG_NAME.$LIB_SCHEMA CLEANUP CASCADE; + CREATE SCHEMA $CATALOG_NAME.$LIB_SCHEMA; + set schema $CATALOG_NAME.$LIB_SCHEMA; + DROP LIBRARY ${LIB_NAME} CASCADE; + CREATE LIBRARY ${LIB_NAME} FILE '${SERVER_JAR}'; + CREATE ROLE ${DB__LIBMGRROLE}; + --- End diff -- For some reason the underscores disappeared - "_DB_LIBMGR_". > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15096523#comment-15096523 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user robertamarton commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r49616809 --- Diff: core/sql/lib_mgmt/src/main/resources/init_libmgmt.sh --- @@ -0,0 +1,196 @@ +#!/bin/bash +# @@@ 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 @@@ + +SERVER_JAR=${MY_SQROOT}/export/lib/lib_mgmt.jar +CI=sqlci +CATALOG_NAME=TRAFODION +LIB_SCHEMA="DB_LIBMGR" +DB__LIBMGRROLE=DB_LIBMGRROLE +LIB_NAME=LIBMGMTNAME + +function dropAndCreateSchema { +echo "Creating Schema for ${LIB_SCHEMA}" +${CI} << sqlciEOF + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'on'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'on'; + + DROP SCHEMA $CATALOG_NAME.$LIB_SCHEMA CLEANUP CASCADE; + CREATE SCHEMA $CATALOG_NAME.$LIB_SCHEMA; + set schema $CATALOG_NAME.$LIB_SCHEMA; + DROP LIBRARY ${LIB_NAME} CASCADE; + CREATE LIBRARY ${LIB_NAME} FILE '${SERVER_JAR}'; + CREATE ROLE ${DB__LIBMGRROLE}; + --- End diff -- Were we going to create the special schema starting with an underscore to make it a system owned schema? For example: "_DB_LIBMGR_"? Also, is DB_LIBMGRROLE a system role? If so, it should begin with "DB__" (2 underscores) to be compatible with other system defined roles. > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15096529#comment-15096529 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user robertamarton commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r49617157 --- Diff: core/sql/lib_mgmt/src/main/resources/init_libmgmt.sh --- @@ -0,0 +1,196 @@ +#!/bin/bash +# @@@ 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 @@@ + +SERVER_JAR=${MY_SQROOT}/export/lib/lib_mgmt.jar +CI=sqlci +CATALOG_NAME=TRAFODION +LIB_SCHEMA="DB_LIBMGR" +DB__LIBMGRROLE=DB_LIBMGRROLE +LIB_NAME=LIBMGMTNAME + +function dropAndCreateSchema { +echo "Creating Schema for ${LIB_SCHEMA}" +${CI} << sqlciEOF + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'on'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'on'; + + DROP SCHEMA $CATALOG_NAME.$LIB_SCHEMA CLEANUP CASCADE; + CREATE SCHEMA $CATALOG_NAME.$LIB_SCHEMA; + set schema $CATALOG_NAME.$LIB_SCHEMA; + DROP LIBRARY ${LIB_NAME} CASCADE; + CREATE LIBRARY ${LIB_NAME} FILE '${SERVER_JAR}'; + CREATE ROLE ${DB__LIBMGRROLE}; + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'off'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'off'; + + exit; --- End diff -- This does not concern your code change but if you want initialize/upgrade trafodion to create the the DB_LIBMGR schema, let me know. It looks like we may be supporting an upgrade. Also, if you want initialize/upgrade authorization to create the DB_LIBMGRROLE, I can add it also. I have been asked to add another system role so it would be simple enough to do. > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15096501#comment-15096501 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user robertamarton commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r49614912 --- Diff: core/sql/lib_mgmt/README.rst --- @@ -0,0 +1,63 @@ +.. # @@@ 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 @@@ + += +Trafodion lib_mgmt README += + +How to build and initialize default SPJs + + Build +cd $MY_SQROOT/../sql/lib_mgmt +make clean && make all + + Initialization + +cds && ./init_libmgmt.sql + + SPJ Example + +DB_LIBMGR.HELP(INOUT COMMANDNAME VARCHAR) + +E.g. + +trafci>set param ?p1 help; + +trafci>call DB_LIBMGR.HELP(?p1) + +PUT - Upload a JAR. SHOWDDL PRODURE [SCHEMA NAME.]PUT for more info. + +LS - List JARs. SHOWDDL PRODURE [SCHEMA NAME.]LS for more info. + +LSALL - List all JARs. SHOWDDL PRODURE [SCHEMA NAME.]LSALL for more info. + +RM - Remove a JAR. SHOWDDL PRODURE [SCHEMA NAME.]RM for more info. + +RMREX - Remove JARs by a perticular pattern. SHOWDDL PRODURE [SCHEMA NAME.]RMREX for more info. + +GETFILE - Download a JAR. SHOWDDL PRODURE [SCHEMA NAME.]GETFILE for more info. + --- End diff -- Should this say PROCEDURE instead of PRODURE? > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15084007#comment-15084007 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user hegdean commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r48908569 --- Diff: core/sql/lib_mgmt/README.rst --- @@ -0,0 +1,57 @@ +.. # @@@ 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 @@@ + += +Trafodion Core README += + +How to build and initialize default SPJs + + Build +cd $MY_SQROOT/../conn/spj_init --- End diff -- Please change the contents of this README to match directory/file name change > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15063156#comment-15063156 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user hegdean commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r47980817 --- Diff: core/conn/spj_mgmt/src/main/resources/init_spj.sh --- @@ -0,0 +1,155 @@ +#!/bin/bash +# @@@ 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 @@@ + +SERVER_JAR=${MY_SQROOT}/export/lib/spj_mgmt.jar +SQLCI=${MY_SQROOT}/export/bin32/sqlci --- End diff -- Is SQLCI being used? if not can you please remove it > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15063030#comment-15063030 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user hegdean commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r47974185 --- Diff: core/conn/spj_mgmt/src/main/java/org/trafodion/mgmt/JarFileMgmt.java --- @@ -0,0 +1,434 @@ +/** +* @@@ 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 @@@ + */ +package org.trafodion.mgmt; --- End diff -- can we call the package name same as the directory name org.trafodion.spjmgmt. > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15062939#comment-15062939 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user hegdean commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r47968093 --- Diff: core/conn/spj_mgmt/Makefile --- @@ -0,0 +1,37 @@ +# @@@ 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 @@@ + +LIBDIR := lib +JAVAC := $(JAVA_HOME)/bin/javac +INSTALL_LIBDIR := ${MY_SQROOT}/export/lib +INSTALL_SCRIPTSDIR := ${MY_SQROOT}/sql/scripts +CP :=/bin/cp -f +INSTALL_INCLUDEDIR := ${MY_SQROOT}/export/include --- End diff -- Do we need these 2 variables LIBDIR and INSTALL_INCLUDEDIR? > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15041818#comment-15041818 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user robertamarton commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46708044 --- Diff: core/conn/spj_init/src/main/resources/init_spj.sql --- @@ -0,0 +1,156 @@ +#!/bin/bash +# @@@ 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 @@@ + +SERVER_JAR=${MY_SQROOT}/export/lib/spj_init.jar +CI_SERVER_LOG=${MY_SQROOT}/ciserver/cislog +SQLCI=${MY_SQROOT}/export/bin32/sqlci +CP=/bin/cp +MANAGEABILITY_CATALOG=TRAFODION +CIS_SCHEMA=DEFAULT_SPJ + + +function dropAndCreateSchema { +echo "Creating Schema for CI Server Component" +sqlci << sqlciEOF + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'on'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'on'; + + DROP SCHEMA $MANAGEABILITY_CATALOG.$CIS_SCHEMA CASCADE; + CREATE SCHEMA $MANAGEABILITY_CATALOG.$CIS_SCHEMA; + --- End diff -- This relates to the role comment Hans made below. We could create a role and change the AUTHORIZATION clause to be the role. But this is only valid when authorization is enabled. So you need logic to handle to set the correct authorization clause and code is needed when authorization is enabled and disable to change the schema owner. I would, for simplicity, make DB__ROOT or DB__ROOTROLE the owner and require the user to set privileges to whatever role or user they want to manage privileges. > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15041808#comment-15041808 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user robertamarton commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46707640 --- Diff: core/conn/spj_init/src/main/resources/init_spj.sql --- @@ -0,0 +1,156 @@ +#!/bin/bash +# @@@ 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 @@@ + +SERVER_JAR=${MY_SQROOT}/export/lib/spj_init.jar +CI_SERVER_LOG=${MY_SQROOT}/ciserver/cislog +SQLCI=${MY_SQROOT}/export/bin32/sqlci +CP=/bin/cp +MANAGEABILITY_CATALOG=TRAFODION +CIS_SCHEMA=DEFAULT_SPJ + + +function dropAndCreateSchema { +echo "Creating Schema for CI Server Component" +sqlci << sqlciEOF + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'on'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'on'; + + DROP SCHEMA $MANAGEABILITY_CATALOG.$CIS_SCHEMA CASCADE; + CREATE SCHEMA $MANAGEABILITY_CATALOG.$CIS_SCHEMA; + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'off'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'off'; + + exit; +sqlciEOF +} + +function createProcedures { + +echo "Creating Procedures in schema '$MANAGEABILITY_CATALOG.$CIS_SCHEMA' " +sqlci << procEOF + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'on'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'on'; + + -- Creating Procedures + set schema $MANAGEABILITY_CATALOG.$CIS_SCHEMA; + + DROP LIBRARY SPJMGMT CASCADE; + CREATE LIBRARY SPJMGMT FILE '${SERVER_JAR}'; + + CREATE PROCEDURE HELP ( + INOUT COMMANDNAME VARCHAR(2560) CHARACTER SET ISO88591) + EXTERNAL NAME 'com.traf.mgmt.JarFileMgmt.help (java.lang.String[])' + EXTERNAL SECURITY DEFINER + LIBRARY SPJMGMT + LANGUAGE JAVA + PARAMETER STYLE JAVA + READS SQL DATA + ; + GRANT EXECUTE ON PROCEDURE HELP TO PUBLIC; + + CREATE PROCEDURE PUT ( + IN FILEDATA VARCHAR(102400) CHARACTER SET ISO88591, + IN FILENAME VARCHAR(256) CHARACTER SET ISO88591, + IN CREATEFLAG INTEGER) + EXTERNAL NAME 'com.traf.mgmt.JarFileMgmt.put(java.lang.String,java.lang.String,int)' + EXTERNAL SECURITY DEFINER + LIBRARY SPJMGMT + LANGUAGE JAVA + PARAMETER STYLE JAVA + READS SQL DATA + ; + GRANT EXECUTE ON PROCEDURE PUT TO PUBLIC; + + CREATE PROCEDURE LS ( + IN FILENAME VARCHAR(256) CHARACTER SET ISO88591, + OUT FILENAMES VARCHAR(10240) CHARACTER SET ISO88591) + EXTERNAL NAME 'com.traf.mgmt.JarFileMgmt.ls(java.lang.String,java.lang.String[])' + EXTERNAL SECURITY DEFINER + LIBRARY SPJMGMT + LANGUAGE JAVA + PARAMETER STYLE JAVA + READS SQL DATA + ; + GRANT EXECUTE ON PROCEDURE LS TO PUBLIC; + + CREATE PROCEDURE LSALL ( + OUT FILENAMES VARCHAR(10240) CHARACTER SET ISO88591) + EXTERNAL NAME 'com.traf.mgmt.JarFileMgmt.lsAll(java.lang.String[])' + EXTERNAL SECURITY DEFINER + LIBRARY SPJMGMT + LANGUAGE JAVA + PARAMETER STYLE JAVA + READS SQL DATA + ; + GRANT EXECUTE ON PROCEDURE LSALL TO PUBLIC; + + CREATE PROCEDURE RM ( + IN FILENAME VARCHAR(256) CHARACTER SET ISO88591) + EXTERNAL NAME 'com.traf.mgmt.JarFileMgmt.rm(java.lang.String)' + EXTERNAL SECURITY DEFINER + LIBRARY SPJMGMT + LANGUAGE JAVA + PARAMETER STYLE JAVA + READS SQL DATA + ; + GRANT EXECUTE ON PROCEDURE RM TO PUBLIC; + + CREATE PROCEDURE RMREX ( + IN FILENAME VARCHAR(256) CHARACTER SET ISO88591
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15041806#comment-15041806 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user robertamarton commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46707402 --- Diff: core/conn/spj_init/src/main/resources/init_spj.sql --- @@ -0,0 +1,156 @@ +#!/bin/bash +# @@@ 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 @@@ + +SERVER_JAR=${MY_SQROOT}/export/lib/spj_init.jar +CI_SERVER_LOG=${MY_SQROOT}/ciserver/cislog +SQLCI=${MY_SQROOT}/export/bin32/sqlci +CP=/bin/cp +MANAGEABILITY_CATALOG=TRAFODION +CIS_SCHEMA=DEFAULT_SPJ + + +function dropAndCreateSchema { +echo "Creating Schema for CI Server Component" +sqlci << sqlciEOF + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'on'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'on'; + + DROP SCHEMA $MANAGEABILITY_CATALOG.$CIS_SCHEMA CASCADE; + CREATE SCHEMA $MANAGEABILITY_CATALOG.$CIS_SCHEMA; + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'off'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'off'; + + exit; +sqlciEOF +} + +function createProcedures { + +echo "Creating Procedures in schema '$MANAGEABILITY_CATALOG.$CIS_SCHEMA' " +sqlci << procEOF + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'on'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'on'; + + -- Creating Procedures + set schema $MANAGEABILITY_CATALOG.$CIS_SCHEMA; + + DROP LIBRARY SPJMGMT CASCADE; + CREATE LIBRARY SPJMGMT FILE '${SERVER_JAR}'; + + CREATE PROCEDURE HELP ( + INOUT COMMANDNAME VARCHAR(2560) CHARACTER SET ISO88591) + EXTERNAL NAME 'com.traf.mgmt.JarFileMgmt.help (java.lang.String[])' + EXTERNAL SECURITY DEFINER + LIBRARY SPJMGMT + LANGUAGE JAVA + PARAMETER STYLE JAVA + READS SQL DATA + ; + GRANT EXECUTE ON PROCEDURE HELP TO PUBLIC; + + CREATE PROCEDURE PUT ( + IN FILEDATA VARCHAR(102400) CHARACTER SET ISO88591, + IN FILENAME VARCHAR(256) CHARACTER SET ISO88591, + IN CREATEFLAG INTEGER) + EXTERNAL NAME 'com.traf.mgmt.JarFileMgmt.put(java.lang.String,java.lang.String,int)' + EXTERNAL SECURITY DEFINER + LIBRARY SPJMGMT + LANGUAGE JAVA + PARAMETER STYLE JAVA + READS SQL DATA + ; + GRANT EXECUTE ON PROCEDURE PUT TO PUBLIC; + + CREATE PROCEDURE LS ( + IN FILENAME VARCHAR(256) CHARACTER SET ISO88591, + OUT FILENAMES VARCHAR(10240) CHARACTER SET ISO88591) + EXTERNAL NAME 'com.traf.mgmt.JarFileMgmt.ls(java.lang.String,java.lang.String[])' + EXTERNAL SECURITY DEFINER + LIBRARY SPJMGMT + LANGUAGE JAVA + PARAMETER STYLE JAVA + READS SQL DATA + ; + GRANT EXECUTE ON PROCEDURE LS TO PUBLIC; + + CREATE PROCEDURE LSALL ( + OUT FILENAMES VARCHAR(10240) CHARACTER SET ISO88591) + EXTERNAL NAME 'com.traf.mgmt.JarFileMgmt.lsAll(java.lang.String[])' + EXTERNAL SECURITY DEFINER + LIBRARY SPJMGMT + LANGUAGE JAVA + PARAMETER STYLE JAVA + READS SQL DATA + ; + GRANT EXECUTE ON PROCEDURE LSALL TO PUBLIC; + + CREATE PROCEDURE RM ( + IN FILENAME VARCHAR(256) CHARACTER SET ISO88591) + EXTERNAL NAME 'com.traf.mgmt.JarFileMgmt.rm(java.lang.String)' + EXTERNAL SECURITY DEFINER + LIBRARY SPJMGMT + LANGUAGE JAVA + PARAMETER STYLE JAVA + READS SQL DATA + ; + GRANT EXECUTE ON PROCEDURE RM TO PUBLIC; + + CREATE PROCEDURE RMREX ( + IN FILENAME VARCHAR(256) CHARACTER SET ISO88591
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15041210#comment-15041210 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user hegdean commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46655613 --- Diff: core/conn/spj_init/src/main/resources/init_spj.sql --- @@ -0,0 +1,156 @@ +#!/bin/bash +# @@@ 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 @@@ + +SERVER_JAR=${MY_SQROOT}/export/lib/spj_init.jar +CI_SERVER_LOG=${MY_SQROOT}/ciserver/cislog +SQLCI=${MY_SQROOT}/export/bin32/sqlci +CP=/bin/cp +MANAGEABILITY_CATALOG=TRAFODION +CIS_SCHEMA=DEFAULT_SPJ + + +function dropAndCreateSchema { +echo "Creating Schema for CI Server Component" --- End diff -- remove the echo statement or change the description > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15041211#comment-15041211 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user kevinxu021 commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46655636 --- Diff: core/conn/spj_init/Makefile --- @@ -0,0 +1,37 @@ +# @@@ 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 @@@ + +LIBDIR := lib +JAVAC := $(JAVA_HOME)/bin/javac +INSTALL_LIBDIR := ${MY_SQROOT}/export/lib +INSTALL_SCRIPTSDIR := ${MY_SQROOT}/sql/scripts +CP :=/bin/cp -f +INSTALL_INCLUDEDIR := ${MY_SQROOT}/export/include +all: + @$(MAVEN) package + ${CP} target/spj_init-*.jar ${INSTALL_LIBDIR}/spj_init.jar + ${CP} src/main/resources/init_spj.sql ${INSTALL_SCRIPTSDIR}/ + @chmod +x ${INSTALL_SCRIPTSDIR}/init_spj.sql +clean: + @rm ${INSTALL_LIBDIR}/spj_init.jar + @rm -f ${INSTALL_SCRIPTSDIR}/init_spj.sql + @$(MAVEN) clean +cleanall: clean --- End diff -- Yes, will link to top level Makefile > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15041208#comment-15041208 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user hegdean commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46655533 --- Diff: core/conn/spj_init/src/main/resources/init_spj.sql --- @@ -0,0 +1,156 @@ +#!/bin/bash +# @@@ 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 @@@ + +SERVER_JAR=${MY_SQROOT}/export/lib/spj_init.jar +CI_SERVER_LOG=${MY_SQROOT}/ciserver/cislog +SQLCI=${MY_SQROOT}/export/bin32/sqlci +CP=/bin/cp +MANAGEABILITY_CATALOG=TRAFODION --- End diff -- Can we change the name from MANAGEABILITY_CATALOG to something else(CATALOG_NAME) > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15041192#comment-15041192 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user kevinxu021 commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46655258 --- Diff: core/conn/spj_init/src/main/java/com/traf/mgmt/JarFileMgmt.java --- @@ -0,0 +1,435 @@ +/** +* @@@ 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 @@@ + */ +package com.traf.mgmt; --- End diff -- Good! Will be spjmgmt. > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15041193#comment-15041193 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user hegdean commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46655295 --- Diff: core/conn/spj_init/src/main/resources/init_spj.sql --- @@ -0,0 +1,156 @@ +#!/bin/bash +# @@@ 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 @@@ + +SERVER_JAR=${MY_SQROOT}/export/lib/spj_init.jar +CI_SERVER_LOG=${MY_SQROOT}/ciserver/cislog +SQLCI=${MY_SQROOT}/export/bin32/sqlci --- End diff -- remove CI_SERVER_LOG if not being used We don't build 32 bit anymore. Need to change it to 64 bit and reference debug or release version > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15041190#comment-15041190 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user kevinxu021 commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46655124 --- Diff: core/conn/spj_init/src/main/resources/init_spj.sql --- @@ -0,0 +1,156 @@ +#!/bin/bash +# @@@ 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 @@@ + +SERVER_JAR=${MY_SQROOT}/export/lib/spj_init.jar +CI_SERVER_LOG=${MY_SQROOT}/ciserver/cislog +SQLCI=${MY_SQROOT}/export/bin32/sqlci +CP=/bin/cp +MANAGEABILITY_CATALOG=TRAFODION +CIS_SCHEMA=DEFAULT_SPJ + + +function dropAndCreateSchema { +echo "Creating Schema for CI Server Component" +sqlci << sqlciEOF + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'on'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'on'; + + DROP SCHEMA $MANAGEABILITY_CATALOG.$CIS_SCHEMA CASCADE; + CREATE SCHEMA $MANAGEABILITY_CATALOG.$CIS_SCHEMA; + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'off'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'off'; + + exit; +sqlciEOF +} + +function createProcedures { + +echo "Creating Procedures in schema '$MANAGEABILITY_CATALOG.$CIS_SCHEMA' " +sqlci << procEOF + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'on'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'on'; + + -- Creating Procedures + set schema $MANAGEABILITY_CATALOG.$CIS_SCHEMA; + + DROP LIBRARY SPJMGMT CASCADE; + CREATE LIBRARY SPJMGMT FILE '${SERVER_JAR}'; + + CREATE PROCEDURE HELP ( + INOUT COMMANDNAME VARCHAR(2560) CHARACTER SET ISO88591) + EXTERNAL NAME 'com.traf.mgmt.JarFileMgmt.help (java.lang.String[])' + EXTERNAL SECURITY DEFINER + LIBRARY SPJMGMT + LANGUAGE JAVA + PARAMETER STYLE JAVA + READS SQL DATA + ; + GRANT EXECUTE ON PROCEDURE HELP TO PUBLIC; + + CREATE PROCEDURE PUT ( + IN FILEDATA VARCHAR(102400) CHARACTER SET ISO88591, + IN FILENAME VARCHAR(256) CHARACTER SET ISO88591, --- End diff -- Yes, a JAR name could be Chinese, but usually we don't do like that. Yes, Linux supports Chinese. Will make changes on it - CHARACTER SET UTF8 > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15041178#comment-15041178 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user hegdean commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46654649 --- Diff: core/conn/spj_init/Makefile --- @@ -0,0 +1,37 @@ +# @@@ 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 @@@ + +LIBDIR := lib +JAVAC := $(JAVA_HOME)/bin/javac +INSTALL_LIBDIR := ${MY_SQROOT}/export/lib +INSTALL_SCRIPTSDIR := ${MY_SQROOT}/sql/scripts +CP :=/bin/cp -f +INSTALL_INCLUDEDIR := ${MY_SQROOT}/export/include +all: + @$(MAVEN) package + ${CP} target/spj_init-*.jar ${INSTALL_LIBDIR}/spj_init.jar + ${CP} src/main/resources/init_spj.sql ${INSTALL_SCRIPTSDIR}/ + @chmod +x ${INSTALL_SCRIPTSDIR}/init_spj.sql +clean: + @rm ${INSTALL_LIBDIR}/spj_init.jar + @rm -f ${INSTALL_SCRIPTSDIR}/init_spj.sql + @$(MAVEN) clean +cleanall: clean --- End diff -- This needs to be incorporated to the top level Makefile. so spj mgmt jar files are built automatically when 'make all' is executed from the very top level > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15041175#comment-15041175 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user kevinxu021 commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46654556 --- Diff: core/conn/spj_init/src/main/resources/init_spj.sql --- @@ -0,0 +1,156 @@ +#!/bin/bash +# @@@ 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 @@@ + +SERVER_JAR=${MY_SQROOT}/export/lib/spj_init.jar +CI_SERVER_LOG=${MY_SQROOT}/ciserver/cislog +SQLCI=${MY_SQROOT}/export/bin32/sqlci +CP=/bin/cp +MANAGEABILITY_CATALOG=TRAFODION +CIS_SCHEMA=DEFAULT_SPJ + + +function dropAndCreateSchema { +echo "Creating Schema for CI Server Component" +sqlci << sqlciEOF + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'on'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'on'; + + DROP SCHEMA $MANAGEABILITY_CATALOG.$CIS_SCHEMA CASCADE; + CREATE SCHEMA $MANAGEABILITY_CATALOG.$CIS_SCHEMA; + --- End diff -- Whatever the user you want to manage the procedures. The following scripts will grant public privileged on procedures, then it can be performed by any user. > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15041166#comment-15041166 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user kevinxu021 commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46654189 --- Diff: core/conn/spj_init/src/main/resources/init_spj.sql --- @@ -0,0 +1,156 @@ +#!/bin/bash +# @@@ 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 @@@ + +SERVER_JAR=${MY_SQROOT}/export/lib/spj_init.jar +CI_SERVER_LOG=${MY_SQROOT}/ciserver/cislog +SQLCI=${MY_SQROOT}/export/bin32/sqlci +CP=/bin/cp +MANAGEABILITY_CATALOG=TRAFODION +CIS_SCHEMA=DEFAULT_SPJ + --- End diff -- Good point! Will change it. Rename to "_SPJ_". > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15041160#comment-15041160 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user hegdean commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46654057 --- Diff: core/conn/spj_init/src/main/java/com/traf/mgmt/JarFileMgmt.java --- @@ -0,0 +1,435 @@ +/** +* @@@ 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 @@@ + */ +package com.traf.mgmt; --- End diff -- Package name needs to be changed from com.traf to org.trafodion.spj. > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15041161#comment-15041161 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user kevinxu021 commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46654067 --- Diff: core/conn/spj_init/src/main/java/com/traf/mgmt/JarFileMgmt.java --- @@ -0,0 +1,435 @@ +/** +* @@@ 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 @@@ + */ +package com.traf.mgmt; + +import java.io.File; +import java.io.FileFilter; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xerial.snappy.Snappy; + +public class JarFileMgmt { + private static final Logger LOG = LoggerFactory.getLogger(JarFileMgmt.class); + private static final String url = "jdbc:default:connection"; + // 100Mb + private static final long MAX_JAR_FILE_SIZE = 104857600; + private static final SimpleDateFormat format = new SimpleDateFormat("-MM-dd HH:mm:ss"); + private static final int MaxDataSize = 102400; + private static final String CHARTSET = "ISO-8859-1"; + + /** +* Print help info +* +* @param helps: +*INOUT parameter like PUT/LS/... +*/ + public static void help(String[] helps) { + String[] help = new String[] { + "PUT - Upload a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.PUT for more info.", + "LS - List JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LS for more info.", + "LSALL - List all JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LSALL for more info.", + "RM - Remove a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.RM for more info.", + "RMREX - Remove JARs by a perticular pattern. SHOWDDL PROCEDURE DEFAULT_SPJ.RMREX for more info.", + "GETFILE - Download a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.GETFILE for more info." + }; + List index = new ArrayList(help.length); + index.add("PUT"); + index.add("LS"); + index.add("LSALL"); + index.add("RM"); + index.add("RMREX"); + index.add("GETFILE"); + String tmp = helps[0].trim().toUpperCase(); + helps[0] = "HELP:\r\n"; + switch (index.indexOf(tmp)) { + case 0: + helps[0] = help[0]; + break; + case 1: + helps[0] = help[1]; + break; + case 2: + helps[0] = help[2]; + break; + case 3: + helps[0] = help[3]; + break; + case 4: + helps[0] = help[4]; + break; + case 5: + helps[0] = help[5]; + break; + default: + for (String h : help) { + helps[0] += h + "\r\n"; + } + + } + + } + + public static void syncJar(String userPath, String fileName) throws SQLException, IOException { + checkFileName(fileName); + LOG.info("syncJars " + fileName); + String no
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15040808#comment-15040808 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user kevinxu021 commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46652998 --- Diff: core/conn/spj_init/src/main/java/com/traf/mgmt/JarFileMgmt.java --- @@ -0,0 +1,435 @@ +/** +* @@@ 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 @@@ + */ +package com.traf.mgmt; + +import java.io.File; +import java.io.FileFilter; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xerial.snappy.Snappy; + +public class JarFileMgmt { + private static final Logger LOG = LoggerFactory.getLogger(JarFileMgmt.class); + private static final String url = "jdbc:default:connection"; + // 100Mb + private static final long MAX_JAR_FILE_SIZE = 104857600; + private static final SimpleDateFormat format = new SimpleDateFormat("-MM-dd HH:mm:ss"); + private static final int MaxDataSize = 102400; + private static final String CHARTSET = "ISO-8859-1"; + + /** +* Print help info +* +* @param helps: +*INOUT parameter like PUT/LS/... +*/ + public static void help(String[] helps) { + String[] help = new String[] { + "PUT - Upload a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.PUT for more info.", + "LS - List JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LS for more info.", + "LSALL - List all JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LSALL for more info.", + "RM - Remove a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.RM for more info.", + "RMREX - Remove JARs by a perticular pattern. SHOWDDL PROCEDURE DEFAULT_SPJ.RMREX for more info.", + "GETFILE - Download a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.GETFILE for more info." + }; + List index = new ArrayList(help.length); + index.add("PUT"); + index.add("LS"); + index.add("LSALL"); + index.add("RM"); + index.add("RMREX"); + index.add("GETFILE"); + String tmp = helps[0].trim().toUpperCase(); + helps[0] = "HELP:\r\n"; + switch (index.indexOf(tmp)) { + case 0: + helps[0] = help[0]; + break; + case 1: + helps[0] = help[1]; + break; + case 2: + helps[0] = help[2]; + break; + case 3: + helps[0] = help[3]; + break; + case 4: + helps[0] = help[4]; + break; + case 5: + helps[0] = help[5]; + break; + default: + for (String h : help) { + helps[0] += h + "\r\n"; + } + + } + + } + + public static void syncJar(String userPath, String fileName) throws SQLException, IOException { + checkFileName(fileName); + LOG.info("syncJars " + fileName); + String no
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15040803#comment-15040803 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user kevinxu021 commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46652928 --- Diff: core/conn/spj_init/src/main/java/com/traf/mgmt/JarFileMgmt.java --- @@ -0,0 +1,435 @@ +/** +* @@@ 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 @@@ + */ +package com.traf.mgmt; + +import java.io.File; +import java.io.FileFilter; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xerial.snappy.Snappy; + +public class JarFileMgmt { + private static final Logger LOG = LoggerFactory.getLogger(JarFileMgmt.class); + private static final String url = "jdbc:default:connection"; + // 100Mb + private static final long MAX_JAR_FILE_SIZE = 104857600; + private static final SimpleDateFormat format = new SimpleDateFormat("-MM-dd HH:mm:ss"); + private static final int MaxDataSize = 102400; + private static final String CHARTSET = "ISO-8859-1"; + + /** +* Print help info +* +* @param helps: +*INOUT parameter like PUT/LS/... +*/ + public static void help(String[] helps) { + String[] help = new String[] { + "PUT - Upload a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.PUT for more info.", + "LS - List JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LS for more info.", + "LSALL - List all JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LSALL for more info.", + "RM - Remove a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.RM for more info.", + "RMREX - Remove JARs by a perticular pattern. SHOWDDL PROCEDURE DEFAULT_SPJ.RMREX for more info.", + "GETFILE - Download a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.GETFILE for more info." + }; + List index = new ArrayList(help.length); + index.add("PUT"); + index.add("LS"); + index.add("LSALL"); + index.add("RM"); + index.add("RMREX"); + index.add("GETFILE"); + String tmp = helps[0].trim().toUpperCase(); + helps[0] = "HELP:\r\n"; + switch (index.indexOf(tmp)) { + case 0: + helps[0] = help[0]; + break; + case 1: + helps[0] = help[1]; + break; + case 2: + helps[0] = help[2]; + break; + case 3: + helps[0] = help[3]; + break; + case 4: + helps[0] = help[4]; + break; + case 5: + helps[0] = help[5]; + break; + default: + for (String h : help) { + helps[0] += h + "\r\n"; + } + + } + + } + + public static void syncJar(String userPath, String fileName) throws SQLException, IOException { + checkFileName(fileName); + LOG.info("syncJars " + fileName); + String no
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15040801#comment-15040801 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user kevinxu021 commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46652845 --- Diff: core/conn/spj_init/README.md --- @@ -0,0 +1,24 @@ +##How to build and initialize default SPJs +###Build +``` +cd $MY_SQROOT/../conn/spj_init +make clean && make all +``` +###Initialization +``` +cds +./init_spj.sql +``` +###SPJ Example +``` +DEFAULT_SPJ.HELP(INOUT COMMANDNAME VARCHAR) +E.g. +trafci>set param ?p1 help; +trafci>call DEFAULT_SPJ.HELP(?p1) +PUT - Upload a JAR. SHOWDDL PRODURE DEFAULT_SPJ.PUT for more info. +LS - List JARs. SHOWDDL PRODURE DEFAULT_SPJ.LS for more info. +LSALL - List all JARs. SHOWDDL PRODURE DEFAULT_SPJ.LSALL for more info. +RM - Remove a JAR. SHOWDDL PRODURE DEFAULT_SPJ.RM for more info. +RMREX - Remove JARs by a perticular pattern. SHOWDDL PRODURE DEFAULT_SPJ.RMREX for more info. +GETFILE - Upload a JAR. SHOWDDL PRODURE DEFAULT_SPJ.GETFILE for more info. +``` --- End diff -- For build, Trafodion ID is not require. But the only required thing is to upload the jar into every node on cluster for "create library". And Trafodion ID should have READ permission on the JAR. For initialization, anywhere SQLCI is available, whatever it's Tafodion ID. By the way, sqlci can be replaced by trafci, then it can be initialized on client-side. > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15039681#comment-15039681 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user kevinxu021 commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46645055 --- Diff: core/conn/spj_init/src/main/java/com/traf/mgmt/JarFileMgmt.java --- @@ -0,0 +1,435 @@ +/** +* @@@ 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 @@@ + */ +package com.traf.mgmt; + +import java.io.File; +import java.io.FileFilter; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xerial.snappy.Snappy; + +public class JarFileMgmt { + private static final Logger LOG = LoggerFactory.getLogger(JarFileMgmt.class); + private static final String url = "jdbc:default:connection"; + // 100Mb + private static final long MAX_JAR_FILE_SIZE = 104857600; + private static final SimpleDateFormat format = new SimpleDateFormat("-MM-dd HH:mm:ss"); + private static final int MaxDataSize = 102400; + private static final String CHARTSET = "ISO-8859-1"; + + /** +* Print help info +* +* @param helps: +*INOUT parameter like PUT/LS/... +*/ + public static void help(String[] helps) { + String[] help = new String[] { + "PUT - Upload a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.PUT for more info.", + "LS - List JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LS for more info.", + "LSALL - List all JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LSALL for more info.", + "RM - Remove a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.RM for more info.", + "RMREX - Remove JARs by a perticular pattern. SHOWDDL PROCEDURE DEFAULT_SPJ.RMREX for more info.", + "GETFILE - Download a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.GETFILE for more info." + }; + List index = new ArrayList(help.length); + index.add("PUT"); + index.add("LS"); + index.add("LSALL"); + index.add("RM"); + index.add("RMREX"); + index.add("GETFILE"); + String tmp = helps[0].trim().toUpperCase(); + helps[0] = "HELP:\r\n"; + switch (index.indexOf(tmp)) { + case 0: + helps[0] = help[0]; + break; + case 1: + helps[0] = help[1]; + break; + case 2: + helps[0] = help[2]; + break; + case 3: + helps[0] = help[3]; + break; + case 4: + helps[0] = help[4]; + break; + case 5: + helps[0] = help[5]; + break; + default: + for (String h : help) { + helps[0] += h + "\r\n"; + } + + } + + } + + public static void syncJar(String userPath, String fileName) throws SQLException, IOException { + checkFileName(fileName); + LOG.info("syncJars " + fileName); + String no
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15039676#comment-15039676 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user zellerh commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46644943 --- Diff: core/conn/spj_init/src/main/resources/init_spj.sql --- @@ -0,0 +1,156 @@ +#!/bin/bash +# @@@ 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 @@@ + +SERVER_JAR=${MY_SQROOT}/export/lib/spj_init.jar +CI_SERVER_LOG=${MY_SQROOT}/ciserver/cislog +SQLCI=${MY_SQROOT}/export/bin32/sqlci +CP=/bin/cp +MANAGEABILITY_CATALOG=TRAFODION +CIS_SCHEMA=DEFAULT_SPJ + + +function dropAndCreateSchema { +echo "Creating Schema for CI Server Component" +sqlci << sqlciEOF + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'on'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'on'; + + DROP SCHEMA $MANAGEABILITY_CATALOG.$CIS_SCHEMA CASCADE; + CREATE SCHEMA $MANAGEABILITY_CATALOG.$CIS_SCHEMA; + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'off'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'off'; + + exit; +sqlciEOF +} + +function createProcedures { + +echo "Creating Procedures in schema '$MANAGEABILITY_CATALOG.$CIS_SCHEMA' " +sqlci << procEOF + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'on'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'on'; + + -- Creating Procedures + set schema $MANAGEABILITY_CATALOG.$CIS_SCHEMA; + + DROP LIBRARY SPJMGMT CASCADE; + CREATE LIBRARY SPJMGMT FILE '${SERVER_JAR}'; + + CREATE PROCEDURE HELP ( + INOUT COMMANDNAME VARCHAR(2560) CHARACTER SET ISO88591) + EXTERNAL NAME 'com.traf.mgmt.JarFileMgmt.help (java.lang.String[])' + EXTERNAL SECURITY DEFINER + LIBRARY SPJMGMT + LANGUAGE JAVA + PARAMETER STYLE JAVA + READS SQL DATA + ; + GRANT EXECUTE ON PROCEDURE HELP TO PUBLIC; + + CREATE PROCEDURE PUT ( + IN FILEDATA VARCHAR(102400) CHARACTER SET ISO88591, + IN FILENAME VARCHAR(256) CHARACTER SET ISO88591, + IN CREATEFLAG INTEGER) + EXTERNAL NAME 'com.traf.mgmt.JarFileMgmt.put(java.lang.String,java.lang.String,int)' + EXTERNAL SECURITY DEFINER + LIBRARY SPJMGMT + LANGUAGE JAVA + PARAMETER STYLE JAVA + READS SQL DATA + ; + GRANT EXECUTE ON PROCEDURE PUT TO PUBLIC; + + CREATE PROCEDURE LS ( + IN FILENAME VARCHAR(256) CHARACTER SET ISO88591, + OUT FILENAMES VARCHAR(10240) CHARACTER SET ISO88591) + EXTERNAL NAME 'com.traf.mgmt.JarFileMgmt.ls(java.lang.String,java.lang.String[])' + EXTERNAL SECURITY DEFINER + LIBRARY SPJMGMT + LANGUAGE JAVA + PARAMETER STYLE JAVA + READS SQL DATA + ; + GRANT EXECUTE ON PROCEDURE LS TO PUBLIC; + + CREATE PROCEDURE LSALL ( + OUT FILENAMES VARCHAR(10240) CHARACTER SET ISO88591) + EXTERNAL NAME 'com.traf.mgmt.JarFileMgmt.lsAll(java.lang.String[])' + EXTERNAL SECURITY DEFINER + LIBRARY SPJMGMT + LANGUAGE JAVA + PARAMETER STYLE JAVA + READS SQL DATA + ; + GRANT EXECUTE ON PROCEDURE LSALL TO PUBLIC; + + CREATE PROCEDURE RM ( + IN FILENAME VARCHAR(256) CHARACTER SET ISO88591) + EXTERNAL NAME 'com.traf.mgmt.JarFileMgmt.rm(java.lang.String)' + EXTERNAL SECURITY DEFINER + LIBRARY SPJMGMT + LANGUAGE JAVA + PARAMETER STYLE JAVA + READS SQL DATA + ; + GRANT EXECUTE ON PROCEDURE RM TO PUBLIC; + + CREATE PROCEDURE RMREX ( + IN FILENAME VARCHAR(256) CHARACTER SET ISO88591,
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15039672#comment-15039672 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user kevinxu021 commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46644804 --- Diff: core/conn/spj_init/src/main/java/com/traf/mgmt/JarFileMgmt.java --- @@ -0,0 +1,435 @@ +/** +* @@@ 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 @@@ + */ +package com.traf.mgmt; + +import java.io.File; +import java.io.FileFilter; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xerial.snappy.Snappy; + +public class JarFileMgmt { + private static final Logger LOG = LoggerFactory.getLogger(JarFileMgmt.class); + private static final String url = "jdbc:default:connection"; + // 100Mb + private static final long MAX_JAR_FILE_SIZE = 104857600; + private static final SimpleDateFormat format = new SimpleDateFormat("-MM-dd HH:mm:ss"); + private static final int MaxDataSize = 102400; + private static final String CHARTSET = "ISO-8859-1"; + + /** +* Print help info +* +* @param helps: +*INOUT parameter like PUT/LS/... +*/ + public static void help(String[] helps) { + String[] help = new String[] { + "PUT - Upload a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.PUT for more info.", + "LS - List JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LS for more info.", + "LSALL - List all JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LSALL for more info.", + "RM - Remove a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.RM for more info.", + "RMREX - Remove JARs by a perticular pattern. SHOWDDL PROCEDURE DEFAULT_SPJ.RMREX for more info.", + "GETFILE - Download a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.GETFILE for more info." + }; + List index = new ArrayList(help.length); + index.add("PUT"); + index.add("LS"); + index.add("LSALL"); + index.add("RM"); + index.add("RMREX"); + index.add("GETFILE"); + String tmp = helps[0].trim().toUpperCase(); + helps[0] = "HELP:\r\n"; + switch (index.indexOf(tmp)) { + case 0: + helps[0] = help[0]; + break; + case 1: + helps[0] = help[1]; + break; + case 2: + helps[0] = help[2]; + break; + case 3: + helps[0] = help[3]; + break; + case 4: + helps[0] = help[4]; + break; + case 5: + helps[0] = help[5]; + break; + default: + for (String h : help) { + helps[0] += h + "\r\n"; + } + + } + + } + + public static void syncJar(String userPath, String fileName) throws SQLException, IOException { + checkFileName(fileName); + LOG.info("syncJars " + fileName); + String no
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15039669#comment-15039669 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user zellerh commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46644712 --- Diff: core/conn/spj_init/src/main/java/com/traf/mgmt/JarFileMgmt.java --- @@ -0,0 +1,435 @@ +/** +* @@@ 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 @@@ + */ +package com.traf.mgmt; + +import java.io.File; +import java.io.FileFilter; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xerial.snappy.Snappy; + +public class JarFileMgmt { + private static final Logger LOG = LoggerFactory.getLogger(JarFileMgmt.class); + private static final String url = "jdbc:default:connection"; + // 100Mb + private static final long MAX_JAR_FILE_SIZE = 104857600; + private static final SimpleDateFormat format = new SimpleDateFormat("-MM-dd HH:mm:ss"); + private static final int MaxDataSize = 102400; + private static final String CHARTSET = "ISO-8859-1"; + + /** +* Print help info +* +* @param helps: +*INOUT parameter like PUT/LS/... +*/ + public static void help(String[] helps) { + String[] help = new String[] { + "PUT - Upload a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.PUT for more info.", + "LS - List JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LS for more info.", + "LSALL - List all JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LSALL for more info.", + "RM - Remove a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.RM for more info.", + "RMREX - Remove JARs by a perticular pattern. SHOWDDL PROCEDURE DEFAULT_SPJ.RMREX for more info.", + "GETFILE - Download a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.GETFILE for more info." + }; + List index = new ArrayList(help.length); + index.add("PUT"); + index.add("LS"); + index.add("LSALL"); + index.add("RM"); + index.add("RMREX"); + index.add("GETFILE"); + String tmp = helps[0].trim().toUpperCase(); + helps[0] = "HELP:\r\n"; + switch (index.indexOf(tmp)) { + case 0: + helps[0] = help[0]; + break; + case 1: + helps[0] = help[1]; + break; + case 2: + helps[0] = help[2]; + break; + case 3: + helps[0] = help[3]; + break; + case 4: + helps[0] = help[4]; + break; + case 5: + helps[0] = help[5]; + break; + default: + for (String h : help) { + helps[0] += h + "\r\n"; + } + + } + + } + + public static void syncJar(String userPath, String fileName) throws SQLException, IOException { + checkFileName(fileName); + LOG.info("syncJars " + fileName); + String nodes
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15039664#comment-15039664 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user zellerh commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46644535 --- Diff: core/conn/spj_init/src/main/java/com/traf/mgmt/JarFileMgmt.java --- @@ -0,0 +1,435 @@ +/** +* @@@ 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 @@@ + */ +package com.traf.mgmt; + +import java.io.File; +import java.io.FileFilter; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xerial.snappy.Snappy; + +public class JarFileMgmt { + private static final Logger LOG = LoggerFactory.getLogger(JarFileMgmt.class); + private static final String url = "jdbc:default:connection"; + // 100Mb + private static final long MAX_JAR_FILE_SIZE = 104857600; + private static final SimpleDateFormat format = new SimpleDateFormat("-MM-dd HH:mm:ss"); + private static final int MaxDataSize = 102400; + private static final String CHARTSET = "ISO-8859-1"; + + /** +* Print help info +* +* @param helps: +*INOUT parameter like PUT/LS/... +*/ + public static void help(String[] helps) { + String[] help = new String[] { + "PUT - Upload a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.PUT for more info.", + "LS - List JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LS for more info.", + "LSALL - List all JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LSALL for more info.", + "RM - Remove a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.RM for more info.", + "RMREX - Remove JARs by a perticular pattern. SHOWDDL PROCEDURE DEFAULT_SPJ.RMREX for more info.", + "GETFILE - Download a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.GETFILE for more info." + }; + List index = new ArrayList(help.length); + index.add("PUT"); + index.add("LS"); + index.add("LSALL"); + index.add("RM"); + index.add("RMREX"); + index.add("GETFILE"); + String tmp = helps[0].trim().toUpperCase(); + helps[0] = "HELP:\r\n"; + switch (index.indexOf(tmp)) { + case 0: + helps[0] = help[0]; + break; + case 1: + helps[0] = help[1]; + break; + case 2: + helps[0] = help[2]; + break; + case 3: + helps[0] = help[3]; + break; + case 4: + helps[0] = help[4]; + break; + case 5: + helps[0] = help[5]; + break; + default: + for (String h : help) { + helps[0] += h + "\r\n"; + } + + } + + } + + public static void syncJar(String userPath, String fileName) throws SQLException, IOException { + checkFileName(fileName); + LOG.info("syncJars " + fileName); + String nodes
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15039658#comment-15039658 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user zellerh commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46644336 --- Diff: core/conn/spj_init/src/main/java/com/traf/mgmt/JarFileMgmt.java --- @@ -0,0 +1,435 @@ +/** +* @@@ 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 @@@ + */ +package com.traf.mgmt; + +import java.io.File; +import java.io.FileFilter; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xerial.snappy.Snappy; + +public class JarFileMgmt { + private static final Logger LOG = LoggerFactory.getLogger(JarFileMgmt.class); + private static final String url = "jdbc:default:connection"; + // 100Mb + private static final long MAX_JAR_FILE_SIZE = 104857600; + private static final SimpleDateFormat format = new SimpleDateFormat("-MM-dd HH:mm:ss"); + private static final int MaxDataSize = 102400; + private static final String CHARTSET = "ISO-8859-1"; + + /** +* Print help info +* +* @param helps: +*INOUT parameter like PUT/LS/... +*/ + public static void help(String[] helps) { + String[] help = new String[] { + "PUT - Upload a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.PUT for more info.", + "LS - List JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LS for more info.", + "LSALL - List all JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LSALL for more info.", + "RM - Remove a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.RM for more info.", + "RMREX - Remove JARs by a perticular pattern. SHOWDDL PROCEDURE DEFAULT_SPJ.RMREX for more info.", + "GETFILE - Download a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.GETFILE for more info." + }; + List index = new ArrayList(help.length); + index.add("PUT"); + index.add("LS"); + index.add("LSALL"); + index.add("RM"); + index.add("RMREX"); + index.add("GETFILE"); + String tmp = helps[0].trim().toUpperCase(); + helps[0] = "HELP:\r\n"; + switch (index.indexOf(tmp)) { + case 0: + helps[0] = help[0]; + break; + case 1: + helps[0] = help[1]; + break; + case 2: + helps[0] = help[2]; + break; + case 3: + helps[0] = help[3]; + break; + case 4: + helps[0] = help[4]; + break; + case 5: + helps[0] = help[5]; + break; + default: + for (String h : help) { + helps[0] += h + "\r\n"; + } + + } + + } + + public static void syncJar(String userPath, String fileName) throws SQLException, IOException { + checkFileName(fileName); + LOG.info("syncJars " + fileName); + String nodes
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15039654#comment-15039654 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user kevinxu021 commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46644087 --- Diff: core/conn/spj_init/src/main/java/com/traf/mgmt/JarFileMgmt.java --- @@ -0,0 +1,435 @@ +/** +* @@@ 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 @@@ + */ +package com.traf.mgmt; + +import java.io.File; +import java.io.FileFilter; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xerial.snappy.Snappy; + +public class JarFileMgmt { + private static final Logger LOG = LoggerFactory.getLogger(JarFileMgmt.class); + private static final String url = "jdbc:default:connection"; + // 100Mb + private static final long MAX_JAR_FILE_SIZE = 104857600; + private static final SimpleDateFormat format = new SimpleDateFormat("-MM-dd HH:mm:ss"); + private static final int MaxDataSize = 102400; + private static final String CHARTSET = "ISO-8859-1"; + + /** +* Print help info +* +* @param helps: +*INOUT parameter like PUT/LS/... +*/ + public static void help(String[] helps) { + String[] help = new String[] { + "PUT - Upload a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.PUT for more info.", + "LS - List JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LS for more info.", + "LSALL - List all JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LSALL for more info.", + "RM - Remove a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.RM for more info.", + "RMREX - Remove JARs by a perticular pattern. SHOWDDL PROCEDURE DEFAULT_SPJ.RMREX for more info.", + "GETFILE - Download a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.GETFILE for more info." + }; + List index = new ArrayList(help.length); + index.add("PUT"); + index.add("LS"); + index.add("LSALL"); + index.add("RM"); + index.add("RMREX"); + index.add("GETFILE"); + String tmp = helps[0].trim().toUpperCase(); + helps[0] = "HELP:\r\n"; + switch (index.indexOf(tmp)) { + case 0: + helps[0] = help[0]; + break; + case 1: + helps[0] = help[1]; + break; + case 2: + helps[0] = help[2]; + break; + case 3: + helps[0] = help[3]; + break; + case 4: + helps[0] = help[4]; + break; + case 5: + helps[0] = help[5]; + break; + default: + for (String h : help) { + helps[0] += h + "\r\n"; + } + + } + + } + + public static void syncJar(String userPath, String fileName) throws SQLException, IOException { + checkFileName(fileName); + LOG.info("syncJars " + fileName); + String no
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15039646#comment-15039646 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user kevinxu021 commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46643888 --- Diff: core/conn/spj_init/src/main/java/com/traf/mgmt/JarFileMgmt.java --- @@ -0,0 +1,435 @@ +/** +* @@@ 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 @@@ + */ +package com.traf.mgmt; + +import java.io.File; +import java.io.FileFilter; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xerial.snappy.Snappy; + +public class JarFileMgmt { + private static final Logger LOG = LoggerFactory.getLogger(JarFileMgmt.class); + private static final String url = "jdbc:default:connection"; + // 100Mb + private static final long MAX_JAR_FILE_SIZE = 104857600; + private static final SimpleDateFormat format = new SimpleDateFormat("-MM-dd HH:mm:ss"); + private static final int MaxDataSize = 102400; + private static final String CHARTSET = "ISO-8859-1"; + + /** +* Print help info +* +* @param helps: +*INOUT parameter like PUT/LS/... +*/ + public static void help(String[] helps) { + String[] help = new String[] { + "PUT - Upload a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.PUT for more info.", + "LS - List JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LS for more info.", + "LSALL - List all JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LSALL for more info.", + "RM - Remove a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.RM for more info.", + "RMREX - Remove JARs by a perticular pattern. SHOWDDL PROCEDURE DEFAULT_SPJ.RMREX for more info.", + "GETFILE - Download a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.GETFILE for more info." + }; + List index = new ArrayList(help.length); + index.add("PUT"); + index.add("LS"); + index.add("LSALL"); + index.add("RM"); + index.add("RMREX"); + index.add("GETFILE"); + String tmp = helps[0].trim().toUpperCase(); + helps[0] = "HELP:\r\n"; + switch (index.indexOf(tmp)) { + case 0: + helps[0] = help[0]; + break; + case 1: + helps[0] = help[1]; + break; + case 2: + helps[0] = help[2]; + break; + case 3: + helps[0] = help[3]; + break; + case 4: + helps[0] = help[4]; + break; + case 5: + helps[0] = help[5]; + break; + default: + for (String h : help) { + helps[0] += h + "\r\n"; + } + + } + + } + + public static void syncJar(String userPath, String fileName) throws SQLException, IOException { + checkFileName(fileName); + LOG.info("syncJars " + fileName); + String no
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15039645#comment-15039645 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user robertamarton commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46643821 --- Diff: core/conn/spj_init/src/main/resources/init_spj.sql --- @@ -0,0 +1,156 @@ +#!/bin/bash +# @@@ 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 @@@ + +SERVER_JAR=${MY_SQROOT}/export/lib/spj_init.jar +CI_SERVER_LOG=${MY_SQROOT}/ciserver/cislog +SQLCI=${MY_SQROOT}/export/bin32/sqlci +CP=/bin/cp +MANAGEABILITY_CATALOG=TRAFODION +CIS_SCHEMA=DEFAULT_SPJ + + +function dropAndCreateSchema { +echo "Creating Schema for CI Server Component" +sqlci << sqlciEOF + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'on'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'on'; + + DROP SCHEMA $MANAGEABILITY_CATALOG.$CIS_SCHEMA CASCADE; + CREATE SCHEMA $MANAGEABILITY_CATALOG.$CIS_SCHEMA; + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'off'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'off'; + + exit; +sqlciEOF +} + +function createProcedures { + +echo "Creating Procedures in schema '$MANAGEABILITY_CATALOG.$CIS_SCHEMA' " +sqlci << procEOF + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'on'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'on'; + + -- Creating Procedures + set schema $MANAGEABILITY_CATALOG.$CIS_SCHEMA; + + DROP LIBRARY SPJMGMT CASCADE; + CREATE LIBRARY SPJMGMT FILE '${SERVER_JAR}'; + + CREATE PROCEDURE HELP ( + INOUT COMMANDNAME VARCHAR(2560) CHARACTER SET ISO88591) + EXTERNAL NAME 'com.traf.mgmt.JarFileMgmt.help (java.lang.String[])' + EXTERNAL SECURITY DEFINER + LIBRARY SPJMGMT + LANGUAGE JAVA + PARAMETER STYLE JAVA + READS SQL DATA + ; + GRANT EXECUTE ON PROCEDURE HELP TO PUBLIC; + + CREATE PROCEDURE PUT ( + IN FILEDATA VARCHAR(102400) CHARACTER SET ISO88591, + IN FILENAME VARCHAR(256) CHARACTER SET ISO88591, + IN CREATEFLAG INTEGER) + EXTERNAL NAME 'com.traf.mgmt.JarFileMgmt.put(java.lang.String,java.lang.String,int)' + EXTERNAL SECURITY DEFINER + LIBRARY SPJMGMT + LANGUAGE JAVA + PARAMETER STYLE JAVA + READS SQL DATA + ; + GRANT EXECUTE ON PROCEDURE PUT TO PUBLIC; + + CREATE PROCEDURE LS ( + IN FILENAME VARCHAR(256) CHARACTER SET ISO88591, + OUT FILENAMES VARCHAR(10240) CHARACTER SET ISO88591) + EXTERNAL NAME 'com.traf.mgmt.JarFileMgmt.ls(java.lang.String,java.lang.String[])' + EXTERNAL SECURITY DEFINER + LIBRARY SPJMGMT + LANGUAGE JAVA + PARAMETER STYLE JAVA + READS SQL DATA + ; + GRANT EXECUTE ON PROCEDURE LS TO PUBLIC; + + CREATE PROCEDURE LSALL ( + OUT FILENAMES VARCHAR(10240) CHARACTER SET ISO88591) + EXTERNAL NAME 'com.traf.mgmt.JarFileMgmt.lsAll(java.lang.String[])' + EXTERNAL SECURITY DEFINER + LIBRARY SPJMGMT + LANGUAGE JAVA + PARAMETER STYLE JAVA + READS SQL DATA + ; + GRANT EXECUTE ON PROCEDURE LSALL TO PUBLIC; + + CREATE PROCEDURE RM ( + IN FILENAME VARCHAR(256) CHARACTER SET ISO88591) + EXTERNAL NAME 'com.traf.mgmt.JarFileMgmt.rm(java.lang.String)' + EXTERNAL SECURITY DEFINER + LIBRARY SPJMGMT + LANGUAGE JAVA + PARAMETER STYLE JAVA + READS SQL DATA + ; + GRANT EXECUTE ON PROCEDURE RM TO PUBLIC; + + CREATE PROCEDURE RMREX ( + IN FILENAME VARCHAR(256) CHARACTER SET ISO88591
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15039640#comment-15039640 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user kevinxu021 commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46643629 --- Diff: core/conn/spj_init/src/main/java/com/traf/mgmt/JarFileMgmt.java --- @@ -0,0 +1,435 @@ +/** +* @@@ 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 @@@ + */ +package com.traf.mgmt; + +import java.io.File; +import java.io.FileFilter; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xerial.snappy.Snappy; + +public class JarFileMgmt { + private static final Logger LOG = LoggerFactory.getLogger(JarFileMgmt.class); + private static final String url = "jdbc:default:connection"; + // 100Mb + private static final long MAX_JAR_FILE_SIZE = 104857600; + private static final SimpleDateFormat format = new SimpleDateFormat("-MM-dd HH:mm:ss"); + private static final int MaxDataSize = 102400; + private static final String CHARTSET = "ISO-8859-1"; + + /** +* Print help info +* +* @param helps: +*INOUT parameter like PUT/LS/... +*/ + public static void help(String[] helps) { + String[] help = new String[] { + "PUT - Upload a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.PUT for more info.", + "LS - List JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LS for more info.", + "LSALL - List all JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LSALL for more info.", + "RM - Remove a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.RM for more info.", + "RMREX - Remove JARs by a perticular pattern. SHOWDDL PROCEDURE DEFAULT_SPJ.RMREX for more info.", + "GETFILE - Download a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.GETFILE for more info." + }; + List index = new ArrayList(help.length); + index.add("PUT"); + index.add("LS"); + index.add("LSALL"); + index.add("RM"); + index.add("RMREX"); + index.add("GETFILE"); + String tmp = helps[0].trim().toUpperCase(); + helps[0] = "HELP:\r\n"; + switch (index.indexOf(tmp)) { + case 0: + helps[0] = help[0]; + break; + case 1: + helps[0] = help[1]; + break; + case 2: + helps[0] = help[2]; + break; + case 3: + helps[0] = help[3]; + break; + case 4: + helps[0] = help[4]; + break; + case 5: + helps[0] = help[5]; + break; + default: + for (String h : help) { + helps[0] += h + "\r\n"; + } + + } + + } + + public static void syncJar(String userPath, String fileName) throws SQLException, IOException { + checkFileName(fileName); + LOG.info("syncJars " + fileName); + String no
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15039637#comment-15039637 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user robertamarton commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46643531 --- Diff: core/conn/spj_init/README.md --- @@ -0,0 +1,24 @@ +##How to build and initialize default SPJs +###Build +``` +cd $MY_SQROOT/../conn/spj_init +make clean && make all +``` +###Initialization +``` +cds +./init_spj.sql +``` +###SPJ Example +``` +DEFAULT_SPJ.HELP(INOUT COMMANDNAME VARCHAR) +E.g. +trafci>set param ?p1 help; +trafci>call DEFAULT_SPJ.HELP(?p1) +PUT - Upload a JAR. SHOWDDL PRODURE DEFAULT_SPJ.PUT for more info. +LS - List JARs. SHOWDDL PRODURE DEFAULT_SPJ.LS for more info. +LSALL - List all JARs. SHOWDDL PRODURE DEFAULT_SPJ.LSALL for more info. +RM - Remove a JAR. SHOWDDL PRODURE DEFAULT_SPJ.RM for more info. +RMREX - Remove JARs by a perticular pattern. SHOWDDL PRODURE DEFAULT_SPJ.RMREX for more info. +GETFILE - Upload a JAR. SHOWDDL PRODURE DEFAULT_SPJ.GETFILE for more info. +``` --- End diff -- Do you need to run as the Trafodion ID to enable this feature? If someone like Webroot wants to initialize this, how would this be done? I assume someone would need to run the init_sqj script. Will this be automated somehow? Can someone other than the Trafodion ID perform this operation if they have the correct database privileges? > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15039632#comment-15039632 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user robertamarton commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46643346 --- Diff: core/conn/spj_init/src/main/resources/init_spj.sql --- @@ -0,0 +1,156 @@ +#!/bin/bash +# @@@ 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 @@@ + +SERVER_JAR=${MY_SQROOT}/export/lib/spj_init.jar +CI_SERVER_LOG=${MY_SQROOT}/ciserver/cislog +SQLCI=${MY_SQROOT}/export/bin32/sqlci +CP=/bin/cp +MANAGEABILITY_CATALOG=TRAFODION +CIS_SCHEMA=DEFAULT_SPJ + + +function dropAndCreateSchema { +echo "Creating Schema for CI Server Component" +sqlci << sqlciEOF + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'on'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'on'; + + DROP SCHEMA $MANAGEABILITY_CATALOG.$CIS_SCHEMA CASCADE; + CREATE SCHEMA $MANAGEABILITY_CATALOG.$CIS_SCHEMA; + --- End diff -- Do you want to add an authorization clause to the CREATE SCHEMA, for example AUTHORIZATION DB__ROOT. This will make sure DB__ROOT is the schema owner. > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15039624#comment-15039624 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user robertamarton commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46642798 --- Diff: core/conn/spj_init/src/main/resources/init_spj.sql --- @@ -0,0 +1,156 @@ +#!/bin/bash +# @@@ 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 @@@ + +SERVER_JAR=${MY_SQROOT}/export/lib/spj_init.jar +CI_SERVER_LOG=${MY_SQROOT}/ciserver/cislog +SQLCI=${MY_SQROOT}/export/bin32/sqlci +CP=/bin/cp +MANAGEABILITY_CATALOG=TRAFODION +CIS_SCHEMA=DEFAULT_SPJ + --- End diff -- You are creating a new schema, I assume this is a system schema so you want to make sure the schema name begins and ends with an underscore. This prevents a problem if someone already has a schema named DEFAULT_SPJ, and it works with other system schemas. > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15039606#comment-15039606 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user zellerh commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46642134 --- Diff: core/conn/spj_init/src/main/java/com/traf/mgmt/JarFileMgmt.java --- @@ -0,0 +1,435 @@ +/** +* @@@ 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 @@@ + */ +package com.traf.mgmt; + +import java.io.File; +import java.io.FileFilter; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xerial.snappy.Snappy; + +public class JarFileMgmt { + private static final Logger LOG = LoggerFactory.getLogger(JarFileMgmt.class); + private static final String url = "jdbc:default:connection"; + // 100Mb + private static final long MAX_JAR_FILE_SIZE = 104857600; + private static final SimpleDateFormat format = new SimpleDateFormat("-MM-dd HH:mm:ss"); + private static final int MaxDataSize = 102400; + private static final String CHARTSET = "ISO-8859-1"; + + /** +* Print help info +* +* @param helps: +*INOUT parameter like PUT/LS/... +*/ + public static void help(String[] helps) { + String[] help = new String[] { + "PUT - Upload a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.PUT for more info.", + "LS - List JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LS for more info.", + "LSALL - List all JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LSALL for more info.", + "RM - Remove a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.RM for more info.", + "RMREX - Remove JARs by a perticular pattern. SHOWDDL PROCEDURE DEFAULT_SPJ.RMREX for more info.", + "GETFILE - Download a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.GETFILE for more info." + }; + List index = new ArrayList(help.length); + index.add("PUT"); + index.add("LS"); + index.add("LSALL"); + index.add("RM"); + index.add("RMREX"); + index.add("GETFILE"); + String tmp = helps[0].trim().toUpperCase(); + helps[0] = "HELP:\r\n"; + switch (index.indexOf(tmp)) { + case 0: + helps[0] = help[0]; + break; + case 1: + helps[0] = help[1]; + break; + case 2: + helps[0] = help[2]; + break; + case 3: + helps[0] = help[3]; + break; + case 4: + helps[0] = help[4]; + break; + case 5: + helps[0] = help[5]; + break; + default: + for (String h : help) { + helps[0] += h + "\r\n"; + } + + } + + } + + public static void syncJar(String userPath, String fileName) throws SQLException, IOException { + checkFileName(fileName); + LOG.info("syncJars " + fileName); + String nodes
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15039589#comment-15039589 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user kevinxu021 commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46641418 --- Diff: core/conn/spj_init/src/main/resources/init_spj.sql --- @@ -0,0 +1,156 @@ +#!/bin/bash --- End diff -- yes, right. will fix it. > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15039585#comment-15039585 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user kevinxu021 commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46641349 --- Diff: core/conn/spj_init/src/main/java/com/traf/mgmt/JarFileMgmt.java --- @@ -0,0 +1,435 @@ +/** +* @@@ 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 @@@ + */ +package com.traf.mgmt; + +import java.io.File; +import java.io.FileFilter; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xerial.snappy.Snappy; + +public class JarFileMgmt { + private static final Logger LOG = LoggerFactory.getLogger(JarFileMgmt.class); + private static final String url = "jdbc:default:connection"; + // 100Mb + private static final long MAX_JAR_FILE_SIZE = 104857600; + private static final SimpleDateFormat format = new SimpleDateFormat("-MM-dd HH:mm:ss"); + private static final int MaxDataSize = 102400; + private static final String CHARTSET = "ISO-8859-1"; + + /** +* Print help info +* +* @param helps: +*INOUT parameter like PUT/LS/... +*/ + public static void help(String[] helps) { + String[] help = new String[] { + "PUT - Upload a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.PUT for more info.", + "LS - List JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LS for more info.", + "LSALL - List all JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LSALL for more info.", + "RM - Remove a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.RM for more info.", + "RMREX - Remove JARs by a perticular pattern. SHOWDDL PROCEDURE DEFAULT_SPJ.RMREX for more info.", + "GETFILE - Download a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.GETFILE for more info." + }; + List index = new ArrayList(help.length); + index.add("PUT"); + index.add("LS"); + index.add("LSALL"); + index.add("RM"); + index.add("RMREX"); + index.add("GETFILE"); + String tmp = helps[0].trim().toUpperCase(); + helps[0] = "HELP:\r\n"; + switch (index.indexOf(tmp)) { + case 0: + helps[0] = help[0]; + break; + case 1: + helps[0] = help[1]; + break; + case 2: + helps[0] = help[2]; + break; + case 3: + helps[0] = help[3]; + break; + case 4: + helps[0] = help[4]; + break; + case 5: + helps[0] = help[5]; + break; + default: + for (String h : help) { + helps[0] += h + "\r\n"; + } + + } + + } + + public static void syncJar(String userPath, String fileName) throws SQLException, IOException { + checkFileName(fileName); + LOG.info("syncJars " + fileName); + String no
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15039577#comment-15039577 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user kevinxu021 commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46640843 --- Diff: core/conn/spj_init/src/main/java/com/traf/mgmt/JarFileMgmt.java --- @@ -0,0 +1,435 @@ +/** +* @@@ 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 @@@ + */ +package com.traf.mgmt; + +import java.io.File; +import java.io.FileFilter; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xerial.snappy.Snappy; + +public class JarFileMgmt { + private static final Logger LOG = LoggerFactory.getLogger(JarFileMgmt.class); + private static final String url = "jdbc:default:connection"; + // 100Mb + private static final long MAX_JAR_FILE_SIZE = 104857600; + private static final SimpleDateFormat format = new SimpleDateFormat("-MM-dd HH:mm:ss"); + private static final int MaxDataSize = 102400; + private static final String CHARTSET = "ISO-8859-1"; + + /** +* Print help info +* +* @param helps: +*INOUT parameter like PUT/LS/... +*/ + public static void help(String[] helps) { + String[] help = new String[] { + "PUT - Upload a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.PUT for more info.", + "LS - List JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LS for more info.", + "LSALL - List all JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LSALL for more info.", + "RM - Remove a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.RM for more info.", + "RMREX - Remove JARs by a perticular pattern. SHOWDDL PROCEDURE DEFAULT_SPJ.RMREX for more info.", + "GETFILE - Download a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.GETFILE for more info." + }; + List index = new ArrayList(help.length); + index.add("PUT"); + index.add("LS"); + index.add("LSALL"); + index.add("RM"); + index.add("RMREX"); + index.add("GETFILE"); + String tmp = helps[0].trim().toUpperCase(); + helps[0] = "HELP:\r\n"; + switch (index.indexOf(tmp)) { + case 0: + helps[0] = help[0]; + break; + case 1: + helps[0] = help[1]; + break; + case 2: + helps[0] = help[2]; + break; + case 3: + helps[0] = help[3]; + break; + case 4: + helps[0] = help[4]; + break; + case 5: + helps[0] = help[5]; + break; + default: + for (String h : help) { + helps[0] += h + "\r\n"; + } + + } + + } + + public static void syncJar(String userPath, String fileName) throws SQLException, IOException { + checkFileName(fileName); + LOG.info("syncJars " + fileName); + String no
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15038376#comment-15038376 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user zellerh commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46596234 --- Diff: core/conn/spj_init/src/main/java/com/traf/mgmt/JarFileMgmt.java --- @@ -0,0 +1,435 @@ +/** +* @@@ 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 @@@ + */ +package com.traf.mgmt; + +import java.io.File; +import java.io.FileFilter; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xerial.snappy.Snappy; + +public class JarFileMgmt { + private static final Logger LOG = LoggerFactory.getLogger(JarFileMgmt.class); + private static final String url = "jdbc:default:connection"; + // 100Mb + private static final long MAX_JAR_FILE_SIZE = 104857600; + private static final SimpleDateFormat format = new SimpleDateFormat("-MM-dd HH:mm:ss"); + private static final int MaxDataSize = 102400; + private static final String CHARTSET = "ISO-8859-1"; + + /** +* Print help info +* +* @param helps: +*INOUT parameter like PUT/LS/... +*/ + public static void help(String[] helps) { + String[] help = new String[] { + "PUT - Upload a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.PUT for more info.", + "LS - List JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LS for more info.", + "LSALL - List all JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LSALL for more info.", + "RM - Remove a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.RM for more info.", + "RMREX - Remove JARs by a perticular pattern. SHOWDDL PROCEDURE DEFAULT_SPJ.RMREX for more info.", + "GETFILE - Download a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.GETFILE for more info." + }; + List index = new ArrayList(help.length); + index.add("PUT"); + index.add("LS"); + index.add("LSALL"); + index.add("RM"); + index.add("RMREX"); + index.add("GETFILE"); + String tmp = helps[0].trim().toUpperCase(); + helps[0] = "HELP:\r\n"; + switch (index.indexOf(tmp)) { + case 0: + helps[0] = help[0]; + break; + case 1: + helps[0] = help[1]; + break; + case 2: + helps[0] = help[2]; + break; + case 3: + helps[0] = help[3]; + break; + case 4: + helps[0] = help[4]; + break; + case 5: + helps[0] = help[5]; + break; + default: + for (String h : help) { + helps[0] += h + "\r\n"; + } + + } + + } + + public static void syncJar(String userPath, String fileName) throws SQLException, IOException { + checkFileName(fileName); + LOG.info("syncJars " + fileName); + String nodes
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15038363#comment-15038363 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user zellerh commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46596018 --- Diff: core/conn/spj_init/src/main/java/com/traf/mgmt/JarFileMgmt.java --- @@ -0,0 +1,435 @@ +/** +* @@@ 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 @@@ + */ +package com.traf.mgmt; + +import java.io.File; +import java.io.FileFilter; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xerial.snappy.Snappy; + +public class JarFileMgmt { + private static final Logger LOG = LoggerFactory.getLogger(JarFileMgmt.class); + private static final String url = "jdbc:default:connection"; + // 100Mb + private static final long MAX_JAR_FILE_SIZE = 104857600; + private static final SimpleDateFormat format = new SimpleDateFormat("-MM-dd HH:mm:ss"); + private static final int MaxDataSize = 102400; + private static final String CHARTSET = "ISO-8859-1"; + + /** +* Print help info +* +* @param helps: +*INOUT parameter like PUT/LS/... +*/ + public static void help(String[] helps) { + String[] help = new String[] { + "PUT - Upload a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.PUT for more info.", + "LS - List JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LS for more info.", + "LSALL - List all JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LSALL for more info.", + "RM - Remove a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.RM for more info.", + "RMREX - Remove JARs by a perticular pattern. SHOWDDL PROCEDURE DEFAULT_SPJ.RMREX for more info.", + "GETFILE - Download a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.GETFILE for more info." + }; + List index = new ArrayList(help.length); + index.add("PUT"); + index.add("LS"); + index.add("LSALL"); + index.add("RM"); + index.add("RMREX"); + index.add("GETFILE"); + String tmp = helps[0].trim().toUpperCase(); + helps[0] = "HELP:\r\n"; + switch (index.indexOf(tmp)) { + case 0: + helps[0] = help[0]; + break; + case 1: + helps[0] = help[1]; + break; + case 2: + helps[0] = help[2]; + break; + case 3: + helps[0] = help[3]; + break; + case 4: + helps[0] = help[4]; + break; + case 5: + helps[0] = help[5]; + break; + default: + for (String h : help) { + helps[0] += h + "\r\n"; + } + + } + + } + + public static void syncJar(String userPath, String fileName) throws SQLException, IOException { + checkFileName(fileName); + LOG.info("syncJars " + fileName); + String nodes
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15038331#comment-15038331 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user zellerh commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46594425 --- Diff: core/conn/spj_init/src/main/java/com/traf/mgmt/JarFileMgmt.java --- @@ -0,0 +1,435 @@ +/** +* @@@ 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 @@@ + */ +package com.traf.mgmt; + +import java.io.File; +import java.io.FileFilter; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xerial.snappy.Snappy; + +public class JarFileMgmt { + private static final Logger LOG = LoggerFactory.getLogger(JarFileMgmt.class); + private static final String url = "jdbc:default:connection"; + // 100Mb + private static final long MAX_JAR_FILE_SIZE = 104857600; + private static final SimpleDateFormat format = new SimpleDateFormat("-MM-dd HH:mm:ss"); + private static final int MaxDataSize = 102400; + private static final String CHARTSET = "ISO-8859-1"; + + /** +* Print help info +* +* @param helps: +*INOUT parameter like PUT/LS/... +*/ + public static void help(String[] helps) { + String[] help = new String[] { + "PUT - Upload a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.PUT for more info.", + "LS - List JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LS for more info.", + "LSALL - List all JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LSALL for more info.", + "RM - Remove a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.RM for more info.", + "RMREX - Remove JARs by a perticular pattern. SHOWDDL PROCEDURE DEFAULT_SPJ.RMREX for more info.", + "GETFILE - Download a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.GETFILE for more info." + }; + List index = new ArrayList(help.length); + index.add("PUT"); + index.add("LS"); + index.add("LSALL"); + index.add("RM"); + index.add("RMREX"); + index.add("GETFILE"); + String tmp = helps[0].trim().toUpperCase(); + helps[0] = "HELP:\r\n"; + switch (index.indexOf(tmp)) { + case 0: + helps[0] = help[0]; + break; + case 1: + helps[0] = help[1]; + break; + case 2: + helps[0] = help[2]; + break; + case 3: + helps[0] = help[3]; + break; + case 4: + helps[0] = help[4]; + break; + case 5: + helps[0] = help[5]; + break; + default: + for (String h : help) { + helps[0] += h + "\r\n"; + } + + } + + } + + public static void syncJar(String userPath, String fileName) throws SQLException, IOException { + checkFileName(fileName); + LOG.info("syncJars " + fileName); + String nodes
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15038266#comment-15038266 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user zellerh commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46591061 --- Diff: core/conn/spj_init/src/main/java/com/traf/mgmt/JarFileMgmt.java --- @@ -0,0 +1,435 @@ +/** +* @@@ 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 @@@ + */ +package com.traf.mgmt; + +import java.io.File; +import java.io.FileFilter; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xerial.snappy.Snappy; + +public class JarFileMgmt { + private static final Logger LOG = LoggerFactory.getLogger(JarFileMgmt.class); + private static final String url = "jdbc:default:connection"; + // 100Mb + private static final long MAX_JAR_FILE_SIZE = 104857600; + private static final SimpleDateFormat format = new SimpleDateFormat("-MM-dd HH:mm:ss"); + private static final int MaxDataSize = 102400; + private static final String CHARTSET = "ISO-8859-1"; + + /** +* Print help info +* +* @param helps: +*INOUT parameter like PUT/LS/... +*/ + public static void help(String[] helps) { + String[] help = new String[] { + "PUT - Upload a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.PUT for more info.", + "LS - List JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LS for more info.", + "LSALL - List all JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LSALL for more info.", + "RM - Remove a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.RM for more info.", + "RMREX - Remove JARs by a perticular pattern. SHOWDDL PROCEDURE DEFAULT_SPJ.RMREX for more info.", + "GETFILE - Download a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.GETFILE for more info." + }; + List index = new ArrayList(help.length); + index.add("PUT"); + index.add("LS"); + index.add("LSALL"); + index.add("RM"); + index.add("RMREX"); + index.add("GETFILE"); + String tmp = helps[0].trim().toUpperCase(); + helps[0] = "HELP:\r\n"; + switch (index.indexOf(tmp)) { + case 0: + helps[0] = help[0]; + break; + case 1: + helps[0] = help[1]; + break; + case 2: + helps[0] = help[2]; + break; + case 3: + helps[0] = help[3]; + break; + case 4: + helps[0] = help[4]; + break; + case 5: + helps[0] = help[5]; + break; + default: + for (String h : help) { + helps[0] += h + "\r\n"; + } + + } + + } + + public static void syncJar(String userPath, String fileName) throws SQLException, IOException { + checkFileName(fileName); + LOG.info("syncJars " + fileName); + String nodes
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15038260#comment-15038260 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user zellerh commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46590724 --- Diff: core/conn/spj_init/src/main/resources/init_spj.sql --- @@ -0,0 +1,156 @@ +#!/bin/bash +# @@@ 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 @@@ + +SERVER_JAR=${MY_SQROOT}/export/lib/spj_init.jar +CI_SERVER_LOG=${MY_SQROOT}/ciserver/cislog +SQLCI=${MY_SQROOT}/export/bin32/sqlci +CP=/bin/cp +MANAGEABILITY_CATALOG=TRAFODION +CIS_SCHEMA=DEFAULT_SPJ + + +function dropAndCreateSchema { +echo "Creating Schema for CI Server Component" +sqlci << sqlciEOF + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'on'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'on'; + + DROP SCHEMA $MANAGEABILITY_CATALOG.$CIS_SCHEMA CASCADE; + CREATE SCHEMA $MANAGEABILITY_CATALOG.$CIS_SCHEMA; + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'off'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'off'; + + exit; +sqlciEOF +} + +function createProcedures { + +echo "Creating Procedures in schema '$MANAGEABILITY_CATALOG.$CIS_SCHEMA' " +sqlci << procEOF + + cqd CAT_IGNORE_ALREADY_EXISTS_ERROR 'on'; + cqd CAT_IGNORE_DOES_NOT_EXIST_ERROR 'on'; + + -- Creating Procedures + set schema $MANAGEABILITY_CATALOG.$CIS_SCHEMA; + + DROP LIBRARY SPJMGMT CASCADE; + CREATE LIBRARY SPJMGMT FILE '${SERVER_JAR}'; + + CREATE PROCEDURE HELP ( + INOUT COMMANDNAME VARCHAR(2560) CHARACTER SET ISO88591) + EXTERNAL NAME 'com.traf.mgmt.JarFileMgmt.help (java.lang.String[])' + EXTERNAL SECURITY DEFINER + LIBRARY SPJMGMT + LANGUAGE JAVA + PARAMETER STYLE JAVA + READS SQL DATA + ; + GRANT EXECUTE ON PROCEDURE HELP TO PUBLIC; + + CREATE PROCEDURE PUT ( + IN FILEDATA VARCHAR(102400) CHARACTER SET ISO88591, + IN FILENAME VARCHAR(256) CHARACTER SET ISO88591, --- End diff -- I wonder whether we should use UTF-8 for the file names, so that we can also support file names in Chinese and other languages. Do you know whether this is supported by Linux? I would suggest VARCHAR(256 BYTES) CHARACTER SET UTF8 in that case - but then I'm not 100% sure whether SPJs support that, we might need to use UCS2? > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15038252#comment-15038252 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user zellerh commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46590091 --- Diff: core/conn/spj_init/src/main/resources/init_spj.sql --- @@ -0,0 +1,156 @@ +#!/bin/bash --- End diff -- Since this is a shell script, should the name really end in ".sql"? Not sure what conventions are used in the conn project, but I usually use ".sql" for scripts that are obeyed in sqlci or trafci. > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu >Assignee: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15038249#comment-15038249 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user zellerh commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46589812 --- Diff: core/conn/spj_init/src/main/java/com/traf/mgmt/JarFileMgmt.java --- @@ -0,0 +1,435 @@ +/** +* @@@ 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 @@@ + */ +package com.traf.mgmt; + +import java.io.File; +import java.io.FileFilter; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xerial.snappy.Snappy; + +public class JarFileMgmt { + private static final Logger LOG = LoggerFactory.getLogger(JarFileMgmt.class); + private static final String url = "jdbc:default:connection"; + // 100Mb + private static final long MAX_JAR_FILE_SIZE = 104857600; + private static final SimpleDateFormat format = new SimpleDateFormat("-MM-dd HH:mm:ss"); + private static final int MaxDataSize = 102400; + private static final String CHARTSET = "ISO-8859-1"; + + /** +* Print help info +* +* @param helps: +*INOUT parameter like PUT/LS/... +*/ + public static void help(String[] helps) { + String[] help = new String[] { + "PUT - Upload a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.PUT for more info.", + "LS - List JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LS for more info.", + "LSALL - List all JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LSALL for more info.", + "RM - Remove a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.RM for more info.", + "RMREX - Remove JARs by a perticular pattern. SHOWDDL PROCEDURE DEFAULT_SPJ.RMREX for more info.", + "GETFILE - Download a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.GETFILE for more info." + }; + List index = new ArrayList(help.length); + index.add("PUT"); + index.add("LS"); + index.add("LSALL"); + index.add("RM"); + index.add("RMREX"); + index.add("GETFILE"); + String tmp = helps[0].trim().toUpperCase(); + helps[0] = "HELP:\r\n"; + switch (index.indexOf(tmp)) { + case 0: + helps[0] = help[0]; + break; + case 1: + helps[0] = help[1]; + break; + case 2: + helps[0] = help[2]; + break; + case 3: + helps[0] = help[3]; + break; + case 4: + helps[0] = help[4]; + break; + case 5: + helps[0] = help[5]; + break; + default: + for (String h : help) { + helps[0] += h + "\r\n"; + } + + } + + } + + public static void syncJar(String userPath, String fileName) throws SQLException, IOException { + checkFileName(fileName); + LOG.info("syncJars " + fileName); + String nodes
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15038245#comment-15038245 ] ASF GitHub Bot commented on TRAFODION-1668: --- Github user zellerh commented on a diff in the pull request: https://github.com/apache/incubator-trafodion/pull/203#discussion_r46589451 --- Diff: core/conn/spj_init/src/main/java/com/traf/mgmt/JarFileMgmt.java --- @@ -0,0 +1,435 @@ +/** +* @@@ 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 @@@ + */ +package com.traf.mgmt; + +import java.io.File; +import java.io.FileFilter; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xerial.snappy.Snappy; + +public class JarFileMgmt { + private static final Logger LOG = LoggerFactory.getLogger(JarFileMgmt.class); + private static final String url = "jdbc:default:connection"; + // 100Mb + private static final long MAX_JAR_FILE_SIZE = 104857600; + private static final SimpleDateFormat format = new SimpleDateFormat("-MM-dd HH:mm:ss"); + private static final int MaxDataSize = 102400; + private static final String CHARTSET = "ISO-8859-1"; + + /** +* Print help info +* +* @param helps: +*INOUT parameter like PUT/LS/... +*/ + public static void help(String[] helps) { + String[] help = new String[] { + "PUT - Upload a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.PUT for more info.", + "LS - List JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LS for more info.", + "LSALL - List all JARs. SHOWDDL PROCEDURE DEFAULT_SPJ.LSALL for more info.", + "RM - Remove a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.RM for more info.", + "RMREX - Remove JARs by a perticular pattern. SHOWDDL PROCEDURE DEFAULT_SPJ.RMREX for more info.", + "GETFILE - Download a JAR. SHOWDDL PROCEDURE DEFAULT_SPJ.GETFILE for more info." + }; + List index = new ArrayList(help.length); + index.add("PUT"); + index.add("LS"); + index.add("LSALL"); + index.add("RM"); + index.add("RMREX"); + index.add("GETFILE"); + String tmp = helps[0].trim().toUpperCase(); + helps[0] = "HELP:\r\n"; + switch (index.indexOf(tmp)) { + case 0: + helps[0] = help[0]; + break; + case 1: + helps[0] = help[1]; + break; + case 2: + helps[0] = help[2]; + break; + case 3: + helps[0] = help[3]; + break; + case 4: + helps[0] = help[4]; + break; + case 5: + helps[0] = help[5]; + break; + default: + for (String h : help) { + helps[0] += h + "\r\n"; + } + + } + + } + + public static void syncJar(String userPath, String fileName) throws SQLException, IOException { + checkFileName(fileName); + LOG.info("syncJars " + fileName); + String nodes
[jira] [Commented] (TRAFODION-1668) Cannot upload customer SPJ JARs
[ https://issues.apache.org/jira/browse/TRAFODION-1668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15037530#comment-15037530 ] ASF GitHub Bot commented on TRAFODION-1668: --- GitHub user kevinxu021 opened a pull request: https://github.com/apache/incubator-trafodion/pull/203 [TRAFODION-1668]initialize spj for upload a customized jar You can merge this pull request into a Git repository by running: $ git pull https://github.com/kevinxu021/incubator-trafodion a_spj Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-trafodion/pull/203.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 #203 commit 84f4ccdc2d71049cd91cb934392a27ce5a849f63 Author: Kevin Xu Date: 2015-12-03T08:47:06Z initialize spj > Cannot upload customer SPJ JARs > --- > > Key: TRAFODION-1668 > URL: https://issues.apache.org/jira/browse/TRAFODION-1668 > Project: Apache Trafodion > Issue Type: Improvement >Reporter: Kevin Xu > -- This message was sent by Atlassian JIRA (v6.3.4#6332)