blob: 4ac30c103d5caf773c71088797a182490f5741a4 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
| Generated by Apache Maven Doxia at 2021-06-15
| Rendered using Apache Maven Stylus Skin 1.5
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Apache Hadoop 3.3.1 &#x2013; Notation</title>
<style type="text/css" media="all">
@import url("../css/maven-base.css");
@import url("../css/maven-theme.css");
@import url("../css/site.css");
</style>
<link rel="stylesheet" href="../css/print.css" type="text/css" media="print" />
<meta name="Date-Revision-yyyymmdd" content="20210615" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body class="composite">
<div id="banner">
<a href="http://hadoop.apache.org/" id="bannerLeft">
<img src="http://hadoop.apache.org/images/hadoop-logo.jpg" alt="" />
</a>
<a href="http://www.apache.org/" id="bannerRight">
<img src="http://www.apache.org/images/asf_logo_wide.png" alt="" />
</a>
<div class="clear">
<hr/>
</div>
</div>
<div id="breadcrumbs">
<div class="xleft">
<a href="http://www.apache.org/" class="externalLink">Apache</a>
&gt;
<a href="http://hadoop.apache.org/" class="externalLink">Hadoop</a>
&gt;
<a href="../../index.html">Apache Hadoop Project Dist POM</a>
&gt;
<a href="../index.html">Apache Hadoop 3.3.1</a>
&gt;
Notation
</div>
<div class="xright"> <a href="http://wiki.apache.org/hadoop" class="externalLink">Wiki</a>
|
<a href="https://gitbox.apache.org/repos/asf/hadoop.git" class="externalLink">git</a>
|
<a href="http://hadoop.apache.org/" class="externalLink">Apache Hadoop</a>
&nbsp;| Last Published: 2021-06-15
&nbsp;| Version: 3.3.1
</div>
<div class="clear">
<hr/>
</div>
</div>
<div id="leftColumn">
<div id="navcolumn">
<h5>General</h5>
<ul>
<li class="none">
<a href="../../../index.html">Overview</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/SingleCluster.html">Single Node Setup</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/ClusterSetup.html">Cluster Setup</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/CommandsManual.html">Commands Reference</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/FileSystemShell.html">FileSystem Shell</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/Compatibility.html">Compatibility Specification</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/DownstreamDev.html">Downstream Developer's Guide</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/AdminCompatibilityGuide.html">Admin Compatibility Guide</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/InterfaceClassification.html">Interface Classification</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/filesystem/index.html">FileSystem Specification</a>
</li>
</ul>
<h5>Common</h5>
<ul>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/CLIMiniCluster.html">CLI Mini Cluster</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/FairCallQueue.html">Fair Call Queue</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/NativeLibraries.html">Native Libraries</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/Superusers.html">Proxy User</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/RackAwareness.html">Rack Awareness</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/SecureMode.html">Secure Mode</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/ServiceLevelAuth.html">Service Level Authorization</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/HttpAuthentication.html">HTTP Authentication</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/CredentialProviderAPI.html">Credential Provider API</a>
</li>
<li class="none">
<a href="../../../hadoop-kms/index.html">Hadoop KMS</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/Tracing.html">Tracing</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/UnixShellGuide.html">Unix Shell Guide</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/registry/index.html">Registry</a>
</li>
</ul>
<h5>HDFS</h5>
<ul>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsDesign.html">Architecture</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsUserGuide.html">User Guide</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HDFSCommands.html">Commands Reference</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithQJM.html">NameNode HA With QJM</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HDFSHighAvailabilityWithNFS.html">NameNode HA With NFS</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/ObserverNameNode.html">Observer NameNode</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/Federation.html">Federation</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/ViewFs.html">ViewFs</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/ViewFsOverloadScheme.html">ViewFsOverloadScheme</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsSnapshots.html">Snapshots</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsEditsViewer.html">Edits Viewer</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsImageViewer.html">Image Viewer</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsPermissionsGuide.html">Permissions and HDFS</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsQuotaAdminGuide.html">Quotas and HDFS</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/LibHdfs.html">libhdfs (C API)</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/WebHDFS.html">WebHDFS (REST API)</a>
</li>
<li class="none">
<a href="../../../hadoop-hdfs-httpfs/index.html">HttpFS</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/ShortCircuitLocalReads.html">Short Circuit Local Reads</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/CentralizedCacheManagement.html">Centralized Cache Management</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsNfsGateway.html">NFS Gateway</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsRollingUpgrade.html">Rolling Upgrade</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/ExtendedAttributes.html">Extended Attributes</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/TransparentEncryption.html">Transparent Encryption</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsMultihoming.html">Multihoming</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/ArchivalStorage.html">Storage Policies</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/MemoryStorage.html">Memory Storage Support</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/SLGUserGuide.html">Synthetic Load Generator</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HDFSErasureCoding.html">Erasure Coding</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HDFSDiskbalancer.html">Disk Balancer</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsUpgradeDomain.html">Upgrade Domain</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsDataNodeAdminGuide.html">DataNode Admin</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs-rbf/HDFSRouterFederation.html">Router Federation</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/HdfsProvidedStorage.html">Provided Storage</a>
</li>
</ul>
<h5>MapReduce</h5>
<ul>
<li class="none">
<a href="../../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html">Tutorial</a>
</li>
<li class="none">
<a href="../../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapredCommands.html">Commands Reference</a>
</li>
<li class="none">
<a href="../../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduce_Compatibility_Hadoop1_Hadoop2.html">Compatibility with 1.x</a>
</li>
<li class="none">
<a href="../../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/EncryptedShuffle.html">Encrypted Shuffle</a>
</li>
<li class="none">
<a href="../../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/PluggableShuffleAndPluggableSort.html">Pluggable Shuffle/Sort</a>
</li>
<li class="none">
<a href="../../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/DistributedCacheDeploy.html">Distributed Cache Deploy</a>
</li>
<li class="none">
<a href="../../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/SharedCacheSupport.html">Support for YARN Shared Cache</a>
</li>
</ul>
<h5>MapReduce REST APIs</h5>
<ul>
<li class="none">
<a href="../../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapredAppMasterRest.html">MR Application Master</a>
</li>
<li class="none">
<a href="../../../hadoop-mapreduce-client/hadoop-mapreduce-client-hs/HistoryServerRest.html">MR History Server</a>
</li>
</ul>
<h5>YARN</h5>
<ul>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/YARN.html">Architecture</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/YarnCommands.html">Commands Reference</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/CapacityScheduler.html">Capacity Scheduler</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/FairScheduler.html">Fair Scheduler</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/ResourceManagerRestart.html">ResourceManager Restart</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/ResourceManagerHA.html">ResourceManager HA</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/ResourceModel.html">Resource Model</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/NodeLabel.html">Node Labels</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/NodeAttributes.html">Node Attributes</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/WebApplicationProxy.html">Web Application Proxy</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/TimelineServer.html">Timeline Server</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/TimelineServiceV2.html">Timeline Service V.2</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/WritingYarnApplications.html">Writing YARN Applications</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/YarnApplicationSecurity.html">YARN Application Security</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/NodeManager.html">NodeManager</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/DockerContainers.html">Running Applications in Docker Containers</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/RuncContainers.html">Running Applications in runC Containers</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/NodeManagerCgroups.html">Using CGroups</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/SecureContainer.html">Secure Containers</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/ReservationSystem.html">Reservation System</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/GracefulDecommission.html">Graceful Decommission</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/OpportunisticContainers.html">Opportunistic Containers</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/Federation.html">YARN Federation</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/SharedCache.html">Shared Cache</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/UsingGpus.html">Using GPU</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/UsingFPGA.html">Using FPGA</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/PlacementConstraints.html">Placement Constraints</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/YarnUI2.html">YARN UI2</a>
</li>
</ul>
<h5>YARN REST APIs</h5>
<ul>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/WebServicesIntro.html">Introduction</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/ResourceManagerRest.html">Resource Manager</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/NodeManagerRest.html">Node Manager</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/TimelineServer.html#Timeline_Server_REST_API_v1">Timeline Server</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/TimelineServiceV2.html#Timeline_Service_v.2_REST_API">Timeline Service V.2</a>
</li>
</ul>
<h5>YARN Service</h5>
<ul>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/yarn-service/Overview.html">Overview</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/yarn-service/QuickStart.html">QuickStart</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/yarn-service/Concepts.html">Concepts</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/yarn-service/YarnServiceAPI.html">Yarn Service API</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/yarn-service/ServiceDiscovery.html">Service Discovery</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-site/yarn-service/SystemServices.html">System Services</a>
</li>
</ul>
<h5>Hadoop Compatible File Systems</h5>
<ul>
<li class="none">
<a href="../../../hadoop-aliyun/tools/hadoop-aliyun/index.html">Aliyun OSS</a>
</li>
<li class="none">
<a href="../../../hadoop-aws/tools/hadoop-aws/index.html">Amazon S3</a>
</li>
<li class="none">
<a href="../../../hadoop-azure/index.html">Azure Blob Storage</a>
</li>
<li class="none">
<a href="../../../hadoop-azure-datalake/index.html">Azure Data Lake Storage</a>
</li>
<li class="none">
<a href="../../../hadoop-openstack/index.html">OpenStack Swift</a>
</li>
<li class="none">
<a href="../../../hadoop-cos/cloud-storage/index.html">Tencent COS</a>
</li>
</ul>
<h5>Auth</h5>
<ul>
<li class="none">
<a href="../../../hadoop-auth/index.html">Overview</a>
</li>
<li class="none">
<a href="../../../hadoop-auth/Examples.html">Examples</a>
</li>
<li class="none">
<a href="../../../hadoop-auth/Configuration.html">Configuration</a>
</li>
<li class="none">
<a href="../../../hadoop-auth/BuildingIt.html">Building</a>
</li>
</ul>
<h5>Tools</h5>
<ul>
<li class="none">
<a href="../../../hadoop-streaming/HadoopStreaming.html">Hadoop Streaming</a>
</li>
<li class="none">
<a href="../../../hadoop-archives/HadoopArchives.html">Hadoop Archives</a>
</li>
<li class="none">
<a href="../../../hadoop-archive-logs/HadoopArchiveLogs.html">Hadoop Archive Logs</a>
</li>
<li class="none">
<a href="../../../hadoop-distcp/DistCp.html">DistCp</a>
</li>
<li class="none">
<a href="../../../hadoop-gridmix/GridMix.html">GridMix</a>
</li>
<li class="none">
<a href="../../../hadoop-rumen/Rumen.html">Rumen</a>
</li>
<li class="none">
<a href="../../../hadoop-resourceestimator/ResourceEstimator.html">Resource Estimator Service</a>
</li>
<li class="none">
<a href="../../../hadoop-sls/SchedulerLoadSimulator.html">Scheduler Load Simulator</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/Benchmarking.html">Hadoop Benchmarking</a>
</li>
<li class="none">
<a href="../../../hadoop-dynamometer/Dynamometer.html">Dynamometer</a>
</li>
</ul>
<h5>Reference</h5>
<ul>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/release/">Changelog and Release Notes</a>
</li>
<li class="none">
<a href="../../../api/index.html">Java API docs</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/UnixShellAPI.html">Unix Shell API</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/Metrics.html">Metrics</a>
</li>
</ul>
<h5>Configuration</h5>
<ul>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/core-default.xml">core-default.xml</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs/hdfs-default.xml">hdfs-default.xml</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-hdfs-rbf/hdfs-rbf-default.xml">hdfs-rbf-default.xml</a>
</li>
<li class="none">
<a href="../../../hadoop-mapreduce-client/hadoop-mapreduce-client-core/mapred-default.xml">mapred-default.xml</a>
</li>
<li class="none">
<a href="../../../hadoop-yarn/hadoop-yarn-common/yarn-default.xml">yarn-default.xml</a>
</li>
<li class="none">
<a href="../../../hadoop-kms/kms-default.html">kms-default.xml</a>
</li>
<li class="none">
<a href="../../../hadoop-hdfs-httpfs/httpfs-default.html">httpfs-default.xml</a>
</li>
<li class="none">
<a href="../../../hadoop-project-dist/hadoop-common/DeprecatedProperties.html">Deprecated Properties</a>
</li>
</ul>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img alt="Built by Maven" src="../images/logos/maven-feather.png"/>
</a>
</div>
</div>
<div id="bodyColumn">
<div id="contentBox">
<!---
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->
<h1>Notation</h1>
<ul>
<li><a href="#a"></a>
<ul>
<li><a href="#Mathematics_Symbols_in_this_document">Mathematics Symbols in this document</a>
<ul>
<li><a href="#Sets.2C__Lists.2C_Maps.2C_and_Strings">Sets, Lists, Maps, and Strings</a></li>
<li><a href="#State_Immutability">State Immutability</a></li>
<li><a href="#Function_Specifications">Function Specifications</a></li></ul></li>
<li><a href="#Exceptions">Exceptions</a></li>
<li><a href="#Conditions">Conditions</a>
<ul>
<li><a href="#supported.28instance.2C_method.29">supported(instance, method)</a></li></ul></li></ul></li></ul>
<p>A formal notation such as <a class="externalLink" href="http://www.open-std.org/jtc1/sc22/open/n3187.pdf">The Z Notation</a> would be the strictest way to define Hadoop FileSystem behavior, and could even be used to prove some axioms.</p>
<p>However, it has a number of practical flaws:</p>
<ol style="list-style-type: decimal">
<li>
<p>Such notations are not as widely used as they should be, so the broader software development community is not going to have practical experience of it.</p>
</li>
<li>
<p>It&#x2019;s very hard to work with without dropping into tools such as LaTeX <i>and</i> add-on libraries.</p>
</li>
<li>
<p>Such notations are difficult to understand, even for experts.</p>
</li>
</ol>
<p>Given that the target audience of this specification is FileSystem developers, formal notations are not appropriate. Instead, broad comprehensibility, ease of maintenance, and ease of deriving tests take priority over mathematically-pure formal notation.</p>
<div class="section">
<div class="section">
<h3><a name="Mathematics_Symbols_in_this_document"></a>Mathematics Symbols in this document</h3>
<p>This document does use a subset of <a class="externalLink" href="http://staff.washington.edu/jon/z/glossary.html">the notation in the Z syntax</a>, but in an ASCII form and the use of Python list notation for manipulating lists and sets.</p>
<ul>
<li><tt>iff</tt> : <tt>iff</tt> If and only if</li>
<li><tt>&#x21d2;</tt> : <tt>implies</tt></li>
<li><tt>&#x2192;</tt> : <tt>--&gt;</tt> total function</li>
<li><tt>&#x219b;</tt> : <tt>-&gt;</tt> partial function</li>
<li>
<p><tt>&#x2229;</tt> : <tt>^</tt>: Set Intersection</p>
</li>
<li><tt>&#x222a;</tt> : <tt>+</tt>: Set Union</li>
<li><tt>\</tt> : <tt>-</tt>: Set Difference</li>
<li>
<p><tt>&#x2203;</tt> : <tt>exists</tt> Exists predicate</p>
</li>
<li><tt>&#x2200;</tt> : <tt>forall</tt>: For all predicate</li>
<li><tt>=</tt> : <tt>==</tt> Equals operator</li>
<li><tt>&#x2260;</tt> : <tt>!=</tt> operator. In Java <tt>z &#x2260; y</tt> is written as <tt>!( z.equals(y))</tt> for all non-simple datatypes</li>
<li><tt>&#x2261;</tt> : <tt>equivalent-to</tt> equivalence operator. This is stricter than equals.</li>
<li><tt>&#x2205;</tt> : <tt>{}</tt> Empty Set. <tt>&#x2205; &#x2261; {}</tt></li>
<li><tt>&#x2248;</tt> : <tt>approximately-equal-to</tt> operator</li>
<li><tt>&#xac;</tt> : <tt>not</tt> Not operator. In Java, <tt>!</tt></li>
<li><tt>&#x2204;</tt> : <tt>does-not-exist</tt>: Does not exist predicate. Equivalent to <tt>not exists</tt></li>
<li><tt>&#x2227;</tt> : <tt>and</tt> : local and operator. In Java , <tt>&amp;&amp;</tt></li>
<li><tt>&#x2228;</tt> : <tt>or</tt> : local and operator. In Java, <tt>||</tt></li>
<li><tt>&#x2208;</tt> : <tt>in</tt> : element of</li>
<li><tt>&#x2209;</tt> : <tt>not in</tt> : not an element of</li>
<li><tt>&#x2286;</tt> : <tt>subset-or-equal-to</tt> the subset or equality condition</li>
<li><tt>&#x2282;</tt> : <tt>subset-of</tt> the proper subset condition</li>
<li><tt>| p |</tt> : <tt>len(p)</tt> the size of a variable</li>
<li>
<p><tt>:=</tt> : <tt>=</tt> :</p>
</li>
<li>
<p>`` : <tt>#</tt> : Python-style comments</p>
</li>
<li>
<p><tt>happens-before</tt> : <tt>happens-before</tt> : Lamport&#x2019;s ordering relationship as defined in <a class="externalLink" href="http://research.microsoft.com/en-us/um/people/lamport/pubs/time-clocks.pdf">Time, Clocks and the Ordering of Events in a Distributed System</a></p>
</li>
</ul>
<div class="section">
<h4><a name="Sets.2C__Lists.2C_Maps.2C_and_Strings"></a>Sets, Lists, Maps, and Strings</h4>
<p>The <a class="externalLink" href="http://docs.python.org/2/tutorial/datastructures.html">python data structures</a> are used as the basis for this syntax as it is both plain ASCII and well-known.</p>
<div class="section">
<h5><a name="Lists"></a>Lists</h5>
<ul>
<li>A list <i>L</i> is an ordered sequence of elements <tt>[e1, e2, ... en]</tt></li>
<li>The size of a list <tt>len(L)</tt> is the number of elements in a list.</li>
<li>Items can be addressed by a 0-based index <tt>e1 == L[0]</tt></li>
<li>Python slicing operators can address subsets of a list <tt>L[0:3] == [e1,e2]</tt>, <tt>L[:-1] == en</tt></li>
<li>Lists can be concatenated <tt>L' = L + [ e3 ]</tt></li>
<li>Lists can have entries removed <tt>L' = L - [ e2, e1 ]</tt>. This is different from Python&#x2019;s <tt>del</tt> operation, which operates on the list in place.</li>
<li>The membership predicate <tt>in</tt> returns true iff an element is a member of a List: <tt>e2 in L</tt></li>
<li>List comprehensions can create new lists: <tt>L' = [ x for x in l where x &lt; 5]</tt></li>
<li>for a list <tt>L</tt>, <tt>len(L)</tt> returns the number of elements.</li>
</ul></div>
<div class="section">
<h5><a name="Sets"></a>Sets</h5>
<p>Sets are an extension of the List notation, adding the restrictions that there can be no duplicate entries in the set, and there is no defined order.</p>
<ul>
<li>A set is an unordered collection of items surrounded by <tt>{</tt> and <tt>}</tt> braces.</li>
<li>When declaring one, the python constructor <tt>{}</tt> is used. This is different from Python, which uses the function <tt>set([list])</tt>. Here the assumption is that the difference between a set and a dictionary can be determined from the contents.</li>
<li>The empty set <tt>{}</tt> has no elements.</li>
<li>All the usual set concepts apply.</li>
<li>The membership predicate is <tt>in</tt>.</li>
<li>Set comprehension uses the Python list comprehension. <tt>S' = {s for s in S where len(s)==2}</tt></li>
<li>for a set <i>s</i>, <tt>len(s)</tt> returns the number of elements.</li>
<li>The <tt>-</tt> operator returns a new set excluding all items listed in the righthand set of the operator.</li>
</ul></div>
<div class="section">
<h5><a name="Maps"></a>Maps</h5>
<p>Maps resemble Python dictionaries; {&#x201c;key&#x201d;:value, &#x201c;key2&#x201d;,value2}</p>
<ul>
<li><tt>keys(Map)</tt> represents the set of keys in a map.</li>
<li><tt>k in Map</tt> holds iff <tt>k in keys(Map)</tt></li>
<li>The empty map is written <tt>{:}</tt></li>
<li>The <tt>-</tt> operator returns a new map which excludes the entry with the key specified.</li>
<li><tt>len(Map)</tt> returns the number of entries in the map.</li>
</ul></div>
<div class="section">
<h5><a name="Strings"></a>Strings</h5>
<p>Strings are lists of characters represented in double quotes. e.g. <tt>&quot;abc&quot;</tt></p>
<div>
<div>
<pre class="source">&quot;abc&quot; == ['a','b','c']
</pre></div></div>
</div></div>
<div class="section">
<h4><a name="State_Immutability"></a>State Immutability</h4>
<p>All system state declarations are immutable.</p>
<p>The suffix &#x201c;&#x2019;&#x201d; (single quote) is used as the convention to indicate the state of the system after an operation:</p>
<div>
<div>
<pre class="source">L' = L + ['d','e']
</pre></div></div>
</div>
<div class="section">
<h4><a name="Function_Specifications"></a>Function Specifications</h4>
<p>A function is defined as a set of preconditions and a set of postconditions, where the postconditions define the new state of the system and the return value from the function.</p></div></div>
<div class="section">
<h3><a name="Exceptions"></a>Exceptions</h3>
<p>In classic specification languages, the preconditions define the predicates that MUST be satisfied else some failure condition is raised.</p>
<p>For Hadoop, we need to be able to specify what failure condition results if a specification is not met (usually what exception is to be raised).</p>
<p>The notation <tt>raise &lt;exception-name&gt;</tt> is used to indicate that an exception is to be raised.</p>
<p>It can be used in the if-then-else sequence to define an action if a precondition is not met.</p>
<p>Example:</p>
<div>
<div>
<pre class="source">if not exists(FS, Path) : raise IOException
</pre></div></div>
<p>If implementations may raise any one of a set of exceptions, this is denoted by providing a set of exceptions:</p>
<div>
<div>
<pre class="source">if not exists(FS, Path) : raise {FileNotFoundException, IOException}
</pre></div></div>
<p>If a set of exceptions is provided, the earlier elements of the set are preferred to the later entries, on the basis that they aid diagnosis of problems.</p>
<p>We also need to distinguish predicates that MUST be satisfied, along with those that SHOULD be met. For this reason a function specification MAY include a section in the preconditions marked &#x2018;Should:&#x2019; All predicates declared in this section SHOULD be met, and if there is an entry in that section which specifies a stricter outcome, it SHOULD BE preferred. Here is an example of a should-precondition:</p>
<p>Should:</p>
<div>
<div>
<pre class="source">if not exists(FS, Path) : raise FileNotFoundException
</pre></div></div>
</div>
<div class="section">
<h3><a name="Conditions"></a>Conditions</h3>
<p>There are further conditions used in precondition and postcondition declarations.</p>
<div class="section">
<h4><a name="supported.28instance.2C_method.29"></a><tt>supported(instance, method)</tt></h4>
<p>This condition declares that a subclass implements the named method -some subclasses of the verious FileSystem classes do not, and instead raise <tt>UnsupportedOperation</tt></p>
<p>As an example, one precondition of <tt>FSDataInputStream.seek</tt> is that the implementation must support <tt>Seekable.seek</tt> :</p>
<div>
<div>
<pre class="source">supported(FDIS, Seekable.seek) else raise UnsupportedOperation
</pre></div></div></div></div></div>
</div>
</div>
<div class="clear">
<hr/>
</div>
<div id="footer">
<div class="xright">
&#169; 2008-2021
Apache Software Foundation
- <a href="http://maven.apache.org/privacy-policy.html">Privacy Policy</a>.
Apache Maven, Maven, Apache, the Apache feather logo, and the Apache Maven project logos are trademarks of The Apache Software Foundation.
</div>
<div class="clear">
<hr/>
</div>
</div>
</body>
</html>