-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Conversation
val settings = ConnectionPoolSettings(maxSize = maxSize) | ||
|
||
ConnectionPool.singleton( | ||
config.properties("URL"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be do use conts for "URL", "USERNAME", "USERNAME" etc? for avoid problems about copy-paste
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to extends JDBC StorageClient to avoid code copy.
init.invoke(instance) | ||
} | ||
catch { | ||
case e: NoSuchMethodException => None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the return value of try expression is not used, Unit
is suitable than None
for ignoring an exception as following:
case _: NoSuchMethodException => ()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, good point.
@@ -29,14 +29,15 @@ class JDBCChannels(client: String, config: StorageClientConfig, prefix: String) | |||
extends Channels with Logging { | |||
/** Database table name for this data access object */ | |||
val tableName = JDBCUtils.prefixTableName(prefix, "channels") | |||
DB autoCommit { implicit session => | |||
sql""" | |||
def init() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use the deperecated procedure syntax. See: https://issues.scala-lang.org/browse/SI-7605
It should be:
def init() = {
DB autoCommit { implicit session =>
...
}
}
or
def init() = DB autoCommit { implicit session =>
...
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, done
@@ -29,8 +29,9 @@ class JDBCEngineInstances(client: String, config: StorageClientConfig, prefix: S | |||
extends EngineInstances with Logging { | |||
/** Database table name for this data access object */ | |||
val tableName = JDBCUtils.prefixTableName(prefix, "engineinstances") | |||
DB autoCommit { implicit session => | |||
sql""" | |||
def init() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
@@ -29,8 +29,9 @@ class JDBCEvaluationInstances(client: String, config: StorageClientConfig, prefi | |||
extends EvaluationInstances with Logging { | |||
/** Database table name for this data access object */ | |||
val tableName = JDBCUtils.prefixTableName(prefix, "evaluationinstances") | |||
DB autoCommit { implicit session => | |||
sql""" | |||
def init() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
val binaryColumnType = JDBCUtils.binaryColumnType(client) | ||
DB autoCommit { implicit session => | ||
sql""" | ||
def init() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
/** JDBC implementation of [[EngineInstances]] */ | ||
class OJDBCEngineInstances(client: String, config: StorageClientConfig, prefix: String) | ||
extends JDBCEngineInstances(client, config, prefix) { | ||
override def init() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
/** JDBC implementations of [[EvaluationInstances]] */ | ||
class OJDBCEvaluationInstances(client: String, config: StorageClientConfig, prefix: String) | ||
extends JDBCEvaluationInstances(client, config, prefix) { | ||
override def init() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
/** JDBC implementation of [[Models]] */ | ||
class OJDBCModels(client: String, config: StorageClientConfig, prefix: String) | ||
extends JDBCModels(client, config, prefix) { | ||
override def init() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
asInstanceOf[T] | ||
try { | ||
val init = instance.getClass.getMethod("init") | ||
init.invoke(instance) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion, if init()
method is necessary for data objects, we should define a trait (e.g. Initializable
) which has a init()
method and cast by pattern match here to call init()
method.
But since this is just my thought, we need opinion from other committers as well.
@@ -198,7 +198,7 @@ object CreateServer extends Logging { | |||
kryo.invert(modeldata.get(engineInstance.id).get.models).get. | |||
asInstanceOf[Seq[Any]] | |||
|
|||
val batch = if (engineInstance.batch.nonEmpty) { | |||
val batch = if (engineInstance.batch != null && engineInstance.batch.nonEmpty) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this null check necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not so, pio deploy crashes.
@dszeto As our concern, is it possible to test with Oracle database on Travis-CI or ASF's Jenkins? If no, it might be difficult to guarantee this Oracle support works correctly over the future. |
@takezoe A quick search reveals https://hub.docker.com/r/wnameless/oracle-xe-11g/, but this limits the guarantee to whatever Oracle XE 11g supports. @liningalex would you mind taking a look at this option? Let us know if you need help adding integration test. |
@liningalex could you also please open a ticket on our Apache JIRA to help with tracking? Thanks! I will conduct a more thorough review ASAP. |
@liningalex Is the main motivation for a separate |
It's lots more than difference of column type.
…On Fri, Jun 16, 2017 at 12:47 PM, Donald Szeto ***@***.***> wrote:
@liningalex <https://github.com/liningalex> Is the main motivation for a
separate OJDBC set of classes due to Oracle requiring different column
types?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#387 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAneGKyta1GfpUj8kAfOOaPw9qD--gsXks5sEtu-gaJpZM4NsVn1>
.
|
Hey @liningalex, if you don't have a chance adding integration test yet, I would like to merge this to a feature branch so that we can join forces on that. |
Hi Donald, I think we should have integration test. do you have
instructions how?
…On Tue, Jun 20, 2017 at 4:49 PM, Donald Szeto ***@***.***> wrote:
Hey @liningalex <https://github.com/liningalex>, if you don't have a
chance adding integration test yet, I would like to merge this to a feature
branch so that we can join forces on that.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#387 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAneGNeTQAHMdR346v5vLnQrTTuOcD8Nks5sGFqDgaJpZM4NsVn1>
.
|
We don't have any documentation (which we should add later) on how that's done, but basically, it would be adding a new combination in the test matrix (https://github.com/apache/incubator-predictionio/blob/develop/.travis.yml), and setting up https://github.com/apache/incubator-predictionio/blob/develop/tests/docker-compose.yml to bring up a container running Oracle. |
@liningalex Let us know how we can help. This is a great PR and we would like to get it in. |
@dszeto is ./run_docker.sh ELASTICSEARCH HBASE LOCALFS ~/Documents/github/incubator-predictionio "echo 'All tests passed...'" right command to run tests? i got Starting tests_postgres_1 ... done |
Should be
where you replace those variables with |
@dszeto in the end, it says 'Generating XML reports...'. where are the reports? |
These reports are generated by |
@dszeto how do I get the copy? |
You will need to use |
will reopen when integration test is added. |
This pull request is to supports Oracle database. please review. thanks.