Skip to content

Commit

Permalink
curvefs/client: now we support hadoop sdk.
Browse files Browse the repository at this point in the history
Signed-off-by: Wine93 <[email protected]>
  • Loading branch information
Wine93 committed Oct 18, 2023
1 parent 112cd41 commit 1f8b2f6
Show file tree
Hide file tree
Showing 165 changed files with 11,414 additions and 435 deletions.
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ BasedOnStyle: Google
AccessModifierOffset: -3
DerivePointerAlignment: false
IndentWidth: 4
AlignAfterOpenBracket: DontAlign
---
Language: Proto
BasedOnStyle: Google
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
# fetch everything to be able to compare with any ref
fetch-depth: 0

- name: Check
- name: Check
env:
LANG: "C.UTF-8"
LC_ALL: "C.UTF-8"
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,11 @@ test/integration/snapshotcloneserver/config/*.conf

*.deb
*.whl

*.class
curvefs/sdk/java/target/
curvefs/sdk/java/native/build
curvefs/sdk/libcurvefs/examples/bin
curvefs/sdk/output/
hadoop-test/
nnbench-test/
4 changes: 2 additions & 2 deletions .obm.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
container_name: curve-build-playground-master
container_image: opencurvedocker/curve-base:build-debian9
container_name: curve-build-playground.master
container_image: opencurvedocker/curve-base:build-debian11
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,12 @@ test:

docker:
@bash util/docker.sh --os=$(os) --ci=$(ci)

format:
@bash util/format.sh $(commit_id)

init-hadoop:
@bash util/init-hadoop.sh

sdk:
@bash util/sdk.sh
27 changes: 24 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ git_repository(
patches = [
"//:thirdparties/brpc/brpc.patch",
"//:thirdparties/brpc/fix-gcc11.patch",
"//:thirdparties/brpc/0001-bvar-warning-on-conflict-bvar-name.patch",
"//:thirdparties/brpc/0001-bvar-warning-on-conflict-bvar-name.patch",
],
patch_args = ["-p1"],
)
Expand Down Expand Up @@ -189,10 +189,9 @@ new_local_repository(
new_local_repository(
name = "libmemcached",
build_file = "//:thirdparties/memcache/memcache.BUILD",
path = "thirdparties/memcache/libmemcached-1.1.2",
path = "thirdparties/memcache/libmemcached-1.1.4",
)


http_archive(
name = "aws",
urls = ["https://github.com/aws/aws-sdk-cpp/archive/1.7.340.tar.gz"],
Expand Down Expand Up @@ -259,6 +258,21 @@ http_archive(
build_file = "//:thirdparties/spdlog.BUILD",
)

# incbin
new_git_repository(
name = "incbin",
remote = "https://github.com/graphitemaster/incbin.git",
commit = "6e576cae5ab5810f25e2631f2e0b80cbe7dc8cbf",
build_file = "//:thirdparties/incbin.BUILD",
)

# config
new_local_repository(
name = "config",
build_file = "//:thirdparties/config.BUILD",
path = "thirdparties/config",
)

# Bazel platform rules.
http_archive(
name = "platforms",
Expand All @@ -274,6 +288,13 @@ new_local_repository(
path = "thirdparties/rocksdb",
)

# jni
new_local_repository(
name = "jni",
build_file = "//:thirdparties/jni.BUILD",
path = "thirdparties",
)

# Hedron's Compile Commands Extractor for Bazel
# https://github.com/hedronvision/bazel-compile-commands-extractor
http_archive(
Expand Down
9 changes: 9 additions & 0 deletions curvefs/conf/client.conf
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,15 @@ fuseClient.throttle.burstReadIops=0
# the times that read burst Iops can continue, default 180s
fuseClient.throttle.burstReadIopsSecs=180

#### vfs (virtual filesystem)
#{
vfs.userPermission.uid=0
vfs.userPermission.gids=0
vfs.userPermission.umask=0022
vfs.entryCache.lruSize=2000000
vfs.attrCache.lruSize=2000000
#}

#### filesystem metadata
# {
# fs.disableXAttr:
Expand Down
2 changes: 2 additions & 0 deletions curvefs/sdk/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DisableFormat: true
SortIncludes: Never
18 changes: 18 additions & 0 deletions curvefs/sdk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Hadoop SDK
===

How to build
---

``` bash
$ git clone [email protected]:opencurve/curve.git
$ cd curve
$ make dep stor=fs
$ make sdk
```

It will generate a jar after build success:

```
Build SDK success => /curve/curvefs/sdk/output/curvefs-hadoop-1.0-SNAPSHOT.jar
```
36 changes: 36 additions & 0 deletions curvefs/sdk/java/native/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#
# Copyright (c) 2023 NetEase Inc.
#
# 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
#
# 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.
#

load("//:copts.bzl", "CURVE_DEFAULT_COPTS")

cc_binary(
name = "curvefs_jni",
srcs = glob([
"*.h",
"*.cpp",
]),
visibility = ["//visibility:public"],
copts = CURVE_DEFAULT_COPTS,
linkopts = [
"-Wl,-rpath=/tmp/libcurvefs,--disable-new-dtags",
],
deps = [
"@com_google_absl//absl/cleanup",
"@jni//:copy_jni_hdr_lib",
"//curvefs/sdk/libcurvefs:curvefs_lib",
],
linkshared = True,
)
Loading

0 comments on commit 1f8b2f6

Please sign in to comment.