The Persistent Object System Metastore: Persistence Via Metaprogramming
Total Page:16
File Type:pdf, Size:1020Kb
The Persistent Object System MetaStore: Persistence via Metaprogramming Arthur H. Lee UUCS-92-027 Department of Computer Science University of Utah Salt Lake City, UT 84112 USA June 10, 1992 Abstract Object-intensive applications require persistence of complex objects. Many of these applica tions also use vast amounts of data, often exceeding a machine’s virtual memory. MetaStore is a portable, persistent object system designed to solve these problems. MetaStore uses the metaprogramming facilities of the metaobject protocol to add per sistence to the Common Lisp Object System. This approach leaves the semantics of CL OS unchanged, requires only minimal syntactic changes to existing programs, and needs no com piler support. In the resulting language, programmers can define both classes and slots to be persistent. MetaStore then handles persistence at the metaobject level. MetaStore focuses on the persistence of passive data by providing a virtual object mem ory. It tries to keep an appropriate number of objects in memory to maintain system per formance at an acceptable level, and allows programmers to tune performance by specifying object and slot clustering. MetaStore currently supports only limited aspects of class evolu tion. MetaStore addresses a range of issues in implementing persistence, including object iden tity, addressing mechanisms, shared objects and structures, dirty bits, queries, transaction management, version control, object base garbage collection, and object clustering. Based on the initial implementation of MetaStore, we show performance measurements and propose improvements to the metaobject protocol of CLOS. CDRS CAD system, an object-intensive application at Evans & Sutherland Computer Corp., will soon be ported to MetaStore. The Persistent Object System MetaStore: Persistence via Metaprogramming by Arthur H. Lee A dissertation submitted to the faculty of The University of Utah in partial fulfillment of the requirements for the degree of Doctor of Philosophy Department of Computer Science The University of Utah August 1992 Copyright © Arthur H. Lee 1992 All Rights Reserved THE UNIVERSITY OF UTAH GRADUATE SCHOOL SUPERVISORY COMMITTEE APPROVAL of a dissertation submitted by Arthur H. Lee This dissertation has been read by each member of the following supervisory committee and by majority vote has been found to be satisfactory. /*7f2L <9 , Ganf/E. Lindstrom THE UNIVERSITY OF UTAH GRADUATE SCHOOL FINAL READING APPROVAL To the Graduate Council of The University of Utah: I have read the dissertation o f___________ Arthur H. Lee___________ in its final form and have found that (1) its format, citations, and bibliographic style are consistent and acceptable; (2) its illustrative materials including figures, tables, and charts are in place; and (3) the final manuscript is satisfactory to the Supervisory Committee and is ready for submission to the Graduate School. .-Aae*- _________________ Date Jos\ej>h) L. Zash#ry ^3 Chair, Supervisory Committee Approved for the Major Department " I KflMAfl-4 C- U&asI za S Thomas C. Henderson Chair/Dean Approved for the Graduate Council S. j&Lu A ct B. Gale Dick Dean of The Graduate School Abstract Object-intensive applications require persistence of complex objects. Many of these applications also use vast amounts of data, often exceeding a machine’s virtual memory. MetaStore is a portable, persistent object system designed to solve these problems. MetaStore uses the metaprogramming facilities of the metaobject protocol to add persistence to the Common Lisp Object System. This approach leaves the semantics of CLOS unchanged, requires only minimal syntactic changes to existing programs, and needs no compiler support. In the resulting language, programmers can define both classes and slots to be persistent. MetaStore then handles persistence at the metaobject level. MetaStore focuses on the persistence of passive data by providing a virtual object memory. It tries to keep an appropriate number of objects in memory to maintain system performance at an acceptable level, and allows programmers to tune performance by specifying object and slot clustering. MetaStore currently supports only limited aspects of class evolution. MetaStore addresses a range of issues in implementing persistence, including object identity, addressing mechanisms, shared objects and structures, dirty bits, queries, transaction management, version control, object base garbage collection, and object clustering. Based on the initial implementation of MetaStore, we show performance mea surements and propose improvements to the metaobject protocol of CLOS. CDRS CAD system, an object-intensive application at Evans & Sutherland Computer Corp., will soon be ported to MetaStore. To Joyce, Chris, and Jamie. Contents Acknowledgments..................................................................................................xiii 1. Introduction....................................................................................................... 1 1.1 Object Persistence................................................................................... 3 1.1.1 CDRS: An Object-intensive Application................................ 3 1.1.2 Understanding The P ro b le m ................................................... 4 1.2 Related Work ......................................................................................... 6 1.2.1 Interlisp ...................................................................................... 6 1.2.2 P S -A lg o l...................................................................................... 7 1.2.3 M n em e......................................................................................... 8 1.2.4 P C L O S ......................................................................................... 9 1.3 M eta S tore............................................................................................... 10 1.3.1 Research Goals............................................................................ 10 1.3.2 Language Extension via Metaprogramming......................... 11 1.3.3 Persistent Object S to r e ............................................................ 12 1.3.4 MetaStore Architecture............................................................ 13 1.4 Roadm ap................................................................................................... 13 2. Preliminaries.................................................................................................... 15 2.1 Object-Oriented Program m ing............................................................ 15 2.1.1 Encapsulation............................................................................ 16 2.1.2 Dynamic B in d in g ...................................................................... 17 2.1.3 Inheritance................................................................................... 19 2.2 Persistent Object M odel......................................................................... 20 2.2.1 Mandatory Features................................................................... 21 2.2.2 Optional Features...................................................................... 22 2.3 Metaprogramming................................................................................... 22 2.4 Persistence Schemes............................................................................... 25 2.4.1 Addressing Mechanisms............................................................ 26 2.4.2 Incremental S a v es...................................................................... 26 2.4.3 Shared Structures...................................................................... 27 2.4.4 Orthogonal Persistence............................................................ 29 2.4.5 Selective Persistence................................................................... 30 2.4.6 Granularity of Persistence......................................................... 31 2.4.7 P ortability................................................................................... 31 2.4.8 Summary...................................................................................... 32 3. Language E xtension via M etaprogram m ing.............................................33 3.1 Overview of M e t a ...................................................................................... 33 3.2 Programmer’s View of MetaStore ...................................................... ... 37 3.2.1 Programming C onventions...................................................... ... 37 3.2.2 Semantic C hanges......................................................................... 39 3.3 Object Identity ......................................................................................... 39 3.4 Object Persistence...................................................................................... 40 3.5 Structure of Memory O b jects................................................................... 41 3.6 Husks and Granularity of P ersisten ce................................................... 42 3.7 Addressing Mechanisms......................................................................... ... 44 3.7.1 Associative OID Addressing ...................................................... 45 3.7.2 Pointer S w izzlin g ......................................................................... 45 3.8 Metaobject Protocol in A ction ............................................................ ... 46 3.8.1