gearpump-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manuzhang <...@git.apache.org>
Subject [GitHub] incubator-gearpump pull request #86: [GEARPUMP-204]add unit test for externa...
Date Thu, 22 Sep 2016 05:58:44 GMT
Github user manuzhang commented on a diff in the pull request:

    https://github.com/apache/incubator-gearpump/pull/86#discussion_r79979330
  
    --- Diff: external/hbase/src/main/scala/org/apache/gearpump/external/hbase/HBaseSink.scala
---
    @@ -19,39 +19,47 @@ package org.apache.gearpump.external.hbase
     
     import java.io.{File, ObjectInputStream, ObjectOutputStream}
     
    +import org.apache.gearpump.Message
    +import org.apache.gearpump.cluster.UserConfig
    +import org.apache.gearpump.streaming.sink.DataSink
    +import org.apache.gearpump.streaming.task.TaskContext
    +import org.apache.gearpump.util.{Constants, FileUtils}
     import org.apache.hadoop.conf.Configuration
     import org.apache.hadoop.hbase.client.{Connection, ConnectionFactory, Put}
    +import org.apache.hadoop.hbase.security.UserProvider
     import org.apache.hadoop.hbase.util.Bytes
     import org.apache.hadoop.hbase.{HBaseConfiguration, TableName}
    -import org.apache.hadoop.hbase.security.{User, UserProvider}
     import org.apache.hadoop.security.UserGroupInformation
     
    -import org.apache.gearpump.Message
    -import org.apache.gearpump.cluster.UserConfig
    -import org.apache.gearpump.streaming.sink.DataSink
    -import org.apache.gearpump.streaming.task.TaskContext
    -import org.apache.gearpump.util.{Constants, FileUtils}
    +class HBaseSink(userconfig: UserConfig, tableName: String, @transient var connection:
Connection,
    +    @transient var configuration: Configuration)
    +  extends DataSink {
     
    -class HBaseSink(
    -    userconfig: UserConfig, tableName: String, @transient var configuration: Configuration)
    -  extends DataSink{
    -  lazy val connection = HBaseSink.getConnection(userconfig, configuration)
    +
    +  // var connection = HBaseSink.getConnection(userconfig, configuration)
    --- End diff --
    
    to allow it be mocked in test


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message