/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you 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.
 */

/**
 * These .proto interfaces are private and stable.
 * Please see https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/Compatibility.html
 * for what changes are allowed for a *stable* .proto interface.
 */
syntax = "proto2";
option java_package = "org.apache.hadoop.fs";
option java_outer_classname = "FSProtos";
option java_generic_services = true;
option java_generate_equals_and_hash = true;
package hadoop.fs;

message FsPermissionProto {
  required uint32 perm = 1; // UNIX-style mode bits
}

/*
 * FileStatus encoding. Field IDs match those from HdfsFileStatusProto, but
 * cross-serialization is not an explicitly supported use case. Unlike HDFS,
 * most fields are optional and do not define defaults.
 */
message FileStatusProto {
  enum FileType {
    FT_DIR     = 1;
    FT_FILE    = 2;
    FT_SYMLINK = 3;
  }
  enum Flags {
    HAS_ACL           = 0x01; // has ACLs
    HAS_CRYPT         = 0x02; // encrypted
    HAS_EC            = 0x04; // erasure coded
    SNAPSHOT_ENABLED  = 0x08; // snapshot enabled
  }
  required FileType fileType            = 1;
  required string path                  = 2;
  optional uint64 length                = 3;
  optional FsPermissionProto permission = 4;
  optional string owner                 = 5;
  optional string group                 = 6;
  optional uint64 modification_time     = 7;
  optional uint64 access_time           = 8;
  optional string symlink               = 9;
  optional uint32 block_replication     = 10;
  optional uint64 block_size            = 11;
  // locations                          = 12
  // alias                              = 13
  // childrenNum                        = 14
  optional bytes encryption_data        = 15;
  // storagePolicy                      = 16
  optional bytes ec_data                = 17;
  optional uint32 flags                 = 18 [default = 0];
}

/**
 * Placeholder type for consistent basic FileSystem operations.
 */
message LocalFileSystemPathHandleProto {
    optional uint64 mtime = 1;
    optional string path = 2;
}
