feat(projectstructure): reorganize the module directory in the root to a suitable subdirectory

close:#22458839

Signed-off-by: leonrayang <chl696@sina.com>
This commit is contained in:
leonrayang 2024-08-01 19:14:34 +08:00 committed by AmazingChi
parent c384557efe
commit 3396accd80
108 changed files with 85 additions and 55 deletions

View File

@ -331,7 +331,7 @@ build_client() {
build_authtool() {
pushd $SrcPath >/dev/null
echo -n "build cfs-authtool "
CGO_ENABLED=0 go build ${MODFLAGS} -gcflags=all=-trimpath=${SrcPath} -asmflags=all=-trimpath=${SrcPath} -ldflags="${LDFlags}" -o ${BuildBinPath}/cfs-authtool ${SrcPath}/authtool/*.go && echo "success" || echo "failed"
CGO_ENABLED=0 go build ${MODFLAGS} -gcflags=all=-trimpath=${SrcPath} -asmflags=all=-trimpath=${SrcPath} -ldflags="${LDFlags}" -o ${BuildBinPath}/cfs-authtool ${SrcPath}/authnode/authtool/*.go && echo "success" || echo "failed"
popd >/dev/null
}
@ -357,14 +357,14 @@ build_cfs_deploy() {
build_fsck() {
pushd $SrcPath >/dev/null
echo -n "build cfs-fsck "
CGO_ENABLED=0 go build ${MODFLAGS} -gcflags=all=-trimpath=${SrcPath} -asmflags=all=-trimpath=${SrcPath} -ldflags="${LDFlags}" -o ${BuildBinPath}/cfs-fsck ${SrcPath}/fsck/*.go && echo "success" || echo "failed"
CGO_ENABLED=0 go build ${MODFLAGS} -gcflags=all=-trimpath=${SrcPath} -asmflags=all=-trimpath=${SrcPath} -ldflags="${LDFlags}" -o ${BuildBinPath}/cfs-fsck ${SrcPath}/tool/fsck/*.go && echo "success" || echo "failed"
popd >/dev/null
}
build_snapshot() {
pushd $SrcPath >/dev/null
echo -n "build cfs-snapshot "
go build $MODFLAGS -ldflags "${LDFlags}" -o ${BuildBinPath}/cfs-snapshot ${SrcPath}/snapshot/*.go && echo "success" || echo "failed"
go build $MODFLAGS -ldflags "${LDFlags}" -o ${BuildBinPath}/cfs-snapshot ${SrcPath}/tool/snapshot/*.go && echo "success" || echo "failed"
popd >/dev/null
}
@ -380,7 +380,7 @@ build_libsdkpre() {
esac
pushd $SrcPath > /dev/null
echo -n "build libsdk: libcfs.so"
CGO_ENABLED=1 go build $MODFLAGS -gcflags=all=-trimpath=${SrcPath} -asmflags=all=-trimpath=${SrcPath} -ldflags="${LDFlags}" -buildmode c-shared -o ${TargetFile} ${SrcPath}/libsdk/*.go && echo "success" || echo "failed"
CGO_ENABLED=1 go build $MODFLAGS -gcflags=all=-trimpath=${SrcPath} -asmflags=all=-trimpath=${SrcPath} -ldflags="${LDFlags}" -buildmode c-shared -o ${TargetFile} ${SrcPath}/client/libsdk/*.go && echo "success" || echo "failed"
popd > /dev/null
}
@ -396,35 +396,35 @@ build_libsdk() {
esac
pushd $SrcPath >/dev/null
echo -n "build libsdk: libcfs.so "
CGO_ENABLED=1 go build $MODFLAGS -gcflags=all=-trimpath=${SrcPath} -asmflags=all=-trimpath=${SrcPath} -ldflags="${LDFlags}" -buildmode c-shared -o ${TargetFile} ${SrcPath}/libsdk/*.go && echo "success" || echo "failed"
CGO_ENABLED=1 go build $MODFLAGS -gcflags=all=-trimpath=${SrcPath} -asmflags=all=-trimpath=${SrcPath} -ldflags="${LDFlags}" -buildmode c-shared -o ${TargetFile} ${SrcPath}/client/libsdk/*.go && echo "success" || echo "failed"
popd >/dev/null
pushd $SrcPath/java >/dev/null
pushd $SrcPath/client/java >/dev/null
echo -n "build java libcubefs "
mkdir -p $SrcPath/java/src/main/resources/
\cp -rf ${TargetFile} $SrcPath/java/src/main/resources/
mkdir -p $SrcPath/client/java/src/main/resources/
\cp -rf ${TargetFile} $SrcPath/client/java/src/main/resources/
mvn clean package
\cp -rf $SrcPath/java/target/*.jar ${BuildBinPath} && echo "build java libcubefs success" || echo "build java libcubefs failed"
\cp -rf $SrcPath/client/java/target/*.jar ${BuildBinPath} && echo "build java libcubefs success" || echo "build java libcubefs failed"
popd >/dev/null
}
build_fdstore() {
pushd $SrcPath >/dev/null
echo -n "build fdstore "
CGO_ENABLED=0 go build ${MODFLAGS} -gcflags=all=-trimpath=${SrcPath} -asmflags=all=-trimpath=${SrcPath} -ldflags="${LDFlags}" -o ${BuildBinPath}/fdstore ${SrcPath}/fdstore/*.go && echo "success" || echo "failed"
CGO_ENABLED=0 go build ${MODFLAGS} -gcflags=all=-trimpath=${SrcPath} -asmflags=all=-trimpath=${SrcPath} -ldflags="${LDFlags}" -o ${BuildBinPath}/fdstore ${SrcPath}/client/fdstore/*.go && echo "success" || echo "failed"
popd >/dev/null
}
build_preload() {
pushd $SrcPath >/dev/null
echo -n "build cfs-preload "
CGO_ENABLED=0 go build ${MODFLAGS} -gcflags=all=-trimpath=${SrcPath} -asmflags=all=-trimpath=${SrcPath} -ldflags="${LDFlags}" -o ${BuildBinPath}/cfs-preload ${SrcPath}/preload/*.go && echo "success" || echo "failed"
CGO_ENABLED=0 go build ${MODFLAGS} -gcflags=all=-trimpath=${SrcPath} -asmflags=all=-trimpath=${SrcPath} -ldflags="${LDFlags}" -o ${BuildBinPath}/cfs-preload ${SrcPath}/tool/preload/*.go && echo "success" || echo "failed"
}
build_bcache(){
pushd $SrcPath >/dev/null
echo -n "build cfs-blockcache "
CGO_ENABLED=0 go build ${MODFLAGS} -gcflags=all=-trimpath=${SrcPath} -asmflags=all=-trimpath=${SrcPath} -ldflags="${LDFlags}" -o ${BuildBinPath}/cfs-bcache ${SrcPath}/blockcache/*.go && echo "success" || echo "failed"
CGO_ENABLED=0 go build ${MODFLAGS} -gcflags=all=-trimpath=${SrcPath} -asmflags=all=-trimpath=${SrcPath} -ldflags="${LDFlags}" -o ${BuildBinPath}/cfs-bcache ${SrcPath}/client/blockcache/*.go && echo "success" || echo "failed"
popd >/dev/null
}

View File

@ -28,7 +28,7 @@ import (
"strings"
"syscall"
"github.com/cubefs/cubefs/blockcache/bcache"
"github.com/cubefs/cubefs/client/blockcache/bcache"
"github.com/cubefs/cubefs/cmd/common"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/util/config"

View File

@ -27,7 +27,7 @@ import (
"time"
"github.com/cubefs/cubefs/blobstore/api/access"
"github.com/cubefs/cubefs/blockcache/bcache"
"github.com/cubefs/cubefs/client/blockcache/bcache"
"github.com/cubefs/cubefs/client/common"
"github.com/cubefs/cubefs/depends/bazil.org/fuse"
"github.com/cubefs/cubefs/depends/bazil.org/fuse/fs"

View File

@ -44,7 +44,7 @@ import (
"github.com/cubefs/cubefs/sdk/meta"
"github.com/cubefs/cubefs/blockcache/bcache"
"github.com/cubefs/cubefs/client/blockcache/bcache"
cfs "github.com/cubefs/cubefs/client/fs"
"github.com/cubefs/cubefs/depends/bazil.org/fuse"
"github.com/cubefs/cubefs/depends/bazil.org/fuse/fs"

View File

@ -18,7 +18,7 @@ import (
"github.com/bits-and-blooms/bitset"
"github.com/cubefs/cubefs/blobstore/api/access"
"github.com/cubefs/cubefs/blobstore/common/trace"
"github.com/cubefs/cubefs/blockcache/bcache"
"github.com/cubefs/cubefs/client/blockcache/bcache"
"github.com/cubefs/cubefs/client/fs"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/sdk/data/blobstore"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,5 @@
#Generated by Maven
#Thu Aug 01 18:58:17 CST 2024
groupId=io.cubefs
artifactId=libcubefs
version=1.0-SNAPSHOT

View File

@ -0,0 +1,10 @@
io/cubefs/fs/CfsLibrary$StatInfo.class
io/cubefs/fs/CfsMount.class
io/cubefs/fs/CfsLibrary$Dirent.class
io/cubefs/fs/CfsLibrary$DirentArray$ByValue.class
io/cubefs/fs/CfsLibrary$SummaryInfo.class
io/cubefs/fs/CfsLibrary$SummaryInfo$ByValue.class
io/cubefs/fs/CfsLibrary.class
io/cubefs/fs/CfsLibrary$SummaryInfo$ByReference.class
io/cubefs/fs/CfsLibrary$DirentArray.class
io/cubefs/fs/TestCfsClient.class

View File

@ -0,0 +1,3 @@
/home/leonchang/src/github.com/chubaofs/chubaofs/client/java/src/main/java/io/cubefs/fs/CfsLibrary.java
/home/leonchang/src/github.com/chubaofs/chubaofs/client/java/src/main/java/io/cubefs/fs/CfsMount.java
/home/leonchang/src/github.com/chubaofs/chubaofs/client/java/src/main/java/io/cubefs/fs/TestCfsClient.java

View File

@ -117,7 +117,7 @@ import (
"github.com/bits-and-blooms/bitset"
"github.com/cubefs/cubefs/blobstore/api/access"
"github.com/cubefs/cubefs/blobstore/common/trace"
"github.com/cubefs/cubefs/blockcache/bcache"
"github.com/cubefs/cubefs/client/blockcache/bcache"
"github.com/cubefs/cubefs/client/fs"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/sdk/data/blobstore"

View File

@ -28,9 +28,9 @@ import (
"github.com/cubefs/cubefs/blobstore/util/bytespool"
"github.com/cubefs/cubefs/util/exporter"
"github.com/cubefs/cubefs/datanode/repl"
"github.com/cubefs/cubefs/datanode/storage"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/repl"
"github.com/cubefs/cubefs/storage"
"github.com/cubefs/cubefs/util"
"github.com/cubefs/cubefs/util/errors"
"github.com/cubefs/cubefs/util/log"

View File

@ -11,9 +11,9 @@ import (
"testing"
"time"
"github.com/cubefs/cubefs/datanode/repl"
"github.com/cubefs/cubefs/datanode/storage"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/repl"
"github.com/cubefs/cubefs/storage"
"github.com/cubefs/cubefs/util"
"github.com/cubefs/cubefs/util/exporter"
"github.com/stretchr/testify/assert"

View File

@ -30,11 +30,11 @@ import (
"sync/atomic"
"time"
"github.com/cubefs/cubefs/datanode/repl"
"github.com/cubefs/cubefs/datanode/storage"
raftProto "github.com/cubefs/cubefs/depends/tiglabs/raft/proto"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/raftstore"
"github.com/cubefs/cubefs/repl"
"github.com/cubefs/cubefs/storage"
"github.com/cubefs/cubefs/util"
"github.com/cubefs/cubefs/util/auditlog"
"github.com/cubefs/cubefs/util/errors"

View File

@ -24,10 +24,10 @@ import (
"strings"
"sync/atomic"
"github.com/cubefs/cubefs/datanode/repl"
"github.com/cubefs/cubefs/datanode/storage"
"github.com/cubefs/cubefs/depends/tiglabs/raft"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/repl"
"github.com/cubefs/cubefs/storage"
"github.com/cubefs/cubefs/util/exporter"
"github.com/cubefs/cubefs/util/log"
)

View File

@ -27,6 +27,7 @@ import (
"sync/atomic"
"time"
"github.com/cubefs/cubefs/datanode/repl"
raftproto "github.com/cubefs/cubefs/depends/tiglabs/raft/proto"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/raftstore"

View File

@ -22,6 +22,7 @@ import (
"sync"
"sync/atomic"
"github.com/cubefs/cubefs/datanode/storage"
"github.com/cubefs/cubefs/depends/tiglabs/raft"
raftproto "github.com/cubefs/cubefs/depends/tiglabs/raft/proto"
"github.com/cubefs/cubefs/proto"

View File

@ -21,9 +21,9 @@ import (
"strings"
"time"
"github.com/cubefs/cubefs/datanode/storage"
"github.com/cubefs/cubefs/depends/tiglabs/raft"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/storage"
"github.com/cubefs/cubefs/util"
"github.com/cubefs/cubefs/util/errors"
"github.com/cubefs/cubefs/util/exporter"

View File

@ -33,9 +33,9 @@ import (
"time"
"github.com/cubefs/cubefs/cmd/common"
"github.com/cubefs/cubefs/datanode/repl"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/raftstore"
"github.com/cubefs/cubefs/repl"
masterSDK "github.com/cubefs/cubefs/sdk/master"
"github.com/cubefs/cubefs/util"
"github.com/cubefs/cubefs/util/atomicutil"

View File

@ -26,9 +26,9 @@ import (
"syscall"
"github.com/cubefs/cubefs/cmd/common"
"github.com/cubefs/cubefs/datanode/storage"
"github.com/cubefs/cubefs/depends/tiglabs/raft"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/storage"
"github.com/cubefs/cubefs/util/config"
"github.com/cubefs/cubefs/util/log"
)

View File

@ -22,8 +22,8 @@ import (
"strings"
"testing"
"github.com/cubefs/cubefs/datanode/storage"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/storage"
"github.com/cubefs/cubefs/util"
"github.com/stretchr/testify/require"
)

View File

@ -22,7 +22,7 @@ import (
"testing"
"github.com/cubefs/cubefs/blobstore/blobnode/sys"
"github.com/cubefs/cubefs/storage"
"github.com/cubefs/cubefs/datanode/storage"
"github.com/cubefs/cubefs/util"
"github.com/stretchr/testify/require"
)

View File

@ -29,11 +29,11 @@ import (
"sync"
"time"
"github.com/cubefs/cubefs/datanode/repl"
"github.com/cubefs/cubefs/datanode/storage"
"github.com/cubefs/cubefs/depends/tiglabs/raft"
raftProto "github.com/cubefs/cubefs/depends/tiglabs/raft/proto"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/repl"
"github.com/cubefs/cubefs/storage"
"github.com/cubefs/cubefs/util"
"github.com/cubefs/cubefs/util/auditlog"
"github.com/cubefs/cubefs/util/errors"

View File

@ -18,9 +18,9 @@ import (
"os"
"testing"
"github.com/cubefs/cubefs/datanode/repl"
"github.com/cubefs/cubefs/datanode/storage"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/repl"
"github.com/cubefs/cubefs/storage"
"github.com/cubefs/cubefs/util"
"github.com/stretchr/testify/require"
"golang.org/x/time/rate"

View File

@ -17,9 +17,9 @@ package datanode
import (
"sync/atomic"
"github.com/cubefs/cubefs/datanode/repl"
"github.com/cubefs/cubefs/datanode/storage"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/repl"
"github.com/cubefs/cubefs/storage"
)
func (s *DataNode) Post(p *repl.Packet) error {

View File

@ -20,9 +20,9 @@ import (
"hash/crc32"
"sync/atomic"
"github.com/cubefs/cubefs/datanode/repl"
"github.com/cubefs/cubefs/datanode/storage"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/repl"
"github.com/cubefs/cubefs/storage"
"github.com/cubefs/cubefs/util/log"
)

View File

@ -15,6 +15,16 @@ popd
export PATH=$PATH:/go/bin
for subdir in proto client/blockcache datanode/storage cli lcnode
do
pushd ${CurrentPath}/../../${subdir}
go generate ./...
if [[ $? -ne 0 ]]; then
exit 1
fi
popd
done
golintFile=golint.diff
pushd ${CurrentPath}/../..
go generate . > ${golintFile}
@ -27,4 +37,4 @@ if [ "$(cat ${golintFile}|wc -l)" -gt 0 ]; then
exit 1
fi
rm -f ${golintFile}
popd
popd

View File

@ -20,8 +20,8 @@ import (
"strconv"
"time"
"github.com/cubefs/cubefs/datanode/storage"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/storage"
"github.com/cubefs/cubefs/util/log"
)

View File

@ -26,7 +26,7 @@ import (
"sync/atomic"
"time"
"github.com/cubefs/cubefs/storage"
"github.com/cubefs/cubefs/datanode/storage"
raftProto "github.com/cubefs/cubefs/depends/tiglabs/raft/proto"
"github.com/cubefs/cubefs/proto"

View File

@ -18,7 +18,7 @@ import (
"fmt"
"net"
"github.com/cubefs/cubefs/storage"
"github.com/cubefs/cubefs/datanode/storage"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/util/log"

View File

@ -17,8 +17,8 @@ package metanode
import (
"encoding/json"
"github.com/cubefs/cubefs/datanode/storage"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/storage"
"github.com/cubefs/cubefs/util"
"github.com/cubefs/cubefs/util/log"
)

View File

@ -22,8 +22,8 @@ import (
"io"
"time"
"github.com/cubefs/cubefs/datanode/storage"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/storage"
"github.com/cubefs/cubefs/util"
"github.com/cubefs/cubefs/util/log"
"github.com/cubefs/cubefs/util/timeutil"

View File

@ -5,8 +5,8 @@ import (
"encoding/json"
"sync"
"github.com/cubefs/cubefs/datanode/storage"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/storage"
"github.com/cubefs/cubefs/util/log"
)

View File

@ -29,7 +29,7 @@ import (
"github.com/cubefs/cubefs/blobstore/common/rpc"
"github.com/cubefs/cubefs/blobstore/common/rpc/auditlog"
"github.com/cubefs/cubefs/blobstore/common/trace"
"github.com/cubefs/cubefs/blockcache/bcache"
"github.com/cubefs/cubefs/client/blockcache/bcache"
"github.com/cubefs/cubefs/cmd/common"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/sdk/data/blobstore"

View File

@ -23,7 +23,7 @@ import (
"syscall"
"time"
"github.com/cubefs/cubefs/blockcache/bcache"
"github.com/cubefs/cubefs/client/blockcache/bcache"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/sdk/data/manager"
"github.com/cubefs/cubefs/sdk/data/stream"

View File

@ -27,7 +27,7 @@ import (
"github.com/brahma-adshonor/gohook"
"github.com/stretchr/testify/assert"
"github.com/cubefs/cubefs/blockcache/bcache"
"github.com/cubefs/cubefs/client/blockcache/bcache"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/sdk/data/manager"
"github.com/cubefs/cubefs/sdk/data/stream"

View File

@ -24,7 +24,7 @@ import (
"sync/atomic"
"syscall"
"github.com/cubefs/cubefs/blockcache/bcache"
"github.com/cubefs/cubefs/client/blockcache/bcache"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/sdk/data/manager"
"github.com/cubefs/cubefs/sdk/data/stream"

View File

@ -22,7 +22,7 @@ import (
"sync/atomic"
"time"
"github.com/cubefs/cubefs/blockcache/bcache"
"github.com/cubefs/cubefs/client/blockcache/bcache"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/util"
"github.com/cubefs/cubefs/util/buf"

View File

@ -23,9 +23,9 @@ import (
"syscall"
"time"
"github.com/cubefs/cubefs/datanode/storage"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/sdk/data/wrapper"
"github.com/cubefs/cubefs/storage"
"github.com/cubefs/cubefs/util"
"github.com/cubefs/cubefs/util/errors"
"github.com/cubefs/cubefs/util/log"

View File

@ -36,10 +36,10 @@ import (
"sync/atomic"
"time"
"github.com/cubefs/cubefs/datanode/storage"
"github.com/cubefs/cubefs/metanode"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/sdk/data/stream"
"github.com/cubefs/cubefs/storage"
"github.com/cubefs/cubefs/util"
"github.com/cubefs/cubefs/util/log"
"github.com/spf13/cobra"

View File

@ -21,7 +21,7 @@ import (
"os"
"strings"
"github.com/cubefs/cubefs/fsck/cmd"
"github.com/cubefs/cubefs/tool/fsck/cmd"
"github.com/cubefs/cubefs/util/log"
)

View File

@ -7,8 +7,8 @@ import (
"strconv"
"strings"
"github.com/cubefs/cubefs/preload/sdk"
"github.com/cubefs/cubefs/proto"
"github.com/cubefs/cubefs/tool/preload/sdk"
"github.com/cubefs/cubefs/util/config"
)

Some files were not shown because too many files have changed in this diff Show More