OSDir


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GitHub] incubator-gearpump pull request #246: Apache Kudu Akka Streaming Sink


Github user SandishKumarHN commented on a diff in the pull request:

    https://github.com/apache/incubator-gearpump/pull/246#discussion_r186145759
  
    --- Diff: external/kudu/src/main/scala/org/apache/gearpump/external/kudu/KuduSink.scala ---
    @@ -0,0 +1,114 @@
    +/*
    + * 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.
    + */
    +package org.apache.gearpump.external.kudu
    +
    +import org.apache.gearpump.Message
    +import org.apache.gearpump.cluster.UserConfig
    +import org.apache.gearpump.external.kudu.KuduSink.KuduWriterFactory
    +import org.apache.gearpump.streaming.sink.DataSink
    +import org.apache.gearpump.streaming.task.TaskContext
    +import org.apache.kudu.Type._
    +import org.apache.kudu.client._
    +
    +class KuduSink private[kudu](userConfig: UserConfig, tableName: String, factory: KuduWriterFactory)
    +  extends DataSink {
    +
    +  private lazy val kuduWriter = factory.getKuduWriter(userConfig, tableName)
    +
    +  def this(userConfig: UserConfig, tableName: String) = {
    +    this(userConfig, tableName, new KuduWriterFactory)
    +  }
    +
    +  override def open(context: TaskContext): Unit = {}
    +
    +  // scalastyle:off println
    --- End diff --
    
    Will remove


---