blob: 80ab3ddf7ad2e6c3ed8b2450015ca02987d97c2f [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; A Model of a Hadoop Filesystem</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;
A Model of a Hadoop Filesystem
</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>A Model of a Hadoop Filesystem</h1>
<ul>
<li><a href="#Paths_and_Path_Elements">Paths and Path Elements</a>
<ul>
<li><a href="#Predicates_and_Functions">Predicates and Functions</a>
<ul>
<li><a href="#valid-path-element.28List.5BString.5D.29:_bool">valid-path-element(List[String]): bool</a></li>
<li><a href="#valid-path.28List.5BPathElement.5D.29:_bool">valid-path(List[PathElement]): bool</a></li>
<li><a href="#parent.28path:Path.29:_Path">parent(path:Path): Path</a></li>
<li><a href="#filename.28Path.29:_PathElement">filename(Path): PathElement</a></li>
<li><a href="#childElements.28Path_p.2C_Path_q.29:_Path">childElements(Path p, Path q): Path</a></li>
<li><a href="#ancestors.28Path.29:_List.5BPath.5D">ancestors(Path): List[Path]</a></li></ul></li>
<li><a href="#Notes_for_relative_paths">Notes for relative paths</a></li></ul></li>
<li><a href="#Defining_the_Filesystem">Defining the Filesystem</a>
<ul>
<li><a href="#Directory_references">Directory references</a></li>
<li><a href="#File_references">File references</a></li>
<li><a href="#Symbolic_references">Symbolic references</a></li>
<li><a href="#File_Length">File Length</a></li>
<li><a href="#User_home">User home</a></li>
<li><a href="#Exclusivity">Exclusivity</a></li>
<li><a href="#Encryption_Zone">Encryption Zone</a></li></ul></li>
<li><a href="#Notes">Notes</a></li></ul>
<div class="section">
<h2><a name="Paths_and_Path_Elements"></a>Paths and Path Elements</h2>
<p>A Path is a list of Path elements which represents a path to a file, directory or symbolic link</p>
<p>Path elements are non-empty strings. The exact set of valid strings MAY be specific to a particular FileSystem implementation.</p>
<p>Path elements MUST NOT be in <tt>{&quot;&quot;, &quot;.&quot;, &quot;..&quot;, &quot;/&quot;}</tt>.</p>
<p>Path elements MUST NOT contain the characters <tt>{'/', ':'}</tt>.</p>
<p>Filesystems MAY have other strings that are not permitted in a path element.</p>
<p>When validating path elements, the exception <tt>InvalidPathException</tt> SHOULD be raised when a path is invalid [HDFS]</p>
<div class="section">
<h3><a name="Predicates_and_Functions"></a>Predicates and Functions</h3>
<div class="section">
<h4><a name="valid-path-element.28List.5BString.5D.29:_bool"></a><tt>valid-path-element(List[String]): bool</tt></h4>
<p>A path element <tt>pe</tt> is invalid if any character in it is in the set of forbidden characters, or the element as a whole is invalid</p>
<div>
<div>
<pre class="source">forall e in pe: not (e in {'/', ':'})
not pe in {&quot;&quot;, &quot;.&quot;, &quot;..&quot;, &quot;/&quot;}
</pre></div></div>
</div>
<div class="section">
<h4><a name="valid-path.28List.5BPathElement.5D.29:_bool"></a><tt>valid-path(List[PathElement]): bool</tt></h4>
<p>A Path <tt>p</tt> is <i>valid</i> if all path elements in it are valid</p>
<div>
<div>
<pre class="source">def valid-path(path): forall pe in path: valid-path-element(pe)
</pre></div></div>
<p>The set of all possible paths is <i>Paths</i>; this is the infinite set of all lists of valid path elements.</p>
<p>The path represented by empty list, <tt>[]</tt> is the <i>root path</i>, and is denoted by the string <tt>&quot;/&quot;</tt>.</p></div>
<div class="section">
<h4><a name="parent.28path:Path.29:_Path"></a><tt>parent(path:Path): Path</tt></h4>
<p>The partial function <tt>parent(path:Path):Path</tt> provides the parent path can be defined using list slicing.</p>
<div>
<div>
<pre class="source">def parent(pe) : pe[0:-1]
</pre></div></div>
<p>Preconditions:</p>
<div>
<div>
<pre class="source">path != []
</pre></div></div>
</div>
<div class="section">
<h4><a name="filename.28Path.29:_PathElement"></a><tt>filename(Path): PathElement</tt></h4>
<p>The last Path Element in a Path is called the filename.</p>
<div>
<div>
<pre class="source">def filename(p) : p[-1]
</pre></div></div>
<p>Preconditions:</p>
<div>
<div>
<pre class="source">p != []
</pre></div></div>
</div>
<div class="section">
<h4><a name="childElements.28Path_p.2C_Path_q.29:_Path"></a><tt>childElements(Path p, Path q): Path</tt></h4>
<p>The partial function <tt>childElements:(Path p, Path q):Path</tt> is the list of path elements in <tt>p</tt> that follow the path <tt>q</tt>.</p>
<div>
<div>
<pre class="source">def childElements(p, q): p[len(q):]
</pre></div></div>
<p>Preconditions:</p>
<div>
<div>
<pre class="source"># The path 'q' must be at the head of the path 'p'
q == p[:len(q)]
</pre></div></div>
</div>
<div class="section">
<h4><a name="ancestors.28Path.29:_List.5BPath.5D"></a><tt>ancestors(Path): List[Path]</tt></h4>
<p>The list of all paths that are either the direct parent of a path p, or a parent of ancestor of p.</p></div></div>
<div class="section">
<h3><a name="Notes_for_relative_paths"></a>Notes for relative paths</h3>
<p>This definition handles absolute paths but not relative ones; it needs to be reworked so the root element is explicit, presumably by declaring that the root (and only the root) path element may be [&#x2018;/&#x2019;].</p>
<p>Relative paths can then be distinguished from absolute paths as the input to any function and resolved when the second entry in a two-argument function such as <tt>rename</tt>.</p></div></div>
<div class="section">
<h2><a name="Defining_the_Filesystem"></a>Defining the Filesystem</h2>
<p>A filesystem <tt>FS</tt> contains a set of directories, a dictionary of paths and a dictionary of symbolic links</p>
<div>
<div>
<pre class="source">(Directories:Set[Path], Files:[Path:List[byte]], Symlinks:Set[Path])
</pre></div></div>
<p>Accessor functions return the specific element of a filesystem</p>
<div>
<div>
<pre class="source">def FS.Directories = FS.Directories
def files(FS) = FS.Files
def symlinks(FS) = FS.Symlinks
def filenames(FS) = keys(FS.Files)
</pre></div></div>
<p>The entire set of a paths finite subset of all possible Paths, and functions to resolve a path to data, a directory predicate or a symbolic link:</p>
<div>
<div>
<pre class="source">def paths(FS) = FS.Directories + filenames(FS) + FS.Symlinks)
</pre></div></div>
<p>A path is deemed to exist if it is in this aggregate set:</p>
<div>
<div>
<pre class="source">def exists(FS, p) = p in paths(FS)
</pre></div></div>
<p>The root path, &#x201c;/&#x201d;, is a directory represented by the path [&#x201c;/&#x201d;], which must always exist in a filesystem.</p>
<div>
<div>
<pre class="source">def isRoot(p) = p == [&quot;/&quot;].
forall FS in FileSystems : [&quot;/&quot;] in FS.Directories
</pre></div></div>
<div class="section">
<h3><a name="Directory_references"></a>Directory references</h3>
<p>A path MAY refer to a directory in a FileSystem:</p>
<div>
<div>
<pre class="source">isDir(FS, p): p in FS.Directories
</pre></div></div>
<p>Directories may have children, that is, there may exist other paths in the FileSystem whose path begins with a directory. Only directories may have children. This can be expressed by saying that every path&#x2019;s parent must be a directory.</p>
<p>It can then be declared that a path has no parent in which case it is the root directory, or it MUST have a parent that is a directory:</p>
<div>
<div>
<pre class="source">forall p in paths(FS) : isRoot(p) or isDir(FS, parent(p))
</pre></div></div>
<p>Because the parent directories of all directories must themselves satisfy this criterion, it is implicit that only leaf nodes may be files or symbolic links:</p>
<p>Furthermore, because every filesystem contains the root path, every filesystem must contain at least one directory.</p>
<p>A directory may have children:</p>
<div>
<div>
<pre class="source">def children(FS, p) = {q for q in paths(FS) where parent(q) == p}
</pre></div></div>
<p>There are no duplicate names in the child paths, because all paths are taken from the set of lists of path elements. There can be no duplicate entries in a set, hence no children with duplicate names.</p>
<p>A path <i>D</i> is a descendant of a path <i>P</i> if it is the direct child of the path <i>P</i> or an ancestor is a direct child of path <i>P</i>:</p>
<div>
<div>
<pre class="source">def isDescendant(P, D) = parent(D) == P where isDescendant(P, parent(D))
</pre></div></div>
<p>The descendants of a directory P are all paths in the filesystem whose path begins with the path P -that is their parent is P or an ancestor is P</p>
<div>
<div>
<pre class="source">def descendants(FS, D) = {p for p in paths(FS) where isDescendant(D, p)}
</pre></div></div>
</div>
<div class="section">
<h3><a name="File_references"></a>File references</h3>
<p>A path MAY refer to a file that has data in the filesystem; its path is a key in the data dictionary</p>
<div>
<div>
<pre class="source">def isFile(FS, p) = p in FS.Files
</pre></div></div>
</div>
<div class="section">
<h3><a name="Symbolic_references"></a>Symbolic references</h3>
<p>A path MAY refer to a symbolic link:</p>
<div>
<div>
<pre class="source">def isSymlink(FS, p) = p in symlinks(FS)
</pre></div></div>
</div>
<div class="section">
<h3><a name="File_Length"></a>File Length</h3>
<p>The length of a path p in a filesystem FS is the length of the data stored, or 0 if it is a directory:</p>
<div>
<div>
<pre class="source">def length(FS, p) = if isFile(p) : return length(data(FS, p)) else return 0
</pre></div></div>
</div>
<div class="section">
<h3><a name="User_home"></a>User home</h3>
<p>The home directory of a user is an implicit part of a filesystem, and is derived from the userid of the process working with the filesystem:</p>
<div>
<div>
<pre class="source">def getHomeDirectory(FS) : Path
</pre></div></div>
<p>The function <tt>getHomeDirectory</tt> returns the home directory for the Filesystem and the current user account. For some FileSystems, the path is <tt>[&quot;/&quot;,&quot;users&quot;, System.getProperty(&quot;user-name&quot;)]</tt>. However, for HDFS, the username is derived from the credentials used to authenticate the client with HDFS. This may differ from the local user account name.</p></div>
<div class="section">
<h3><a name="Exclusivity"></a>Exclusivity</h3>
<p>A path cannot refer to more than one of a file, a directory or a symbolic link</p>
<div>
<div>
<pre class="source">FS.Directories ^ keys(data(FS)) == {}
FS.Directories ^ symlinks(FS) == {}
keys(data(FS))(FS) ^ symlinks(FS) == {}
</pre></div></div>
<p>This implies that only files may have data.</p>
<p>This condition is invariant and is an implicit postcondition of all operations that manipulate the state of a FileSystem <tt>FS</tt>.</p></div>
<div class="section">
<h3><a name="Encryption_Zone"></a>Encryption Zone</h3>
<p>The data is encrypted if the file is in encryption zone.</p>
<div>
<div>
<pre class="source">def inEncryptionZone(FS, path): bool
</pre></div></div>
<p>The nature of the encryption and the mechanism for creating an encryption zone are implementation details not covered in this specification. No guarantees are made about the quality of the encryption. The metadata is not encrypted.</p>
<p>All files and directories under a directory in an encryption zone are also in an encryption zone.</p>
<div>
<div>
<pre class="source">forall d in directories(FS): inEncyptionZone(FS, d) implies
forall c in children(FS, d) where (isFile(FS, c) or isDir(FS, c)) :
inEncyptionZone(FS, c)
</pre></div></div>
<p>For all files in an encrypted zone, the data is encrypted, but the encryption type and specification are not defined.</p>
<div>
<div>
<pre class="source">forall f in files(FS) where inEncyptionZone(FS, f):
isEncrypted(data(f))
</pre></div></div>
</div></div>
<div class="section">
<h2><a name="Notes"></a>Notes</h2>
<p>Not covered: hard links in a FileSystem. If a FileSystem supports multiple references in <i>paths(FS)</i> to point to the same data, the outcome of operations are undefined.</p>
<p>This model of a FileSystem is sufficient to describe all the FileSystem queries and manipulations excluding metadata and permission operations. The Hadoop <tt>FileSystem</tt> and <tt>FileContext</tt> interfaces can be specified in terms of operations that query or change the state of a FileSystem.</p></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>