A list of the different modes of opening a file: wb+ Opens a file for both writing and reading in binary format. Overwrites the existing file if the file exists. If the file does not exist, creates a new file for reading and writing. a Opens a file for appending. The file pointer is at the end of the file if the file exists. That is, the file is in the append mode. If the file does not exist, it creates a new file for writing. ab Opens a file for appending in binary format. The file pointer is at the end of the file if the file exists. That is, the file is in the append mode. If the file does not exist, it creates a new file for writing. a+ Opens a file for both appending and reading. The file pointer is at the end of the file if the file exists. The file opens in the append mode. If the file does not exist, it creates a new file for reading and writing. ab+ Opens a file for both appending and reading in binary format. The file pointer is at the end of the file if the file exists. The file opens in the append mode. If the file does not exist, it creates a new file for reading and writing.
View full slide show




HDFS (Hadoop Distributed File System) is a distr file sys for commodity hdwr. Differences from other distr file sys are few but significant. HDFS is highly fault-tolerant and is designed to be deployed on low-cost hardware. HDFS provides hi thruput access to app data and is suitable for apps that have large data sets. HDFS relaxes a few POSIX requirements to enable streaming access to file system data. HDFS originally was infrastructure for Apache Nutch web search engine project, is part of Apache Hadoop Core http://hadoop.apache.org/core/ 2.1. Hardware Failure Hardware failure is the normal. An HDFS may consist of hundreds or thousands of server machines, each storing part of the file system’s data. There are many components and each component has a non-trivial prob of failure means that some component of HDFS is always non-functional. Detection of faults and quick, automatic recovery from them is core arch goal of HDFS. 2.2. Streaming Data Access Applications that run on HDFS need streaming access to their data sets. They are not general purpose applications that typically run on general purpose file systems. HDFS is designed more for batch processing rather than interactive use by users. The emphasis is on high throughput of data access rather than low latency of data access. POSIX imposes many hard requirements not needed for applications that are targeted for HDFS. POSIX semantics in a few key areas has been traded to increase data throughput rates. 2.3. Large Data Sets Apps on HDFS have large data sets, typically gigabytes to terabytes in size. Thus, HDFS is tuned to support large files. It provides high aggregate data bandwidth and scale to hundreds of nodes in a single cluster. It supports ~10 million files in a single instance. 2.4. Simple Coherency Model: HDFS apps need a write-once-read-many access model for files. A file once created, written, and closed need not be changed. This assumption simplifies data coherency issues and enables high throughput data access. A Map/Reduce application or a web crawler application fits perfectly with this model. There is a plan to support appending-writes to files in future [write once read many at file level] 2.5. “Moving Computation is Cheaper than Moving Data” A computation requested by an application is much more efficient if it is executed near the data it operates on. This is especially true when the size of the data set is huge. This minimizes network congestion and increases the overall throughput of the system. The assumption is that it is often better to migrate the computation closer to where the data is located rather than moving the data to where the app is running. HDFS provides interfaces for applications to move themselves closer to where the data is located. 2.6. Portability Across Heterogeneous Hardware and Software Platforms: HDFS has been designed to be easily portable from one platform to another. This facilitates widespread adoption of HDFS as a platform of choice for a large set of applications. 3. NameNode and DataNodes: HDFS has a master/slave architecture. An HDFS cluster consists of a single NameNode, a master server that manages the file system namespace and regulates access to files by clients. In addition, there are a number of DataNodes, usually one per node in the cluster, which manage storage attached to the nodes that they run on. HDFS exposes a file system namespace and allows user data to be stored in files. Internally, a file is 1 blocks stored in a set of DataNodes. The NameNode executes file system namespace operations like opening, closing, and renaming files and directories. It also determines the mapping of blocks to DataNodes. The DataNodes are responsible for serving read and write requests from the file system’s clients. The DataNodes also perform block creation, deletion, and replication upon instruction The NameNode and DataNode are pieces of software designed to run on commodity machines, typically run GNU/Linux operating system (OS). HDFS is built using the Java language; any machine that supports Java can run the NameNode or the DataNode software. Usage of the highly portable Java language means that HDFS can be deployed on a wide range of machines. A typical deployment has a dedicated machine that runs only the NameNode software. Each of the other machines in the cluster runs one instance of the DataNode software. The architecture does not preclude running multiple DataNodes on the same machine but in a real deployment that is rarely the case. The existence of a single NameNode in a cluster greatly simplifies the architecture of the system. The NameNode is the arbitrator and repository for all HDFS metadata. The system is designed in such a way that user data never flows through the NameNode. 4. The File System Namespace: HDFS supports a traditional hierarchical file organization. A user or an application can create directories and store files inside these directories. The file system namespace hierarchy is similar to most other existing file systems; one can create and remove files, move a file from one directory to another, or rename a file. HDFS does not yet implement user quotas or access permissions. HDFS does not support hard links or soft links. However, the HDFS architecture does not preclude implementing these features. The NameNode maintains the file system namespace. Any change to the file system namespace or its properties is recorded by the NameNode. An application can specify the number of replicas of a file that should be maintained by HDFS. The number of copies of a file is called the replication factor of that file. This info is stored by NameNode. 5. Data Replication: HDFS is designed to reliably store very large files across machines in a large cluster. It stores each file as a sequence of blocks; all blocks in a file except the last block are the same size. The blocks of a file are replicated for fault tolerance. The block size and replication factor are configurable per file. An application can specify the number of replicas of a file. The replication factor can be specified at file creation time and can be changed later. Files in HDFS are write-once and have strictly one writer at any time. The NameNode makes all decisions regarding replication of blocks. It periodically receives a Heartbeat and a Blockreport from each of the DataNodes in the cluster. Receipt of a Heartbeat implies that the DataNode is functioning properly. A Blockreport contains a list of all blocks on a DataNode
View full slide show




Which Connections Are Open on a Host? Apples-MacBook-Pro:~ rigrazia$ netstat Active Internet connections Proto Recv-Q Send-Q Local Address tcp4 0 0 10.0.0.108.54500 tcp4 0 0 10.0.0.108.54485 tcp6 0 0 2601:9:6800:1e6:.54455 tcp6 0 0 2601:9:6800:1e6:.54419 tcp6 0 0 2601:9:6800:1e6:.54400 tcp4 0 0 10.0.0.108.54385 tcp4 0 0 10.0.0.108.54368 tcp6 0 0 2601:9:6800:1e6:.54297 tcp4 0 0 10.0.0.108.53964 tcp4 0 0 10.0.0.108.53939 tcp4 0 0 10.0.0.108.53913 tcp4 0 0 10.0.0.108.53836 tcp4 0 0 localhost.49961 tcp4 0 0 localhost.53264 tcp4 0 0 localhost.49961 tcp4 0 0 localhost.53263 tcp4 0 0 10.0.0.108.52960 tcp4 0 0 10.0.0.108.50737 tcp4 0 0 10.0.0.108.62510 tcp4 0 0 10.0.0.108.62508 Foreign Address a184-51-102-51.d.http g1.v.fwmrm.net.http nuq05s01-in-x11..https edge-star6-shv-0.https 2001:559:0:54::6.https a184-51-102-42.d.http a184-84-222-181..macro nuq05s02-in-x01..https valiente.cabrill.ssh valiente.cabrill.ssh gw094.lphbs.com.http 68.71.212.186.http localhost.53264 localhost.49961 localhost.53263 localhost.49961 channelproxy-shv.https boris.cabrillo.e.imaps boris.cabrillo.e.imaps boris.cabrillo.e.imaps (state) ESTABLISHED ESTABLISHED ESTABLISHED ESTABLISHED ESTABLISHED CLOSE_WAIT ESTABLISHED ESTABLISHED ESTABLISHED ESTABLISHED ESTABLISHED ESTABLISHED ESTABLISHED ESTABLISHED ESTABLISHED ESTABLISHED ESTABLISHED ESTABLISHED ESTABLISHED ESTABLISHED  Sometimes it is necessary to know which active TCP connections are open and running on a networked host.  Netstat is a network utility that can be used to verify those connections.  It lists the protocol in use, the local address and port number, the foreign address and port number, and the state of the connection. 67
View full slide show




A list of the different modes of opening a file: Modes Description r Opens a file for reading only. The file pointer is placed at the beginning of the file. This is the default mode. rb Opens a file for reading only in binary format. The file pointer is placed at the beginning of the file. This is the default mode. r+ Opens a file for both reading and writing. The file pointer will be at the beginning of the file. rb+ Opens a file for both reading and writing in binary format. The file pointer will be at the beginning of the file. w Opens a file for writing only. Overwrites the file if the file exists. If the file does not exist, creates a new file for writing. wb Opens a file for writing only in binary format. Overwrites the file if the file exists. If the file does not exist, creates a new file for writing. w+ Opens a file for both writing and reading. Overwrites the existing file if the file exists. If the file does not exist, creates a new file for reading and writing.
View full slide show




Samples for the Proteomics Experiment Tissue 1 2 3 4 Treatment Group 1. Before Senescence A 2. After Senescence B 1. Before Senescence C 2. After Senescence D 1. Before Senescence E 2. After Senescence F 1. Before Senescence G 2. After Senescence H Switchgrass Clone # 5 (Early Senescence) Switchgrass Clone # 4 (Late Senescence) Prairie Cordgrass-ND (Early Senescence) Prairie Cordgrass-SD (Late Senescence) Sample# Sample# 1 Sample# 2 Sample# 3 Sample# 4 Sample# 5 Sample# 6 Sample# 7 Sample# 8 Sample# 9 Sample# 10 Sample# 11 Sample# 12 Sample# 13 Sample# 14 Sample# 15 Sample# 16 Sample# 17 Sample# 18 Sample# 19 Sample# 20 Sample# 21 Sample# 22 Sample# 23 Sample# 24
View full slide show




6. The Persistence of File System Metadata: The HDFS namespace is stored by the NameNode. The NameNode uses a transaction log called the EditLog to persistently record every change that occurs to file system metadata. For example, creating a new file in HDFS causes the NameNode to insert a record into the EditLog indicating this. Similarly, changing the replication factor of a file causes a new record to be inserted into the EditLog. The NameNode uses a file in its local host OS file system to store the EditLog. The entire file system namespace, including the mapping of blocks to files and file system properties, is stored in a file called the FsImage. The FsImage is stored as a file in the NameNode’s local file system too. The NameNode keeps an image of the entire file system namespace and file Blockmap in memory. This key metadata item is designed to be compact, such that a NameNode with 4 GB of RAM is plenty to support a huge number of files and directories. When the NameNode starts up, it reads the FsImage and EditLog from disk, applies all the transactions from the EditLog to the in-memory representation of the FsImage, and flushes out this new version into a new FsImage on disk. It can then truncate the old EditLog because its transactions have been applied to the persistent FsImage. This process is called a checkpoint. In the current implementation, a checkpoint only occurs when the NameNode starts up. Work is in progress to support periodic checkpointing in the near future. The DataNode stores HDFS data in files in its local file system. The DataNode has no knowledge about HDFS files. It stores each block of HDFS data in a separate file in its local file system. The DataNode does not create all files in the same directory. Instead, it uses a heuristic to determine the optimal number of files per directory and creates subdirectories appropriately. It is not optimal to create all local files in the same directory because the local file system might not be able to efficiently support a huge number of files in a single directory. When a DataNode starts up, it scans through its local file system, generates a list of all HDFS data blocks that correspond to each of these local files and sends this report to the NameNode: this is the Blockreport. 7. The Communication Protocols: All HDFS communication protocols are layered on top of the TCP/IP protocol. A client establishes a connection to a configurable TCP port on the NameNode machine. It talks the ClientProtocol with the NameNode. The DataNodes talk to the NameNode using the DataNode Protocol. A Remote Procedure Call (RPC) abstraction wraps both the Client Protocol and the DataNode Protocol. By design, the NameNode never initiates any RPCs. Instead, it only responds to RPC requests issued by DataNodes or clients. 8. Robustness: The primary objective of HDFS is to store data reliably even in the presence of failures. The three common types of failures are NameNode failures, DataNode failures and network partitions. 8.1. Data Disk Failure, Heartbeats and Re-Replication: Each DataNode sends a Heartbeat message to the NameNode periodically. A network partition can cause a subset of DataNodes to lose connectivity with the NameNode. The NameNode detects this condition by the absence of a Heartbeat message. The NameNode marks DataNodes without recent Heartbeats as dead and does not forward any new IO requests to them. Any data that was registered to a dead DataNode is not available to HDFS any more. DataNode death may cause the replication factor of some blocks to fall below their specified value. The NameNode constantly tracks which blocks need to be replicated and initiates replication whenever necessary. The necessity for re-replication may arise due to many reasons: a DataNode may become unavailable, a replica may become corrupted, a hard disk on a DataNode may fail, or the replication factor of a file may be increased. 8.2. Cluster Rebalancing: HDFS arch is compatible with data rebalancing . A scheme might automatically move data from 1 DataNode to another if the free space on a DataNode falls below a certain threshold. In the event of a sudden high demand for a particular file, a scheme might dynamically create additional replicas and rebalance other data in the cluster. These types of data rebalancing schemes are not yet implemented. 8.3. Data Integrity: It is possible that a block of data fetched from a DataNode arrives corrupted. This corruption can occur because of faults in a storage device, network faults, or buggy software. The HDFS client software implements checksum checking on the contents of HDFS files. When a client creates an HDFS file, it computes a checksum of each block of the file and stores these checksums in a separate hidden file in the same HDFS namespace. When a client retrieves file contents it verifies that the data it received from each DataNode matches the checksum stored in the associated checksum file. If not, then the client can opt to retrieve that block from another DataNode that has a replica of that block.
View full slide show




Review of Radars at Supersite HUMIDITY DUAL WAVELENGTH MM-WAVELENGTH •SPolKa (NCAR) S & •ARM mm radar Doppler Air motions •ARM Ka band Ka band •SMART-R C-band •SpolKa Ka band •SPolKa •ARM X & Ka •NOAA S-band? CM-WAVELENGTH Precipitation •SMART-R C-band •SPolKa S-band •ARM/AMIE X-band •NOAA S-band? •NOAA Distrometer? MM-WAVELENGTH Polarimetric Microphysics •SPolKa •ARM X band •ARM mm radar •ARM Ka band •SPolKa Ka band
View full slide show




Event Reconstruction - Reconstruction of deleted files.  In most file systems file deletion does not erase the information stored in the file. Instead, the file entry and the data blocks used by the file are marked as unallocated, so that they can be reused later for another file. Thus, unless the data blocks and the deleted file entry have been reallocated to another file, the deleted file can usually be recovered by restoring its file entry and data blocks to active status.  Even if the file entry and some of the data blocks have been re-allocated, it may still be possible to reconstruct parts of the file. The lazarus tool for example, uses several heuristics to find and piece together blocks that (could have) once belonged to a file. Lazarus uses heuristics about file systems and common file formats.  In most file systems, a file begins at the beginning of a disk block; Most file systems write file into contiguous blocks, if possible; Most file formats have a distinguishing pattern of bytes near the beginning of the le; For most file formats, same type of data is stored in all blocks of a file.
View full slide show




•Up to 2 bands tuned (ref pointing band on st and-by) •Tuning Pointing(II): Offset •Stan •Observin g      d-by •At start/after some obs erving, switch from obs erving band to pointing band. •RX While slewing bringast Normal Operations: Interferometric •with ALL ACA and-by band up and setChange •Wak ntennas (spec up to 4 deg separation), singlerelative near fo up necessary e-up cus positions/update poi by calibrator (self-pointing possible),continuum + nting model Other Referenced to Band 3 for high frequency bands, up • Pointing on Reference setto Band 4 pointing on same Band. Band ups •Update Collimation par Frequency: ~15 mins (?) •Pointi s of telescope Duration: ~1min •While slewing back bri ng ng back band and s Requisites: Refraction correction, Band 3 obs stand-by, et-up adequate focus/po Focus Relative Offsets/Relative Pointing Models inting/Ref band to stand -by •Re-start normal observ ing
View full slide show




8.4. Metadata Disk Failure: The FsImage and EditLog are central data structures. A corruption of these files can cause the HDFS instance to be non-functional. For this reason, the NameNode can be configured to support maintaining multiple copies of the FsImage and EditLog. Any update to either the FsImage or EditLog causes each of the FsImages and EditLogs to get updated synchronously. This synchronous updating of multiple copies of the FsImage and EditLog may degrade the rate of namespace transactions per second that a NameNode can support. However, this degradation is acceptable because even though HDFS applications are very data intensive in nature, they are not metadata intensive. When a NameNode restarts, it selects the latest consistent FsImage and EditLog to use. The NameNode machine is a single point of failure for an HDFS cluster. If the NameNode machine fails, manual intervention is necessary. Currently, automatic restart and failover of the NameNode software to another machine is not supported. 8.5. Snapshots: Snapshots support storing a copy of data at a particular instant of time. One usage of the snapshot feature may be to roll back a corrupted HDFS instance to a previously known good point in time. HDFS does not currently support snapshots but will in a future release. 9. Data Organization 9.1. Data Blocks: HDFS is designed to support very large files. Applications that are compatible with HDFS are those that deal with large data sets. These applications write their data only once but they read it one or more times and require these reads to be satisfied at streaming speeds. HDFS supports write-once-read-many semantics on files. A typical block size used by HDFS is 64 MB. Thus, an HDFS file is chopped up into 64 MB chunks, and if possible, each chunk will reside on a different DataNode. 9.2. Staging: A client request to create a file does not reach the NameNode immediately. In fact, initially the HDFS client caches the file data into a temporary local file. Application writes are transparently redirected to this temporary local file. When the local file accumulates data worth over one HDFS block size, the client contacts the NameNode. The NameNode inserts the file name into the file system hierarchy and allocates a data block for it. The NameNode responds to the client request with the identity of the DataNode and the destination data block. Then the client flushes the block of data from the local temporary file to the specified DataNode. When a file is closed, the remaining un-flushed data in the temporary local file is transferred to the DataNode. The client then tells the NameNode that the file is closed. At this point, the NameNode commits the file creation operation into a persistent store. If the NameNode dies before the file is closed, the file is lost. The above approach has been adopted after careful consideration of target applications that run on HDFS. These applications need streaming writes to files. If a client writes to a remote file directly without any client side buffering, the network speed and the congestion in the network impacts throughput considerably. This approach is not without precedent. Earlier distributed file systems, e.g. AFS, have used client side caching to improve performance. A POSIX requirement has been relaxed to achieve higher performance of data uploads. 9.3. Replication Pipelining: When a client is writing data to an HDFS file, its data is first written to a local file as explained in the previous section. Suppose the HDFS file has a replication factor of three. When the local file accumulates a full block of user data, the client retrieves a list of DataNodes from the NameNode. This list contains the DataNodes that will host a replica of that block. The client then flushes the data block to the first DataNode. The first DataNode starts receiving the data in small portions (4 KB), writes each portion to its local repository and transfers that portion to the second DataNode in the list. The second DataNode, in turn starts receiving each portion of the data block, writes that portion to its repository and then flushes that portion to the third DataNode. Finally, the third DataNode writes the data to its local repository. Thus, a DataNode can be receiving data from the previous one in the pipeline and at the same time forwarding data to the next one in the pipeline. Thus, the data is pipelined from one DataNode to the next.
View full slide show




Cycle 1 Cycle 2 Cycle 3 Cycle 4 Cycle 5 Instr cache Reg file ALU Data cache Reg file Instr cache Reg file ALU Data cache Reg file Reg file ALU Data cache Instr 3 Instr 5 Instr 4 Instr cache Cycle 7 Cycle 8 Cycle 9 Cycle 2 Cycle 3 Writes into $8 Bubble Reg file Task dimension Cycle 4 ALU Bubble Instr cache Reg file Cycle 5 Cycle 6 Reg file Data cache Reg file ALU Data cache Reg file Cycle 8 Cycle 9 Cycle 7 Without data forwarding, three bubbles are needed to resolve a read-after-write data dependency Reads from $8 Time dimension Instr cache Instr 3 Instr 2 Instr 1 Bubble Instr cache Cycle 1 ALU Data cache Reg file Instr cache Reg file ALU Data cache Reg file ALU Data cache Reg file Reg file ALU Data cache Reg file Instr cache Reg file ALU Data cache Bubble Reg file Instr cache Task dimension Writes into $8 Reg file Instr cache Instr 4 Instr 5 Cycle 6 Time dimension Instr 2 Instr 1 Inserting Bubbles in a Pipeline Bubble Two bubbles, if we assume that a register can be updated and read from in one cycle Reads from $8 Reg file Computer Architecture, Data Path and Control Slide 48
View full slide show




Chapter 21 Resistance color-code Resistance value, first three bands: First band – 1st digit Second band – 2nd digit *Third band – Multiplier (number of zeros following second digit) Fourth band - tolerance Color Digit Multiplier Tolerance Black 0 10 0 Brown 1 10 1 1% (five band) Red 2 10 2 2% (five band) Orange 3 10 3 Yellow 4 10 4 Green 5 10 5 Blue 6 10 6 Violet 7 10 7 Gray 8 10 8 White 9 10 9 Gold ±5% 10 -1 5% (four band) Silver ±10% 10 -2 10% (four band) No band ±20% * For resistance values less than 10 , the third band is either gold or silver. Gold is for a multiplier of 0.1 and silver is for a multiplier of 0.01. Electronics Fundamentals 8th edition Floyd/Buchla © 2010 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved.
View full slide show




Operation on Files  Typical file operations include:          OPEN: Readies the file for access, and associates a pointer that will refer to a current file record at each point in time. FIND: Searches for the first file record that satisfies a certain condition, and makes it the current file record. FINDNEXT: Searches for the next file record (from the current record) that satisfies a certain condition, and makes it the current file record. READ: Reads the current file record into a program variable. INSERT: Inserts a new record into the file & makes it the current file record. DELETE: Removes the current file record from the file, usually by marking the record to indicate that it is no longer valid. MODIFY: Changes the values of some fields of the current file record. CLOSE: Terminates access to the file. REORGANIZE: Reorganizes the file records.   For example, the records marked deleted are physically removed from the file or a new organization of the file records is created. READ_ORDERED: Read the file blocks in order of a specific field of the file. Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 13- 14
View full slide show




Event Reconstruction - Detection of deleted files.  Information about individual files is stored in standardized file entries whose organization diers from file system to file system.  In Unix file systems, the information about a file is stored in a combination of i-node and directory entries pointing to that i-node.  In Windows NT file system (NTFS), information about a file is stored in an entry of the Master File Table.  When a disk or a disk partition is first formatted, all such file set to initial “unallocated" value.  When a file entry is allocated for a file, it becomes active. Its fields are filled with proper information about the file.  In most file systems, however, the file entry is not restored to the “unallocated“ value when the file is deleted. As a result, presence of a file entry whose value is different from the initial “unallocated" value, indicates that that file entry once represented a file, which was subsequently deleted.
View full slide show