Ich habe diesen Code unten:HBase Verbindung Instanz
DStream.map {
_.message()
}.foreachRDD { rdd =>
rdd.foreachPartition{iter =>
val conf = HBaseUtils.configureHBase("iemployee")
val connection = ConnectionFactory.createConnection(conf)
val table = connection.getTable(TableName.valueOf("""iemployee"""))
iter.foreach{elem =>
/* loop through the records in the partition and push them out to the DB */
}
}
Kann mir bitte jemand sagen, ob das Verbindungsobjekt val connection = ConnectionFactory.createConnection(conf)
hier erstellt ist die gleiche Verbindungsobjekt in jeder Partition verwendet (da ich es nie schließen) oder wird ein neues Verbindungsobjekt für jede Partition erstellt werden?
Vielen Dank! – CapturedTree