跳至内容
DFS Binder Local

DFS Binder Local

Use this binder for development, tests, or a single node with a shared filesystem.

<dependency>
  <groupId>io.github.loadup-cloud</groupId>
  <artifactId>loadup-components-dfs-binder-local</artifactId>
</dependency>
loadup:
  dfs:
    binder-type: local
    binder.local.base-path: /var/lib/loadup-dfs

Objects are stored below <base-path>/objects; metadata is persisted below <base-path>/metadata. This binder has no presigned URL or multipart capability and requires a filesystem visible to the application node.


设计与实现

职责与边界

文件存储的具体后端适配模块;由集成方按需引入。

Maven 依赖边界

直接依赖的框架模块:

  • loadup-components-dfs-api

直接依赖的外部坐标(不含测试与 provided scope):

  • org.springframework.boot:spring-boot-autoconfigure
  • com.github.spotbugs:spotbugs-annotations

实现入口

主要入口文件:

分层与调用路径

LocalDfsTemplate 直接实现 DfsTemplate,处理本地文件和元数据。

业务代码 → API/facade → 当前 binder → 第三方引擎或基础设施

binder 实现框架契约,把实现库及其配置隔离在业务 API 之外。

装配规则

  • LocalDfsAutoConfiguration 是自动配置入口。

    @ConditionalOnProperty(prefix = "loadup.dfs", name = "binder-type", havingValue = "local", matchIfMissing = true)
    • @ConditionalOnMissingBean(DfsTemplate.class)

配置归属

设计取舍

选择独立 binder,使文件存储实现的依赖留在集成应用;替换底层实现时,业务侧仍使用 DfsTemplate 契约。

集成方式与配置示例见 README.md。