inotify.proto 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. /**
  19. * These .proto interfaces are private and stable.
  20. * Please see http://wiki.apache.org/hadoop/Compatibility
  21. * for what changes are allowed for a *stable* .proto interface.
  22. */
  23. // This file contains protocol buffers used to communicate edits to clients
  24. // as part of the inotify system.
  25. option java_package = "org.apache.hadoop.hdfs.protocol.proto";
  26. option java_outer_classname = "InotifyProtos";
  27. option java_generate_equals_and_hash = true;
  28. package hadoop.hdfs;
  29. import "acl.proto";
  30. import "xattr.proto";
  31. import "hdfs.proto";
  32. enum EventType {
  33. EVENT_CREATE = 0x0;
  34. EVENT_CLOSE = 0x1;
  35. EVENT_APPEND = 0x2;
  36. EVENT_RENAME = 0x3;
  37. EVENT_METADATA = 0x4;
  38. EVENT_UNLINK = 0x5;
  39. }
  40. message EventProto {
  41. required EventType type = 1;
  42. required bytes contents = 2;
  43. }
  44. message EventBatchProto {
  45. required int64 txid = 1;
  46. repeated EventProto events = 2;
  47. }
  48. enum INodeType {
  49. I_TYPE_FILE = 0x0;
  50. I_TYPE_DIRECTORY = 0x1;
  51. I_TYPE_SYMLINK = 0x2;
  52. }
  53. enum MetadataUpdateType {
  54. META_TYPE_TIMES = 0x0;
  55. META_TYPE_REPLICATION = 0x1;
  56. META_TYPE_OWNER = 0x2;
  57. META_TYPE_PERMS = 0x3;
  58. META_TYPE_ACLS = 0x4;
  59. META_TYPE_XATTRS = 0x5;
  60. }
  61. message CreateEventProto {
  62. required INodeType type = 1;
  63. required string path = 2;
  64. required int64 ctime = 3;
  65. required string ownerName = 4;
  66. required string groupName = 5;
  67. required FsPermissionProto perms = 6;
  68. optional int32 replication = 7;
  69. optional string symlinkTarget = 8;
  70. optional bool overwrite = 9;
  71. optional int64 defaultBlockSize = 10 [default=0];
  72. }
  73. message CloseEventProto {
  74. required string path = 1;
  75. required int64 fileSize = 2;
  76. required int64 timestamp = 3;
  77. }
  78. message AppendEventProto {
  79. required string path = 1;
  80. optional bool newBlock = 2 [default = false];
  81. }
  82. message RenameEventProto {
  83. required string srcPath = 1;
  84. required string destPath = 2;
  85. required int64 timestamp = 3;
  86. }
  87. message MetadataUpdateEventProto {
  88. required string path = 1;
  89. required MetadataUpdateType type = 2;
  90. optional int64 mtime = 3;
  91. optional int64 atime = 4;
  92. optional int32 replication = 5;
  93. optional string ownerName = 6;
  94. optional string groupName = 7;
  95. optional FsPermissionProto perms = 8;
  96. repeated AclEntryProto acls = 9;
  97. repeated XAttrProto xAttrs = 10;
  98. optional bool xAttrsRemoved = 11;
  99. }
  100. message UnlinkEventProto {
  101. required string path = 1;
  102. required int64 timestamp = 2;
  103. }
  104. message EventsListProto {
  105. repeated EventProto events = 1; // deprecated
  106. required int64 firstTxid = 2;
  107. required int64 lastTxid = 3;
  108. required int64 syncTxid = 4;
  109. repeated EventBatchProto batch = 5;
  110. }