Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

curvefs/client: now we support hadoop sdk #2807

Merged
merged 4 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -169,3 +169,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/
2 changes: 1 addition & 1 deletion .obm.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
container_name: curve-build-playground-master
container_name: curve-build-playground.master
container_image: opencurvedocker/curve-base:build-debian11
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,9 @@ docker:

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

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

sdk:
@bash util/sdk.sh
25 changes: 23 additions & 2 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 @@ -192,7 +192,6 @@ new_local_repository(
path = "thirdparties/memcache/libmemcached-1.1.2",
)


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
15 changes: 12 additions & 3 deletions curvefs/conf/client.conf
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,26 @@ 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:
# fs.disableXAttr:
# if you want to get better metadata performance,
# you can mount fs with |fs.disableXattr| is true
# you can mount fs with |fs.disableXAttr| is true
#
# fs.lookupCache.negativeTimeoutSec:
# entry which not found will be cached if |timeout| > 0
fs.cto=true
fs.maxNameLength=255
fs.disableXattr=false
fs.disableXAttr=true
fs.accessLogging=true
fs.kernelCache.attrTimeoutSec=3600
fs.kernelCache.dirAttrTimeoutSec=3600
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",
h0hmj marked this conversation as resolved.
Show resolved Hide resolved
],
deps = [
"@com_google_absl//absl/cleanup",
"@jni//:copy_jni_hdr_lib",
"//curvefs/sdk/libcurvefs:curvefs_lib",
],
linkshared = True,
)
Loading