1"use strict";(self.webpackChunkcurvine_doc=self.webpackChunkcurvine_doc||[]).push([[5343],{28453:(e,s,n)=>{n.d(s,{R:()=>c,x:()=>d});var r=n(96540);const i={},t=r.createContext(i);function c(e){const s=r.useContext(t);return r.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function d(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:c(e.components),r.createElement(t.Provider,{value:s},e.children)}},72250:(e,s,n)=>{n.r(s),n.d(s,{assets:()=>a,contentTitle:()=>d,default:()=>h,frontMatter:()=>c,metadata:()=>r,toc:()=>o});const r=JSON.parse('{"id":"User-Manuals/Access/sdk","title":"SDK Access","description":"Curvine provides multi-language SDKs so applications can access the Curvine filesystem via RPC (metadata from Master, block data from Workers) without using FUSE or the S3 gateway.","source":"@site/docs/3-User-Manuals/4-Access/03-sdk.md","sourceDirName":"3-User-Manuals/4-Access","slug":"/User-Manuals/Access/sdk","permalink":"/docs/User-Manuals/Access/sdk","draft":false,"unlisted":false,"editUrl":"https://github.com/curvineio/curvine-doc/edit/main/docs/3-User-Manuals/4-Access/03-sdk.md","tags":[],"version":"current","sidebarPosition":3,"frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"S3 Object Storage Gateway","permalink":"/docs/User-Manuals/Access/s3-gateway"},"next":{"title":"K8S CSI Driver","permalink":"/docs/User-Manuals/K8S-CSI-Driver/Setup"}}');var i=n(74848),t=n(28453);const c={},d="SDK Access",a={},o=[{value:"Overview",id:"overview",level:2},{value:"Rust SDK",id:"rust-sdk",level:2},{value:"Java SDK",id:"java-sdk",level:2},{value:"Python SDK",id:"python-sdk",level:2},{value:"Common Configuration",id:"common-configuration",level:2}];function l(e){const s={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,t.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.header,{children:(0,i.jsx)(s.h1,{id:"sdk-access",children:"SDK Access"})}),"\n",(0,i.jsx)(s.p,{children:"Curvine provides multi-language SDKs so applications can access the Curvine filesystem via RPC (metadata from Master, block data from Workers) without using FUSE or the S3 gateway."}),"\n",(0,i.jsx)(s.h2,{id:"overview",children:"Overview"}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"SDK"}),(0,i.jsx)(s.th,{children:"Crate / Package"}),(0,i.jsx)(s.th,{children:"Use Case"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"Rust"})}),(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.code,{children:"curvine-client"})," / ",(0,i.jsx)(s.code,{children:"curvine-libsdk"})]}),(0,i.jsx)(s.td,{children:"Native Rust applications, high performance"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"Java"})}),(0,i.jsxs)(s.td,{children:["Hadoop-compatible FileSystem (",(0,i.jsx)(s.code,{children:"fs.cv://"}),"), Java SDK from curvine-libsdk"]}),(0,i.jsx)(s.td,{children:"Hadoop/Spark/Flink and other JVM applications"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"Python"})}),(0,i.jsx)(s.td,{children:"Python bindings from curvine-libsdk"}),(0,i.jsx)(s.td,{children:"ML/data pipelines, scripts"})]})]})]}),"\n",(0,i.jsxs)(s.p,{children:["All SDKs require a running Curvine cluster (Master and Workers) and correct client configuration (e.g. ",(0,i.jsx)(s.code,{children:"master_addrs"})," in ",(0,i.jsx)(s.code,{children:"curvine-cluster.toml"})," or equivalent)."]}),"\n",(0,i.jsx)(s.h2,{id:"rust-sdk",children:"Rust SDK"}),"\n",(0,i.jsxs)(s.p,{children:["Use the ",(0,i.jsx)(s.code,{children:"curvine-client"})," crate (or the Rust API exposed by ",(0,i.jsx)(s.code,{children:"curvine-libsdk"}),") to create files, read/write data, and list directories programmatically. Configuration is typically loaded from ",(0,i.jsx)(s.code,{children:"curvine-cluster.toml"})," or via environment variables."]}),"\n",(0,i.jsxs)(s.p,{children:["For build and usage, see the ",(0,i.jsx)(s.a,{href:"/docs/Contribute/development-guide",children:"Development Guide"})," and the Curvine source repository (e.g. ",(0,i.jsx)(s.code,{children:"curvine-client"}),", ",(0,i.jsx)(s.code,{children:"curvine-libsdk"}),", and integration tests under ",(0,i.jsx)(s.code,{children:"curvine-tests"}),")."]}),"\n",(0,i.jsx)(s.h2,{id:"java-sdk",children:"Java SDK"}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.strong,{children:"Hadoop FileSystem"}),": Configure ",(0,i.jsx)(s.code,{children:"fs.cv.impl"})," and ",(0,i.jsx)(s.code,{children:"fs.cv.master_addrs"})," in ",(0,i.jsx)(s.code,{children:"core-site.xml"})," or ",(0,i.jsx)(s.code,{children:"curvine-site.xml"})," so that ",(0,i.jsx)(s.code,{children:'FileSystem.get(URI.create("curvine:///path"), conf)'})," uses Curvine. See ",(0,i.jsx)(s.a,{href:"/docs/Deploy/Deploy-Curvine-Cluster/Preparation/deployment-setup#environment-script-and-main-config",children:"Deployment Preparation"})," for ",(0,i.jsx)(s.code,{children:"fs.cv.master_addrs"}),"."]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.strong,{children:"Java API"}),": Use the Curvine Java SDK from curvine-libsdk for direct RPC access when not using the Hadoop FileSystem interface."]}),"\n"]}),"\n",(0,i.jsx)(s.p,{children:"Compatible with Hadoop, Spark, Flink, and other JVM-based frameworks that support custom FileSystem implementations."}),"\n",(0,i.jsx)(s.h2,{id:"python-sdk",children:"Python SDK"}),"\n",(0,i.jsx)(s.p,{children:"The Python SDK (from curvine-libsdk) provides a native API to read/write files and list directories on Curvine. Typical use cases include ML training, data preprocessing, and automation scripts."}),"\n",(0,i.jsxs)(s.p,{children:["For installation and examples, see the Curvine source repository and ",(0,i.jsx)(s.a,{href:"/docs/Contribute/development-guide",children:"Development Guide"}),"."]}),"\n",(0,i.jsx)(s.h2,{id:"common-configuration",children:"Common Configuration"}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.strong,{children:"Master address"}),": Set ",(0,i.jsx)(s.code,{children:"client.master_addrs"})," in the cluster config (e.g. ",(0,i.jsx)(s.code,{children:"curvine-cluster.toml"}),") or pass the equivalent in each SDK (e.g. Java ",(0,i.jsx)(s.code,{children:"fs.cv.master_addrs"}),"). Format: ",(0,i.jsx)(s.code,{children:"host1:8995,host2:8995"}),"."]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.strong,{children:"Config file"}),": Most SDKs accept a config file path (e.g. ",(0,i.jsx)(s.code,{children:"conf/curvine-cluster.toml"}),"). The same file is used by the CLI (",(0,i.jsx)(s.code,{children:"cv"}),"), FUSE, and S3 gateway."]}),"\n"]}),"\n",(0,i.jsxs)(s.p,{children:["For UFS (unified file system) access, mount UFS paths with ",(0,i.jsx)(s.code,{children:"cv mount"}),"; then SDK operations on the corresponding Curvine paths will follow the same semantics as ",(0,i.jsx)(s.a,{href:"/docs/User-Manuals/Key-Features/ufs",children:"Data Orchestration"}),"."]})]})}function h(e={}){const{wrapper:s}={...(0,t.R)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.