Skip to content

Commit

Permalink
bump (Hbase, Hadoop): Hadoop 3.4, Hbase 2.6: fixes CVE-2021-37137 (#3220
Browse files Browse the repository at this point in the history
)
  • Loading branch information
sebastian-alfers authored Sep 23, 2024
1 parent a383e0f commit 32159f4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ package akka.stream.alpakka.hbase.impl
import java.io.Closeable

import akka.stream.stage.StageLogging
import org.apache.hadoop.hbase.{HColumnDescriptor, HTableDescriptor, TableName}
import org.apache.hadoop.hbase.client.{Connection, ConnectionFactory, Table}
import org.apache.hadoop.hbase.TableName
import org.apache.hadoop.hbase.client.{
ColumnFamilyDescriptorBuilder,
Connection,
ConnectionFactory,
Table,
TableDescriptorBuilder
}
import org.apache.hadoop.conf.Configuration

import scala.concurrent.duration.DurationInt
Expand All @@ -19,6 +25,8 @@ import scala.concurrent.ExecutionContext.Implicits.global

import scala.language.postfixOps

import org.apache.hadoop.hbase.util.Bytes

private[impl] trait HBaseCapabilities { this: StageLogging =>

def twr[A <: Closeable, B](resource: A)(doWork: A => B): Try[B] =
Expand Down Expand Up @@ -53,11 +61,11 @@ private[impl] trait HBaseCapabilities { this: StageLogging =>
if (admin.isTableAvailable(tableName))
connection.getTable(tableName)
else {
val tableDescriptor: HTableDescriptor = new HTableDescriptor(tableName)
val tableDescriptor = TableDescriptorBuilder.newBuilder(tableName)
columnFamilies.foreach { cf =>
tableDescriptor.addFamily(new HColumnDescriptor(cf))
tableDescriptor.setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder(Bytes.toBytes(cf)).build())
}
admin.createTable(tableDescriptor)
admin.createTable(tableDescriptor.build())
log.info(s"Table $tableName created with cfs: $columnFamilies.")
connection.getTable(tableName)
}
Expand Down
2 changes: 1 addition & 1 deletion hbase/src/test/java/docs/javadsl/HBaseStageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static void teardown() {
person -> {
try {
Append append = new Append(String.format("id_%d", person.id).getBytes("UTF-8"));
append.add(
append.addColumn(
"info".getBytes("UTF-8"), "aliases".getBytes("UTF-8"), person.name.getBytes("UTF-8"));

return Collections.singletonList(append);
Expand Down
2 changes: 1 addition & 1 deletion hbase/src/test/scala/docs/scaladsl/HBaseStageSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class HBaseStageSpec
val appendHBaseConverter: Person => immutable.Seq[Mutation] = { person =>
// Append to a cell
val append = new Append(s"id_${person.id}")
append.add("info", "aliases", person.name)
append.addColumn("info", "aliases", person.name)
List(append)
}
//#create-converter-append
Expand Down
6 changes: 3 additions & 3 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ object Dependencies {
)

val HBase = {
val hbaseVersion = "1.4.14"
val hadoopVersion = "3.3.6"
val hbaseVersion = "2.6.0"
val hadoopVersion = "3.4.0"
Seq(
libraryDependencies ++= Seq(
"org.apache.hbase" % "hbase-shaded-client" % hbaseVersion exclude ("log4j", "log4j") exclude ("org.slf4j", "slf4j-log4j12"), // ApacheV2,
Expand All @@ -303,7 +303,7 @@ object Dependencies {
)
}

val HadoopVersion = "3.3.6"
val HadoopVersion = "3.4.0"
val Hdfs = Seq(
libraryDependencies ++= Seq(
"org.apache.hadoop" % "hadoop-client" % HadoopVersion exclude ("log4j", "log4j") exclude ("org.slf4j", "slf4j-log4j12"), // ApacheV2
Expand Down

0 comments on commit 32159f4

Please sign in to comment.