You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by mm...@apache.org on 2021/03/19 17:02:00 UTC

[bookkeeper] branch master updated: BP-43 CI/CD migration to gradle (#2636)

This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new 1343a87  BP-43 CI/CD migration to gradle (#2636)
1343a87 is described below

commit 1343a87854f2cd0e145569a7c9755d0fc194ab22
Author: Prashant Kumar <65...@users.noreply.github.com>
AuthorDate: Fri Mar 19 10:01:50 2021 -0700

    BP-43 CI/CD migration to gradle (#2636)
    
    Gradle: Build bookkeeper-server with gradle and run unit tests
    
    Co-authored-by: Prashant <pr...@splunk.com>
---
 .gitignore                                         |   3 +
 bookkeeper-common-allocator/build.gradle           |  28 ++++
 bookkeeper-common/build.gradle                     |  63 +++++++
 bookkeeper-http/http-server/build.gradle           |  29 ++++
 bookkeeper-proto/build.gradle                      |  32 ++++
 bookkeeper-server/build.gradle                     |  87 ++++++++++
 .../prometheus-metrics-provider/build.gradle       |  38 +++++
 bookkeeper-stats/build.gradle                      |  26 +++
 build.gradle                                       |  40 +++++
 circe-checksum/build.gradle                        |  45 +++++
 circe-checksum/src/main/circe/build.gradle         |  40 +++++
 cpu-affinity/build.gradle                          |  48 ++++++
 cpu-affinity/src/main/affinity/build.gradle        |  38 +++++
 dependencies.gradle                                | 108 ++++++++++++
 gradle.properties                                  |  22 +++
 gradle/wrapper/gradle-wrapper.jar                  | Bin 0 -> 56172 bytes
 gradle/wrapper/gradle-wrapper.properties           |  26 +++
 gradlew                                            | 186 +++++++++++++++++++++
 gradlew.bat                                        |  99 +++++++++++
 settings.gradle                                    |  32 ++++
 tools/framework/build.gradle                       |  34 ++++
 21 files changed, 1024 insertions(+)

diff --git a/.gitignore b/.gitignore
index f59b571..d0d4c80 100644
--- a/.gitignore
+++ b/.gitignore
@@ -41,3 +41,6 @@ tools/all/src/main/resources
 
 node_modules
 package-lock.json
+# gradle
+build/
+.gradle/
diff --git a/bookkeeper-common-allocator/build.gradle b/bookkeeper-common-allocator/build.gradle
new file mode 100644
index 0000000..57f6b59
--- /dev/null
+++ b/bookkeeper-common-allocator/build.gradle
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+plugins {
+    id 'java-library'
+}
+
+dependencies {
+    implementation depLibs.nettyBuffer
+    implementation depLibs.slf4j
+    testImplementation depLibs.junit
+    testImplementation depLibs.mockito
+}
diff --git a/bookkeeper-common/build.gradle b/bookkeeper-common/build.gradle
new file mode 100644
index 0000000..d4f3f43
--- /dev/null
+++ b/bookkeeper-common/build.gradle
@@ -0,0 +1,63 @@
+/*
+ * 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.
+ */
+plugins {
+    id 'java-library'
+    id "java-test-fixtures"
+}
+
+dependencies {
+    implementation project(":bookkeeper-stats")
+    implementation project(":cpu-affinity")
+
+    compileOnly depLibs.errorprone
+    compileOnly depLibs.jsr305
+    compileOnly depLibs.lombok
+    compileOnly depLibs.spotbugsAnnotations
+    implementation depLibs.commonsConfiguration
+    implementation depLibs.guava
+    implementation depLibs.jacksonAnnotations
+    implementation depLibs.jacksonCore
+    implementation depLibs.jacksonDatabind
+    implementation depLibs.jctools
+    implementation depLibs.nettyCommon
+    implementation depLibs.slf4j
+    testCompileOnly depLibs.lombok
+    testImplementation depLibs.commonsLang3
+    testImplementation depLibs.hamcrest
+    testImplementation depLibs.junit
+    testImplementation depLibs.log4j
+    testImplementation depLibs.mockito
+    testImplementation depLibs.slf4jLog4j
+
+    annotationProcessor depLibs.lombok
+    testAnnotationProcessor depLibs.lombok
+}
+
+configurations {
+    testArtifacts.extendsFrom testRuntime
+}
+
+task testJar(type: Jar) {
+    archiveClassifier.set('test')
+    from sourceSets.test.output
+}
+
+artifacts {
+    testArtifacts testJar
+}
diff --git a/bookkeeper-http/http-server/build.gradle b/bookkeeper-http/http-server/build.gradle
new file mode 100644
index 0000000..03200dd
--- /dev/null
+++ b/bookkeeper-http/http-server/build.gradle
@@ -0,0 +1,29 @@
+/*
+ * 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.
+ */
+plugins {
+    id 'java'
+}
+
+dependencies {
+    implementation depLibs.commonsConfiguration
+    implementation depLibs.jacksonCore
+    implementation depLibs.jacksonDatabind
+    implementation depLibs.jacksonAnnotations
+    implementation depLibs.slf4j
+}
diff --git a/bookkeeper-proto/build.gradle b/bookkeeper-proto/build.gradle
new file mode 100644
index 0000000..be33ca6
--- /dev/null
+++ b/bookkeeper-proto/build.gradle
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+plugins {
+    id 'com.google.protobuf'
+    id 'java'
+}
+
+dependencies {
+    implementation depLibs.protobuf
+}
+
+protobuf {
+    protoc {
+        artifact = depLibs.protoc
+    }
+}
diff --git a/bookkeeper-server/build.gradle b/bookkeeper-server/build.gradle
new file mode 100644
index 0000000..4401de1
--- /dev/null
+++ b/bookkeeper-server/build.gradle
@@ -0,0 +1,87 @@
+/*
+ * 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.
+ */
+plugins {
+    id 'java'
+}
+
+dependencies {
+    implementation project(':bookkeeper-common')
+    implementation project(':bookkeeper-common-allocator')
+    implementation project(':bookkeeper-http:http-server')
+    implementation project(':bookkeeper-proto')
+    implementation project(':bookkeeper-stats')
+    implementation project(':circe-checksum')
+    implementation project(':cpu-affinity')
+    implementation project(':tools:framework')
+
+    compileOnly depLibs.lombok
+    compileOnly depLibs.spotbugsAnnotations
+    implementation depLibs.bcpkixJdk15on
+    implementation depLibs.bcproveExtJdk15on
+    implementation depLibs.bcFips
+    implementation depLibs.commonsCli
+    implementation depLibs.commonsCodec
+    implementation depLibs.commonsCollections4
+    implementation depLibs.commonsConfiguration
+    implementation depLibs.commonsIO
+    implementation depLibs.commonsLang3
+    implementation depLibs.commonsLang3
+    implementation depLibs.guava
+    implementation depLibs.httpclient
+    implementation depLibs.jacksonAnnotations
+    implementation depLibs.jcommander
+    implementation depLibs.jctools
+    implementation depLibs.jna
+    implementation depLibs.nettyHandler
+    implementation depLibs.nettyTcnativeBoringSsl
+    implementation depLibs.nettyTransportNativeEpoll
+    implementation depLibs.protobuf
+    implementation depLibs.rocksDb
+    implementation depLibs.zookeeper
+
+    testImplementation project(':bookkeeper-stats-providers:prometheus-metrics-provider')
+    testImplementation project(path: ':bookkeeper-common', configuration: 'testArtifacts')
+
+    testCompileOnly depLibs.lombok
+    testImplementation depLibs.hamcrest
+    testImplementation depLibs.jacksonDatabind
+    testImplementation depLibs.junit
+    testImplementation depLibs.junitFoundation
+    testImplementation depLibs.kerbySimpleKdc
+    testImplementation depLibs.mockito
+    testImplementation depLibs.powermockJunit
+    testImplementation depLibs.powermockMockito
+    testImplementation depLibs.zookeeperTest
+
+    annotationProcessor depLibs.lombok
+    testAnnotationProcessor depLibs.lombok
+}
+
+test {
+    maxHeapSize = '2G'
+    forkEvery = 1
+}
+
+test.doFirst {
+    def junitFoundation = configurations.testCompileClasspath.resolvedConfiguration
+        .resolvedArtifacts.find { it.name == 'junit-foundation' }
+    jvmArgs("-javaagent:${junitFoundation.file}", "-Djunit.timeout.test=600000", "-Djunit.max.retry=3",
+            "-Djava.net.preferIPv4Stack=true", "-Dio.netty.leakDetection.level=paranoid")
+}
+
diff --git a/bookkeeper-stats-providers/prometheus-metrics-provider/build.gradle b/bookkeeper-stats-providers/prometheus-metrics-provider/build.gradle
new file mode 100644
index 0000000..ca9d215
--- /dev/null
+++ b/bookkeeper-stats-providers/prometheus-metrics-provider/build.gradle
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+plugins {
+    id 'java'
+}
+
+dependencies {
+    implementation project(":bookkeeper-stats")
+    implementation depLibs.commonsConfiguration
+    implementation depLibs.guava
+    implementation depLibs.jettyServlet
+    implementation depLibs.nettyCommon
+    implementation depLibs.prometheusSimpleClient
+    implementation depLibs.prometheusSimpleClientHotspot
+    implementation depLibs.prometheusSimpleClientServlet
+    implementation depLibs.slf4j
+    implementation depLibs.yahooDatasketches
+
+    testCompileOnly depLibs.lombok
+    testImplementation depLibs.junit
+    testAnnotationProcessor depLibs.lombok
+}
diff --git a/bookkeeper-stats/build.gradle b/bookkeeper-stats/build.gradle
new file mode 100644
index 0000000..9507cc8
--- /dev/null
+++ b/bookkeeper-stats/build.gradle
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+plugins {
+    id 'java'
+}
+
+dependencies {
+    implementation depLibs.commonsConfiguration
+    implementation depLibs.slf4j
+}
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..2e96e6a
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+buildscript {
+    repositories {
+        mavenCentral()
+    }
+}
+
+plugins {
+    id 'com.google.protobuf'
+    id 'java'
+}
+
+allprojects {
+    apply from: "$rootDir/dependencies.gradle"
+
+    repositories {
+        mavenCentral()
+    }
+}
+
+pluginManager.withPlugin('java') {
+    sourceCompatibility = targetCompatibility = 8
+}
\ No newline at end of file
diff --git a/circe-checksum/build.gradle b/circe-checksum/build.gradle
new file mode 100644
index 0000000..17258fe
--- /dev/null
+++ b/circe-checksum/build.gradle
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+plugins {
+    id 'java'
+}
+
+dependencies {
+    implementation depLibs.guava
+    implementation depLibs.nettyBuffer
+    implementation depLibs.slf4j
+    testImplementation depLibs.junit
+    testImplementation depLibs.mockito
+}
+
+task generateJniHeaders(type:Exec) {
+    ext {
+        javahOutputDir = "$buildDir/javahGenerated"
+    }
+    dependsOn classes
+    def classpath = sourceSets.main.output.classesDirs.join(":")
+    commandLine("javah", "-d", javahOutputDir, "-classpath",
+                classpath, "com.scurrilous.circe.crc.Sse42Crc32C")
+}
+
+jar {
+    from (tasks.getByPath(":circe-checksum:src:main:circe:linkRelease").outputs.files.filter { f -> f.isFile()} ) {
+        into "/lib"
+    }
+}
diff --git a/circe-checksum/src/main/circe/build.gradle b/circe-checksum/src/main/circe/build.gradle
new file mode 100644
index 0000000..4679f89
--- /dev/null
+++ b/circe-checksum/src/main/circe/build.gradle
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+import org.gradle.internal.jvm.Jvm
+
+plugins {
+    id 'cpp-library'
+}
+
+library {
+    baseName = 'circe-checksum'
+
+    binaries.configureEach { CppBinary binary ->
+        def compileTask = binary.compileTask.get()
+        compileTask.dependsOn project(':circe-checksum').generateJniHeaders
+        compileTask.includes.from("${Jvm.current().javaHome}/include",
+                                  project(':circe-checksum').generateJniHeaders.javahOutputDir)
+
+        compileTask.includes.from("${Jvm.current().javaHome}/include/linux")
+        compileTask.includes.from("${Jvm.current().javaHome}/include/darwin")
+
+        compileTask.source.from fileTree(dir: "cpp", include: "**/*.cpp")
+        compileTask.compilerArgs.addAll(["-msse4.2", "-mpclmul", "-O3"])
+    }
+}
diff --git a/cpu-affinity/build.gradle b/cpu-affinity/build.gradle
new file mode 100644
index 0000000..981fd6d
--- /dev/null
+++ b/cpu-affinity/build.gradle
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+plugins {
+    id 'java'
+}
+
+dependencies {
+    compileOnly depLibs.lombok
+    compileOnly depLibs.spotbugsAnnotations
+    implementation depLibs.commonsLang3
+    implementation depLibs.guava
+    implementation depLibs.slf4j
+    testImplementation depLibs.junit
+
+    annotationProcessor depLibs.lombok
+}
+
+task generateJniHeaders(type:Exec) {
+    ext {
+        javahOutputDir = "$buildDir/javahGenerated"
+    }
+    dependsOn classes
+    def classpath = sourceSets.main.output.classesDirs.join(":")
+    commandLine("javah", "-d", javahOutputDir, "-classpath",
+                classpath, "org.apache.bookkeeper.common.util.affinity.impl.CpuAffinityJni")
+}
+
+jar {
+    from (tasks.getByPath(":cpu-affinity:src:main:affinity:linkRelease").outputs.files.filter { f -> f.isFile()} ) {
+        into "/lib"
+    }
+}
diff --git a/cpu-affinity/src/main/affinity/build.gradle b/cpu-affinity/src/main/affinity/build.gradle
new file mode 100644
index 0000000..c2ed921
--- /dev/null
+++ b/cpu-affinity/src/main/affinity/build.gradle
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+import org.gradle.internal.jvm.Jvm
+
+plugins {
+    id 'cpp-library'
+}
+
+library {
+    binaries.configureEach { CppBinary binary ->
+        def compileTask = binary.compileTask.get()
+        compileTask.dependsOn project(':cpu-affinity').generateJniHeaders
+        compileTask.includes.from("${Jvm.current().javaHome}/include",
+                                  project(':cpu-affinity').generateJniHeaders.javahOutputDir)
+        compileTask.includes.from("${Jvm.current().javaHome}/include/linux")
+        compileTask.includes.from("${Jvm.current().javaHome}/include/darwin")
+        compileTask.source.from fileTree(dir: "cpp", include: "**/*.c")
+
+        compileTask.compilerArgs.addAll(["-x", "c", "-std=c11"])
+    }
+}
+
diff --git a/dependencies.gradle b/dependencies.gradle
new file mode 100644
index 0000000..a47ced9
--- /dev/null
+++ b/dependencies.gradle
@@ -0,0 +1,108 @@
+/*
+ * 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.
+ */
+ext {
+    depVersions = null
+    depLibs = null
+}
+
+depVersions = [
+    bcFips: "1.0.1",
+    bouncycastle: "1.60",
+    commonsCli: "1.2",
+    commonsCodec: "1.6",
+    commonsCollections4: "4.1",
+    commonsConfiguration: "1.10",
+    commonsIO: "2.4",
+    commonsLang3: "3.6",
+    errorprone: "2.1.2",
+    guava: "21.0",
+    hamcrest: "1.3",
+    httpclient: "4.5.13",
+    jackson: "2.9.7",
+    jcommander: "1.78",
+    jctools: "2.1.2",
+    jetty: "9.4.5.v20170502",
+    jna: "3.2.7",
+    jsr305: "3.0.2",
+    junit: "4.12",
+    junitFoundation: "11.0.0",
+    kerby: "1.1.1",
+    log4j: "1.2.17",
+    lombok: "1.18.10",
+    mockito: "3.0.0",
+    netty: "4.1.32.Final",
+    nettyTcnativeBoringSsl: "2.0.20.Final",
+    powermock: "2.0.2",
+    prometheus: "0.0.21",
+    protobuf: "3.14.0",
+    rocksDb: "6.13.3",
+    slf4j: "1.7.25",
+    spotbugsAnnotations: "3.1.8",
+    yahooDatasketches: "0.8.3",
+    zookeeper: "3.4.13",
+]
+
+depLibs = [
+    bcpkixJdk15on: "org.bouncycastle:bcpkix-jdk15on:${depVersions.bouncycastle}",
+    bcproveExtJdk15on: "org.bouncycastle:bcprov-ext-jdk15on:${depVersions.bouncycastle}",
+    bcFips: "org.bouncycastle:bc-fips:${depVersions.bcFips}",
+    commonsCli: "commons-cli:commons-cli:${depVersions.commonsCli}",
+    commonsCodec: "commons-codec:commons-codec:${depVersions.commonsCodec}",
+    commonsCollections4: "org.apache.commons:commons-collections4:${depVersions.commonsCollections4}",
+    commonsConfiguration: "commons-configuration:commons-configuration:${depVersions.commonsConfiguration}",
+    commonsIO: "commons-io:commons-io:${depVersions.commonsIO}",
+    commonsLang3: "org.apache.commons:commons-lang3:${depVersions.commonsLang3}",
+    errorprone: "com.google.errorprone:error_prone_annotations:${depVersions.errorprone}",
+    guava: "com.google.guava:guava:${depVersions.guava}",
+    hamcrest: "org.hamcrest:hamcrest-all:${depVersions.hamcrest}",
+    httpclient: "org.apache.httpcomponents:httpclient:${depVersions.httpclient}",
+    jacksonAnnotations: "com.fasterxml.jackson.core:jackson-annotations:${depVersions.jackson}",
+    jacksonCore: "com.fasterxml.jackson.core:jackson-core:${depVersions.jackson}",
+    jacksonDatabind: "com.fasterxml.jackson.core:jackson-databind:${depVersions.jackson}",
+    jcommander: "com.beust:jcommander:${depVersions.jcommander}",
+    jctools: "org.jctools:jctools-core:${depVersions.jctools}",
+    jettyServlet: "org.eclipse.jetty:jetty-servlet:${depVersions.jetty}",
+    jna: "net.java.dev.jna:jna:${depVersions.jna}",
+    jsr305: "com.google.code.findbugs:jsr305:${depVersions.jsr305}",
+    junit: "junit:junit:${depVersions.junit}",
+    junitFoundation: "com.nordstrom.tools:junit-foundation:${depVersions.junitFoundation}",
+    kerbySimpleKdc: "org.apache.kerby:kerb-simplekdc:${depVersions.kerby}",
+    log4j: "log4j:log4j:${depVersions.log4j}",
+    lombok: "org.projectlombok:lombok:${depVersions.lombok}",
+    mockito: "org.mockito:mockito-core:${depVersions.mockito}",
+    nettyBuffer: "io.netty:netty-buffer:${depVersions.netty}",
+    nettyCommon: "io.netty:netty-common:${depVersions.netty}",
+    nettyHandler: "io.netty:netty-handler:${depVersions.netty}",
+    nettyTcnativeBoringSsl: "io.netty:netty-tcnative-boringssl-static:${depVersions.nettyTcnativeBoringSsl}",
+    nettyTransportNativeEpoll: "io.netty:netty-transport-native-epoll:${depVersions.netty}",
+    powermockJunit: "org.powermock:powermock-module-junit4:${depVersions.powermock}",
+    powermockMockito: "org.powermock:powermock-api-mockito2:${depVersions.powermock}",
+    prometheusSimpleClient: "io.prometheus:simpleclient:${depVersions.prometheus}",
+    prometheusSimpleClientHotspot: "io.prometheus:simpleclient_hotspot:${depVersions.prometheus}",
+    prometheusSimpleClientServlet: "io.prometheus:simpleclient_servlet:${depVersions.prometheus}",
+    protobuf: "com.google.protobuf:protobuf-java:${depVersions.protobuf}",
+    protoc: "com.google.protobuf:protoc:${depVersions.protobuf}",
+    rocksDb: "org.rocksdb:rocksdbjni:${depVersions.rocksDb}",
+    slf4j: "org.slf4j:slf4j-api:${depVersions.slf4j}",
+    slf4jLog4j: "org.slf4j:slf4j-log4j12:${depVersions.slf4j}",
+    spotbugsAnnotations: "com.github.spotbugs:spotbugs-annotations:${depVersions.spotbugsAnnotations}",
+    yahooDatasketches: "com.yahoo.datasketches:sketches-core:${depVersions.yahooDatasketches}",
+    zookeeper: "org.apache.zookeeper:zookeeper:${depVersions.zookeeper}",
+    zookeeperTest: "org.apache.zookeeper:zookeeper:${depVersions.zookeeper}:tests",
+]
diff --git a/gradle.properties b/gradle.properties
new file mode 100644
index 0000000..bde5141
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,22 @@
+#
+#
+# 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.
+#
+#
+
+protobufPluginVersion=0.8.15
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..28861d2
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..07f97c7
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,26 @@
+#
+#
+# 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.
+#
+#
+
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
new file mode 100755
index 0000000..eea9650
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,186 @@
+#!/usr/bin/env sh
+#
+# Copyright 2015 the original author or authors.
+#
+# Licensed 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
+#
+#      https://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.
+#
+##############################################################################
+##
+##  Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+        PRG="$link"
+    else
+        PRG=`dirname "$PRG"`"/$link"
+    fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+    echo "$*"
+}
+
+die () {
+    echo
+    echo "$*"
+    echo
+    exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+  CYGWIN* )
+    cygwin=true
+    ;;
+  Darwin* )
+    darwin=true
+    ;;
+  MINGW* )
+    msys=true
+    ;;
+  NONSTOP* )
+    nonstop=true
+    ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+        # IBM's JDK on AIX uses strange locations for the executables
+        JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+        JAVACMD="$JAVA_HOME/bin/java"
+    fi
+    if [ ! -x "$JAVACMD" ] ; then
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+    fi
+else
+    JAVACMD="java"
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+    MAX_FD_LIMIT=`ulimit -H -n`
+    if [ $? -eq 0 ] ; then
+        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+            MAX_FD="$MAX_FD_LIMIT"
+        fi
+        ulimit -n $MAX_FD
+        if [ $? -ne 0 ] ; then
+            warn "Could not set maximum file descriptor limit: $MAX_FD"
+        fi
+    else
+        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+    fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+    JAVACMD=`cygpath --unix "$JAVACMD"`
+
+    # We build the pattern for arguments to be converted via cygpath
+    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+    SEP=""
+    for dir in $ROOTDIRSRAW ; do
+        ROOTDIRS="$ROOTDIRS$SEP$dir"
+        SEP="|"
+    done
+    OURCYGPATTERN="(^($ROOTDIRS))"
+    # Add a user-defined pattern to the cygpath arguments
+    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+    fi
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
+    i=0
+    for arg in "$@" ; do
+        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
+
+        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
+            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+        else
+            eval `echo args$i`="\"$arg\""
+        fi
+        i=$((i+1))
+    done
+    case $i in
+        (0) set -- ;;
+        (1) set -- "$args0" ;;
+        (2) set -- "$args0" "$args1" ;;
+        (3) set -- "$args0" "$args1" "$args2" ;;
+        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+    esac
+fi
+
+# Escape application args
+save () {
+    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+    echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+  cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..41ddb99
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,99 @@
+@rem#
+@rem# Copyright 2015 the original author or authors.
+@rem#
+@rem# Licensed under the Apache License, Version 2.0 (the "License");
+@rem# you may not use this file except in compliance with the License.
+@rem# You may obtain a copy of the License at
+@rem#
+@rem#      https://www.apache.org/licenses/LICENSE-2.0
+@rem#
+@rem# Unless required by applicable law or agreed to in writing, software
+@rem# distributed under the License is distributed on an "AS IS" BASIS,
+@rem# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem# See the License for the specific language governing permissions and
+@rem# limitations under the License.
+@rem#
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem  Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 0000000..7bf66ea
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+pluginManagement {
+    plugins {
+        id "com.google.protobuf" version "${protobufPluginVersion}"
+    }
+}
+
+rootProject.name = 'bookkeeper'
+
+include('circe-checksum', 'circe-checksum:src:main:circe',
+        'cpu-affinity', 'cpu-affinity:src:main:affinity', 'bookkeeper-common',
+        'bookkeeper-http:http-server', 'bookkeeper-server',
+        'bookkeeper-common-allocator', 'bookkeeper-proto', 'bookkeeper-stats',
+        'bookkeeper-stats-providers:prometheus-metrics-provider',
+        'tools:framework')
diff --git a/tools/framework/build.gradle b/tools/framework/build.gradle
new file mode 100644
index 0000000..28e637a
--- /dev/null
+++ b/tools/framework/build.gradle
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+plugins {
+    id 'java'
+}
+
+dependencies {
+    implementation project(":bookkeeper-common")
+    compileOnly depLibs.lombok
+    compileOnly depLibs.spotbugsAnnotations
+    implementation depLibs.commonsConfiguration
+    implementation depLibs.guava
+    implementation depLibs.jcommander
+    implementation depLibs.slf4j
+    testImplementation depLibs.junit
+
+    annotationProcessor depLibs.lombok
+}