翻译monetdb的m5manual.pdf(重要内容翻译)-2

本文详细介绍了MonetDB的Assembly Language (MAL),包括其基本指令、流程控制、异常处理、函数和工厂。MAL支持标准函数抽象,具备垃圾回收机制,并提供资源管理,如属性管理和成本模型。此外,还强调了预定义属性和如何在MAL级别处理代码属性。
摘要由CSDN通过智能技术生成

2、客户端接口

Online help

The textual interface mclient supports a limited form of online help commands.

>>?bat.is

bat.isSynced

bat.isCached

bat.isPersisten

3、MonetDB Assembly Language (MAL)

3.1 MAL Literals

3.2 MAL Variables

3.3 Instructions

A MAL instruction has purposely a simple format. It is syntactically represented by an assignment, where an expression (function call) delivers results to multiple target variables.

3.4 MAL Flow-of-control

The flow of control within a MAL program block can be changed by tagging a statement with either return, yield, barrier, catch, leave, redo, or exit

3.5 Exception handling

3.6 Functions

MAL comes with a standard functional abstraction scheme. Functions are represented by MAL instruction lists, enclosed by a function signature and end statement. 

he functional abstraction scheme comes with several variations: commands, patterns, and factories. 

3.7 Factories

        定义可以重复执行的mal。它是跟client的session有关系,是一种function。可以用于做物化视图。

3.9类型

3.11 Boxed Variables

在Clients sessions中,可以有boxed的变量,用于做程序处理和循环控制。在session过程中有效。Session Box是在整个session过程有效。

这样,一个mal计算过程就产生了垃圾,有垃圾回收机制。

还有Globale Environment全局变量,就是在所有session都生效的变量。

3.12 Property Management

资源管理,This mal_properties module provides a generic scheme to administer property sets and a concise API to manage them.

Properties can be associated with variables, MAL blocks, and MAL instructions. The property list is initialized upon explicit request only, e.g. by the frontend parser, a box manager, or as a triggered action.

Every property should come with a function that accepts a reference to the variable and updates the property record. This function is activated either once or automatically upon each selection.

3.13 Properties at the MAL level

就是获得代码中的属性,并且可以处理。(主要是获得BAT的数据量属性,可以用于更新BAT的信息。)

3.14 The cost model problem

3.17 Property ADT implementation

addProperty(O,P) adds property P to the list associated with O. If O represents a compound structure, e.g. a BAT, we should indicate the component as well. For example, addProperty(O,P,Ia,...Ib) introduces a property shared by the components Ia..Ib (indicated with an integer index. hasProperty(O,P) is a boolean function that merely checks existence hasnotProperty(O,P) is the dual operation.

setProperty(O,P,V) changes the propety value to V. It may raise a PropertyUpdateViolation exception when this can not be realized. Note, the property value itself is changed, not the object referenced.

getProperty(O,P) retrieves the current value of a property. This may involve calling a function or running a database query.

setPropertyAttribute(O,P,A) changes the behavior of the property. For example, the attribute ’freeze’ will result in a call to the underlying function only once and to cache the result for the remainder of the objects life time.

3.18 Predefined properties

The MAL language uses a few defaults, recognizable as properties

unsafe function has side effects.Default, unsafe=off

read data can be read but not updated

append data can be appended

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值