Skip to content

Commit 013f770

Browse files
freyadyubrohitbrose
authored andcommitted
Add tutorial Chinese README.md
1 parent e1a690f commit 013f770

6 files changed

Lines changed: 86 additions & 1 deletion

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ Swim is a completely integrated solution for building scalable, end-to-end strea
66

77
- A **user interface** that uses Swim's streaming UI frameworks to visualize data from Swim servers in real-time
88

9+
*Read this in other languages: [English](README.md), [简体中文](README.zh-cn.md)*
10+
11+
912
## Run
1013

1114
* [Install JDK 9+](https://www.oracle.com/technetwork/java/javase/downloads/index.html).

README.zh-cn.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Swim 软件教程
2+
3+
Swim 是建造可规模化扩展的,终端到终端的流式(streaming)应用程序的完整的集成解决方案。
4+
相对于使用单独的消息代理(message brokers),应用伺服器(app servers),和数据库(database),Swim 应用程序只由两部分组成:
5+
6+
- **Swim 伺服器(server)** *内置* 维久性(persistence),通信(messaging),调度(scheduling), 聚类(clustering),复制(replication),自我测量(introspection),以及安全(security)。
7+
8+
- **操作界面(user interface)** 通过使用Swim的流式UI框架(streaming UI frameworks)视觉化来自Swim伺服器(Server)的实时数据
9+
10+
*其他语言版本:[English](README.md), [简体中文](README.zh-cn.md)*
11+
12+
13+
## Run
14+
* [安装 JDK 9+](https://www.oracle.com/technetwork/java/javase/downloads/index.html).
15+
* 确保您的`JAVA_HOME`环境变量设置指向您的Java安装地址。
16+
* 确保您的`PATH`包含`$JAVA_HOME`
17+
18+
* 从控制盘(console)进入 `server` 目录,运行 `./gradlew run` (Windows操作系统运行`.\gradlew.bat run`) 来启动Swim伺服器(server)。
19+
20+
* 然后在浏览器中打开 `ui/index.html`即可看到与伺服器相连的UI。
21+
22+
## 如何运作
23+
24+
浏览 [伺服器(server)](https://github.com/swimos/tutorial/blob/master/server)学习如何建立和处理在Swim伺服器(server)上的数据。
25+
26+
接着,浏览 [操作界面(ui)](https://github.com/swimos/tutorial/blob/master/ui) 来学习与众不同的Swim视觉化数据处理。

server/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
Swim unifies the traditionally disparate roles of database, message broker, job manager, and application server, into a few simple constructs.
44

5+
*Read this in other languages: [English](README.md), [简体中文](README.zh-cn.md)*
6+
57
## Web Agents
68

79
Swim implements a general purpose distributed object model. The "objects" in this model are **Web Agents**.

server/README.zh-cn.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Swim 伺服器(Server)
2+
3+
Swim 统一了传统的互不相干的数据库(database),消息代理(message broker),工件管理器(job manager),以及应用服务器(application server)等角色结合成了更为简单的构架。
4+
5+
*其他语言版本:[English](README.md), [简体中文](README.zh-cn.md)*
6+
7+
## 网络代理(Web Agent)
8+
9+
Swim 实现了通用目的的分布式对象模型。这些在模型中的“对象”被称为 **网络代理(Web Agents)**
10+
11+
[新建一个 class](http://github.com/swimos/tutorial/tree/master/server/src/main/java/swim/tutorial/UnitAgent.java#L13) 继承`swim.api.agent.AbstractAgent` 定义了一个网络代理的 *样板* (虽然在加入[lanes](#lanes)之前不可用)。
12+
13+
浏览 [参考文献](https://developer.swim.ai/concepts/agents/) 获得更多网络代理(Web Agents)详情。
14+
15+
## Lanes
16+
17+
若 Web Agents 是对象,则 **lanes** 在这些对象中担任这些对象的“域”。Lanes 有很多种形态,如:value lanes,map lanes 以及 command lanes。
18+
19+
继续我们的类比,*lane callback* 函数则是Web Agents的 “方法(methods)”。
20+
21+
每种 lane 的类型定义了一套可重写的(默认 no-op)生命周期回调。例如:[发送一条命令消息](#sending-data-do-swim) 到任意的 command lane 会触发 command lane [`onCommand` 回调](http://github.com/swimos/tutorial/tree/master/server/src/main/java/swim/tutorial/UnitAgent.java#L51-L54). 在另一方面, [设置一个 value lane](http://github.com/swimos/tutorial/tree/master/server/src/main/java/swim/tutorial/UnitAgent.java#L53) 会触发 value lane的 `willSet` 回调, 然后更新value lane的值,接着触发value lane 的 [`didSet` 回调](http://github.com/swimos/tutorial/tree/master/server/src/main/java/swim/tutorial/UnitAgent.java#L40-L47)
22+
23+
浏览 [参考文献](https://developer.swim.ai/concepts/lanes/) 获得更多lanes的更多详情。
24+
25+
## 设置 Swim 伺服器(Server)
26+
27+
Swim server 装载着 **平面(plane)**,plane 提供了Web Agents的运行时并且为信息到达正确的lane规划路径。
28+
29+
Plane 必须在每一种Web Agent 类别上都分别[宣告一个`AgentType`域(field)](http://github.com/swimos/tutorial/tree/master/server/src/main/java/swim/tutorial/TutorialPlane.java#L13-L14)
30+
31+
使用 `ServerLoader` 公用程序 class 来[在 Swim Server 上加载 plane](http://github.com/swimos/tutorial/tree/master/server/src/main/java/swim/tutorial/TutorialPlane.java#L18)。请注意模型必须[`提供` `swim.api.plane.Plane` 与自定义的plane class](http://github.com/swimos/tutorial/tree/master/server/src/main/java/module-info.java#L8)
32+
33+
浏览 [参考文献](https://developer.swim.ai/concepts) 获得更多详情。
34+
35+
## 将数据填入 Swim Server
36+
37+
每一个Swim 伺服器(Server)都可以从外部程序使用 Swim API 写入和读取。最简单地利用这个API的方式是使用一个**Swim Client** 实例来[发送指令到command lanes](http://github.com/swimos/tutorial/blob/master/server/src/main/java/swim/tutorial/DataSource.java#L40)
38+
39+
浏览 [参考文献](https://developer.swim.ai/concepts) 获得更多详情。
40+
41+
## 订阅 Swim Server 数据
42+
43+
Swim Client 实例使用 Swim **links** 从 Swim lanes 中获取数据。与links相对应的lanes一样,links也有可重写的回调函数,并且这个函数可以被用来[建造 UI](http://github.com/swimos/tutorial/tree/master/ui/index.html#L111-L133)
44+
45+
浏览 [参考文献](https://developer.swim.ai/concepts/links/) 获取更多详情。

ui/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Swim UI
22

3+
*Read this in other languages: [English](README.md), [简体中文](README.zh-cn.md)*
4+
35
The minimum you need to visualize Swim data is a Swim client. That said, Swim comes with additional tools that let you see your data right away with no extra work.
46

5-
Read [index.html](http://github.com/swimos/tutorial/tree/master/ui/index.html) to quickstart building your own gauges, pie charts, and line graphs.
7+
Read [index.html](http://github.com/swimos/tutorial/tree/master/ui/index.html) to quickstart building your own gauges, pie charts, and line graphs.

ui/README.zh-cn.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Swim 用户界面(UI)
2+
3+
*其他语言版本:[English](README.md), [简体中文](README.zh-cn.md)*
4+
5+
视觉化 Swim 数据要求最少有 Swim client。这就是说,Swim 自带辅助工具使得用户可以直接观察到数据而无需额外的工作。
6+
7+
阅读 [index.html](http://github.com/swimos/tutorial/tree/master/ui/index.html) 快速入门如何创建计量器(gauges),饼图(pie charts),和线状图表(line graphs)。

0 commit comments

Comments
 (0)