Backtracking for Distributed Model Execution Refactoring Preview Batch Refactoring Actions and Settings Ptolemy Editor Backtracking Motivation – Distributed.

Slides:



Advertisements
Similar presentations
Chapter 22 Implementing lists: linked implementations.
Advertisements

Introduction to Java 2 Programming Lecture 7 IO, Files, and URLs.
Identity and Equality Based on material by Michael Ernst, University of Washington.
CSC 243 – Java Programming, Spring 2013 March 26, 2013 Week 8, java.lang.Clonable & java.io.Serializable Interfaces.
Chapter 7 User-Defined Methods. Chapter Objectives  Understand how methods are used in Java programming  Learn about standard (predefined) methods and.
Lecture 2: Object Oriented Programming I
Rule Based Operational Semantics Specification in Ptolemy Yanwar Asrigo COMP 763B - Modeling and Simulation Based Design 30 th April 2008.
Type System, March 12, Data Types and Behavioral Types Yuhong Xiong Edward A. Lee Department of Electrical Engineering and Computer Sciences University.
CSE 2501 Review Declaring a variable allocates space for the type of datum it is to store int x; // allocates space for an int int *px; // allocates space.
Slides prepared by Rose Williams, Binghamton University Chapter 13 Interfaces and Inner Classes.
Lecture 4: Objects and Classes Classes Objects Data fields (instance variables) Methods –Instance methods –Static methods –Constructors But first…
Design of Fault Tolerant Data Flow in Ptolemy II Mark McKelvin EE290 N, Fall 2004 Final Project.
1 Memory Model of A Program, Methods Overview l Closer Look at Methods l Memory Model of JVM »Method Area »Heap »Stack l Preview: Parameter Passing.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L08 (Chapter 18) Binary I/O.
Models of Computation as Program Transformations Chris Chang
Stimulating reuse with an automated active code search tool Júlio Lins – André Santos (Advisor) –
Building and debugging Electric 1 Building and debugging GNU Electric version 8.08 by Java SDK & Eclipse (Ganymede) by Kazzz (a Japanese engineer) May.
Java Methods By J. W. Rider. Java Methods Modularity Declaring methods –Header, signature, prototype Static Void Local variables –this Return Reentrancy.
Java Software Solutions Lewis and Loftus Chapter 2 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Software Concepts -- Introduction.
Introduction to Java Appendix A. Appendix A: Introduction to Java2 Chapter Objectives To understand the essentials of object-oriented programming in Java.
Modern Concurrency Abstractions for C# by Nick Benton, Luca Cardelli & C´EDRIC FOURNET Microsoft Research.
Managing Multi-User Databases AIMS 3710 R. Nakatsu.
1 Identifiers  Identifiers are the words a programmer uses in a program  An identifier can be made up of letters, digits, the underscore character (
1 Exceptions (Section 8.5) CSCI 431 Programming Languages Fall 2003 A compilation of material developed by Felix Hernandez-Campos and Michael Scott.
Coding Methodology How to Design Code. © 2005 MIT-Africa Internet Technology Initiative Pay Attention to Detail When implementing or using APIs details.
Files and Streams. Java I/O File I/O I/O streams provide data input/output solutions to the programs. A stream can represent many different kinds of sources.
Prepared by : A.Alzubair Hassan Kassala university Dept. Computer Science Lecture 2 I/O Streams 1.
Sadegh Aliakbary Sharif University of Technology Spring 2012.
Console Input. So far… All the inputs for our programs have been hard-coded in the main method or inputted using the dialog boxes of BlueJ It’s time to.
Copyright © Curt Hill Java Looking at our first console application in Eclipse.
LexEVS in a caGrid Environment Interacting with LexEVS 5.0 November 2009.
JAVA Tokens. Introduction A token is an individual element in a program. More than one token can appear in a single line separated by white spaces.
Chapter 9 1 Chapter 9 – Part 1 l Overview of Streams and File I/O l Text File I/O l Binary File I/O l File Objects and File Names Streams and File I/O.
Case Study - Fractions Timothy Budd Oregon State University.
Chapter 14 - Designing Data Access Classes1 Chapter 14 Designing Data Access Classes.
Best Practices. Contents Bad Practices Good Practices.
Eclipse Eclipse An IDE is an Integrated Development Environment Different IDEs meet different needs – BlueJ, DrJava are designed as teaching.
10 Nov 1.HW 3 Remember to submit a.jsp file: for a valid int for an int with errors that produces the java program 2.Structure clashes 3.HW 4: Backtracking.
Chapter 15 Text Processing and File Input/Output Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin,
CSSE501 Object-Oriented Development. Chapter 4: Classes and Methods  Chapters 4 and 5 present two sides of OOP: Chapter 4 discusses the static, compile.
Eclipse 24-Apr-17.
Programs and Classes A program is made up from classes Classes may be grouped into packages A class has two parts static parts exist independently Non-static.
The 14 th IEEE Real-Time and Embedded Technology and Applications Symposium, April 2008 Real-Time Distributed Discrete-Event Execution with Fault Tolerance.
Classes. Constructor A constructor is a special method whose purpose is to construct and initialize objects. Constructor name must be the same as the.
Chapter 3 Introduction to Classes and Objects Definitions Examples.
©SoftMoore ConsultingSlide 1 Serialization. ©SoftMoore ConsultingSlide 2 Serialization Allows objects to be written to a stream Can be used for persistence.
Incremental Checkpointing with Application to Distributed Discrete Event Simulation Thomas Huining Feng and Edward A. Lee {tfeng,
22 Nov 1.Comments on HW3 2.Java I/O – Exception handling 3.Inversion 4.JSD.
1 Exceptions Exception handling – Exception Indication of problem during execution – E.g., divide by zero – Chained exceptions Uses of exception handling.
Java & C++ Comparisons How important are classes and objects?? What mechanisms exist for input and output?? Are references and pointers the same thing??
File Systems - Part I CS Introduction to Operating Systems.
AOP with AspectJ Awais Rashid, Steffen Zschaler © Awais Rashid, Steffen Zschaler 2009.
© Dr. A. Williams, Fall Present Software Quality Assurance – Clover Lab 1 Tutorial / lab 2: Code instrumentation Goals of this session: 1.Create.
OOPSLA Lab1 Chapter 7 Java Binding Prof. Hyoung-Joo Kim OOPSLA Lab. Dept. of Computer Engineering Seoul National University.
Computer Science Lecture 19, page 1 CS677: Distributed OS Last Class: Fault tolerance Reliable communication –One-one communication –One-many communication.
FILES AND EXCEPTIONS Topics Introduction to File Input and Output Using Loops to Process Files Processing Records Exceptions.
9.1 CLASS (STATIC) VARIABLES AND METHODS Defining classes is only one aspect of object-oriented programming. The real power of object-oriented programming.
Software Construction Lab 10 Unit Testing with JUnit
More Sophisticated Behavior
Java Primer 1: Types, Classes and Operators
Ptolemy II - Heterogeneous Concurrent Modeling and Design in Java
Section 64 – Manipulating Data Using Methods – Java Swing
Memento Design Pattern
I/O Basics.
Chapter 17 Binary I/O 1.
Topics Introduction to File Input and Output
null, true, and false are also reserved.
Programs and Classes A program is made up from classes
Java Looking at our first console application in Eclipse
Topics Introduction to File Input and Output
Presentation transcript:

Backtracking for Distributed Model Execution Refactoring Preview Batch Refactoring Actions and Settings Ptolemy Editor Backtracking Motivation – Distributed model execution requires backtracking. When a component receives a message tagged with a time in its past, it must rollback and process the message in the correct sequential order. – Incremental backtracking aims to capture every change in model states. Every time an actor assigns a new value to its private non-static field (state), the old value must be remembered so that a rollback can be issued later. Automatic Java Source Refactoring – It is boring for the programmers to manually capture all the changes, so we take a refactoring approach. – An Eclipse plug-in refactors actor source code as it is being written. A command-line tool is implemented to refactor a list of sources at a time. Backtracking with Checkpoint Objects – A checkpoint object monitors a group of objects to be checkpointed and rolled back at the same time. – A timestamp is the handle of a checkpoint. – The rollback method of a checkpoint object rolls the state back to a previous timestamp. Modified SDF Director – In its original design, SDF does not conform to the prefire-fire-postfire semantics. – The modified SDF director conforms to the prefire-fire-postfire semantics by recording a checkpoint before the first fire. – SDF composite actors can now be embedded in CT and provide the correct semantics in a clean way. prefire create checkpoint firerollback delete checkpoint postfire package mypackage; import java.io.InputStream; /** * A buffer of predefined size for an input stream. */ public class StreamBuffer { /** * Construct a buffer with an input stream. */ public StreamBuffer(InputStream stream) { _stream = stream; } /** * Return the next byte in the buffer. If the buffer * is empty, more bytes are read from the input stream. */ public byte nextByte() throws Exception { if (_pointer >= SIZE) { _stream.read(_buffer); _pointer = 0; } return _buffer[_pointer++]; } /** * Size of the buffer. */ public static final int SIZE = 20; // The buffer. private byte[] _buffer = new byte[SIZE]; // The current read position in the buffer. private int _pointer = SIZE; // The input stream to be read. private InputStream _stream; } package refactored.mypackage; import java.io.InputStream; import java.lang.Object; import ptolemy.backtrack.Checkpoint; import ptolemy.backtrack.Rollbackable; import ptolemy.backtrack.util.CheckpointRecord; import ptolemy.backtrack.util.FieldRecord; /** * A buffer of predefined size for an input stream. */ public class StreamBuffer implements Rollbackable { protected Checkpoint $CHECKPOINT = new Checkpoint(this); /** * Size of the buffer. */ public static final int SIZE = 20; // The buffer. private byte[] _buffer = new byte[SIZE]; // The current read position in the buffer. private int _pointer = SIZE; // The input stream to be read. private InputStream _stream; /** * Construct a buffer with an input stream. */ public StreamBuffer(InputStream stream) { $ASSIGN$_stream(stream); } /** * Return the next byte in the buffer. If the buffer * is empty, more bytes are read from the input stream. */ public byte nextByte() throws Exception { if (_pointer >= SIZE) { _stream.read($BACKUP$_buffer()); $ASSIGN$_pointer(0); } return _buffer[$ASSIGN$SPECIAL$_pointer(11, _pointer)]; } // Extra fields and methods omitted.... }