// Increment i i += 1; // Restart timer this->start(Cycles::rdtsc() + clock->updateIntervalCycles); updater->start(0); // Start immediately. CS 190 Lecture.

Slides:



Advertisements
Similar presentations
Chapter 6 Server-side Programming: Java Servlets
Advertisements

CS4432: Database Systems II Buffer Manager 1. 2 Covered in week 1.
Remote Procedure Call (RPC)
The Zebra Striped Network Filesystem. Approach Increase throughput, reliability by striping file data across multiple servers Data from each client is.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
CSC1016 Coursework Clarification Derek Mortimer March 2010.
Chapter 7Louden, Programming Languages1 Chapter 7 - Control I: Expressions and Statements "Control" is the general study of the semantics of execution.
OS2-1 Chapter 2 Computer System Structures. OS2-2 Outlines Computer System Operation I/O Structure Storage Structure Storage Hierarchy Hardware Protection.
C Lecture Notes 1 Program Control (Cont...). C Lecture Notes 2 4.8The do / while Repetition Structure The do / while repetition structure –Similar to.
4/25/08Prof. Hilfinger CS164 Lecture 371 Global Optimization Lecture 37 (From notes by R. Bodik & G. Necula)
Distributed Systems Fall 2009 Replication Fall 20095DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
CS 201 Functions Debzani Deb.
1Bloom Filters Lookup questions: Does item “ x ” exist in a set or multiset? Data set may be very big or expensive to access. Filter lookup questions with.
Polymorphism. Lecture Objectives To understand the concept of polymorphism To understand the concept of static or early binding To understand the concept.
CSCI2413 Lecture 6 Operating Systems Memory Management 2 phones off (please)
Chapter 7Louden, Programming Languages1 Chapter 7 - Control I: Expressions and Statements "Control" is the general study of the semantics of execution.
11 Chapter 4 LOOPS AND FILES. 22 THE INCREMENT AND DECREMENT OPERATORS To increment a variable means to increase its value by one. To decrement a variable.
Distributed Deadlocks and Transaction Recovery.
REFACTORING Lecture 4. Definition Refactoring is a process of changing the internal structure of the program, not affecting its external behavior and.
CSCI 6962: Server-side Design and Programming JDBC Database Programming.
Lecture 21 Last lecture Today’s lecture Cache Memory Virtual memory
Chord & CFS Presenter: Gang ZhouNov. 11th, University of Virginia.
By Lecturer / Aisha Dawood 1.  You can control the number of dispatcher processes in the instance. Unlike the number of shared servers, the number of.
PHP meets MySQL.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
ASP.NET Programming with C# and SQL Server First Edition Chapter 3 Using Functions, Methods, and Control Structures.
Chapter 4: Decision Making with Control Structures and Statements JavaScript - Introductory.
Project 1 Due Date: September 25 th Quiz 4 is due September 28 th Quiz 5 is due October2th 1.
Virtual Memory Expanding Memory Multiple Concurrent Processes.
1 Compiler Construction (CS-636) Muhammad Bilal Bashir UIIT, Rawalpindi.
1 File Systems: Consistency Issues. 2 File Systems: Consistency Issues File systems maintains many data structures  Free list/bit vector  Directories.
Chapter 3 Functions, Events, and Control Structures JavaScript, Third Edition.
Topic 1 Object Oriented Programming. 1-2 Objectives To review the concepts and terminology of object-oriented programming To discuss some features of.
ICS 313: Programming Language Theory Chapter 13: Concurrency.
Chapter 11: File System Implementation Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 11: File System Implementation Chapter.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 2 Computer-System Structures Slide 1 Chapter 2 Computer-System Structures.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 6 Functions.
Consensus and leader election Landon Cox February 6, 2015.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
Academic Year 2014 Spring. MODULE CC3005NI: Advanced Database Systems “DATABASE RECOVERY” (PART – 2) Academic Year 2014 Spring.
M1G Introduction to Programming 2 3. Creating Classes: Room and Item.
Session 1 Module 1: Introduction to Data Integrity
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Spring 2004 ECE569 Lecture 05.1 ECE 569 Database System Engineering Spring 2004 Yanyong Zhang
Slides prepared by Rose Williams, Binghamton University Chapter 16 Collections and Iterators.
Chapter 1 Java Programming Review. Introduction Java is platform-independent, meaning that you can write a program once and run it anywhere. Java programs.
1 Scope Lifetime Functions (the Sequel) Chapter 8.
CS320n – Elements of Visual Programming Assignment Help Session.
ICOM 6005 – Database Management Systems Design Dr. Manuel Rodríguez-Martínez Electrical and Computer Engineering Department Lecture 7 – Buffer Management.
1 Run-to-Completion Non-Preemptive Scheduler. 2 In These Notes... What is Scheduling? What is non-preemptive scheduling? Examples Run to completion (cooperative)
Lecture 4 – Function (Part 1) FTMK, UTeM – Sem /2014.
LECTURE 12 Virtual Memory. VIRTUAL MEMORY Just as a cache can provide fast, easy access to recently-used code and data, main memory acts as a “cache”
Introduction to Programming G50PRO University of Nottingham Unit 6 : Control Flow Statements 2 Paul Tennent
C Program Control September 15, OBJECTIVES The essentials of counter-controlled repetition. To use the for and do...while repetition statements.
Computer Science Lecture 19, page 1 CS677: Distributed OS Last Class: Fault tolerance Reliable communication –One-one communication –One-many communication.
Lecture 5 Page 1 CS 111 Summer 2013 Bounded Buffers A higher level abstraction than shared domains or simple messages But not quite as high level as RPC.
/** * A utility class for decoding URL encoded strings. */ public class URLDecoder {...} /* * Obtain a normalized resource name from REQ. */ private static.
Memory Hierarchy Ideal memory is fast, large, and inexpensive
Module 11: File Structure
Lecture 12 Virtual Memory.
Comments That Duplicate Code
Compiler Design 18. Object Oriented Semantic Analysis (Symbol Tables, Type Checking) Kanat Bolazar March 30, 2010.
Computer Architecture
Iteration: Beyond the Basic PERFORM
Printed on Monday, December 31, 2018 at 2:03 PM.
Lecture 2- Query Processing (continued)
2. Second Step for Learning C++ Programming • Data Type • Char • Float
CSE 542: Operating Systems
Presentation transcript:

// Increment i i += 1; // Restart timer this->start(Cycles::rdtsc() + clock->updateIntervalCycles); updater->start(0); // Start immediately. CS 190 Lecture Notes: CommentsSlide 1 Useless Comments

// Value of counter when a particular event occurred. uint64_t count; CS 190 Lecture Notes: CommentsSlide 2 Missing Information

query = new IndexLookup(index, key1, key2); while (true) { object = query.getNext(); if (object == null) { break; }... } CS 190 Lecture Notes: CommentsSlide 3 Index Lookup Example

CS 190 Lecture Notes: CommentsSlide 4 Class Documentation /* * This class implements the client side framework for index range * lookups. It manages a single LookupIndexKeys RPC and multiple * IndexedRead RPCs. Client side just includes "IndexLookup.h" in * its header to use IndexLookup class. * Several parameters can be set in the config below: * - The number of concurrent indexedRead RPCs * - The max number of PKHashes a indexedRead RPC can hold at a time * - The size of the active PKHashes * * To use IndexLookup, the client creates an object of this class * by providing all necessary information. After construction of * IndexLookup, client can call getNext() function to move to next * available object. If getNext() returns false, it means we reached the * last object. Client can use getKey/getKeyLength/getValue/getValueLength * to get object data of current object. */ class IndexLookup {... private: /// Max number of concurrent indexedRead RPCs static const uint8_t NUM_READ_RPC = 10; /// Max number of PKHashes that can be sent in one indexedRead RPC static const uint32_t MAX_PKHASHES_PERRPC = 256; /// Max number of PKHashes that activeHashes can hold at once. static const size_t MAX_NUM_PK = (1 << LG_BUFFER_SIZE); }

CS 190 Lecture Notes: CommentsSlide 5 Documenting APIs /** * Check if the next object is RESULT_READY. This function is implemented * in a DCFT module, each execution of isReady() tries to make small * progress, and getNext() invokes isReady() in a while loop, until * isReady() returns true. * * isReady() is implemented in a rule-based approach. We check different * rules by following a particular order, and perform certain actions if * some rule is satisfied * * \return * True means the next Object is available. Otherwise, return false. */ bool IndexLookup::isReady() {... } * This method returns an indication of whether the indexed read * has made enough progress that getNext can return immediately * without blocking. In addition, this method does most of the * real work for indexed reads, so it must be invoked (either * directly, or indirectly by calling getNext) in order for the * indexed read to make progress. * * \return * True means at least one object is available, so getNext will * not block if it is invoked; false means getNext may block.

// Value of counter when a particular event occurred. uint64_t count; // Cumulative count of last-level cache misses when // this event was recorded. uint64_t missCount; CS 190 Lecture Notes: CommentsSlide 6 Missing Information

/// Current offset in resp Buffer uint32_t offset; /// Offset in this buffer of the first object that hasn’t /// been returned to the client. uint32_t offset; CS 190 Lecture Notes: CommentsSlide 7 Comment Not Specific Enough

CS 190 Lecture Notes: CommentsSlide 8 Good Loop Comment // Each iteration extracts one request from request rpc, increments the // corresponding object, and appends the response to the response rpc. for (uint32_t i = 0; ; i++) { const WireFormat::MultiOp::Request::IncrementPart *currentReq = rpc->requestPayload->getOffset< WireFormat::MultiOp::Request::IncrementPart>(reqOffset); if (currentReq == NULL) { respHdr->common.status = STATUS_REQUEST_FORMAT_ERROR; break; } reqOffset += sizeof32(WireFormat::MultiOp::Request::IncrementPart); const void* stringKey = rpc->requestPayload->getRange( reqOffset, currentReq->keyLength); reqOffset += currentReq->keyLength;... }

// If there is a LOADING readRpc using the same session as PKHash // pointed by assignPos, and the last PKHash in that readRPC is // smaller than current assigning PKHash, then we put assigning // PKHash into that readRPC. uint8_t readActiveRpcId = RPC_ID_NOT_ASSIGNED; for (uint8_t i = 0; i < NUM_READ_RPC; i++) { if (session == readRpc[i].session && readRpc[i].status == LOADING && readRpc[i].maxPos < assignPos && readRpc[i].numHashes < MAX_PKHASHES_PERRPC) { readActiveRpcId = i; break; } // Try to piggyback the current key hash onto an existing // RPC to the desired server. CS 190 Lecture Notes: CommentsSlide 9 Comments at Wrong Level

if (numProcessedPKHashes < readRpc[i].numHashes) { // Some of the key hashes couldn't be looked up in this // request (either because they aren't stored by the // server, because the server crashed, or because there // wasn't enough space in the response message). Mark // the unprocessed hashes so they will get reassigned to // new RPCs. for (size_t p = removePos; p < insertPos; p ++) { if (activeRpcId[p] == i) { if (numProcessedPKHashes > 0) { numProcessedPKHashes--; } else { if (p < assignPos) assignPos = p; activeRpcId[p] = RPC_ID_NOT_ASSIGNED; } CS 190 Lecture Notes: CommentsSlide 10 Higher Level Documentation

... Zombies A zombie is a server that is considered dead by the rest of the cluster; any data stored on the server has been recovered and will be managed by other servers. However, if a zombie is not actually dead (e.g. it was just disconnected from the other servers for a while) two forms of inconsistency can arise: * A zombie server must not serve read requests once replacement servers have taken over; otherwise it may return stale data that does not reflect writes accepted by the replacement servers. * The zombie server must not accept write request once replacement servers have begun replaying its log during recovery; if it does, these writes may be lost (the new values may not be stored on the replacement servers and thus will not be returned by reads). RAMCloud uses two techniques to neutralize zombies. First, Timing-Dependent Tests Several unit tests have timing dependencies. For example,... CS 190 Lecture Notes: CommentsSlide 11 Design Notes File

if (probesWithoutResponse >= MAX_FAILED_PROBES) { // See "Zombies" in designNotes. MasterService::Disabler disabler(context->masterService); CoordinatorClient::verifyMembership(context, ourServerId); probesWithoutResponse = 0; } CS 190 Lecture Notes: CommentsSlide 12 Design Notes File, cont’d

typedef enum Status { STATUS_OK = 0, STATUS_UNKNOWN_TABLET = 1, STATUS_TABLE_DOESNT_EXIST = 2,... STATUS_INVALID_PARAMETER = 30, STATUS_MAX_VALUE = 30, // Note: if you add a new status value you must make the following // additional updates: // * Modify STATUS_MAX_VALUE to have a value equal to the largest // defined status value, and make sure its definition is the last one // in the list. STATUS_MAX_VALUE is used primarily for testing. // * Add new entries in the tables "messages" and "symbols" in Status.cc. // * Add a new exception class to ClientException.h // * Add a new "case" to ClientException::throwException to map from // the status value to a status-specific ClientException subclass. // * In the Java bindings, add a static class for the exception to // ClientException.java // * Add a case for the status of the exception to throw the exception in // ClientException.java // * Add the exception to the Status enum in Status.java, making // sure the status is in the correct position corresponding to its // status code. } CS 190 Lecture Notes: CommentsSlide 13 Cross-Module Checklist

/** * Obtain the total number of indexlets this object is managing. * * \return * Total number of indexlets this object is managing. */ size_t IndexletManager::getCount() CS 190 Lecture Notes: CommentsSlide 14 Name Not Precise Enough