inotify.proto 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. EVENT_TRUNCATE = 0x6;
  40. }
  41. message EventProto {
  42. required EventType type = 1;
  43. required bytes contents = 2;
  44. }
  45. message EventBatchProto {
  46. required int64 txid = 1;
  47. repeated EventProto events = 2;
  48. }
  49. enum INodeType {
  50. I_TYPE_FILE = 0x0;
  51. I_TYPE_DIRECTORY = 0x1;
  52. I_TYPE_SYMLINK = 0x2;
  53. }
  54. enum MetadataUpdateType {
  55. META_TYPE_TIMES = 0x0;
  56. META_TYPE_REPLICATION = 0x1;
  57. META_TYPE_OWNER = 0x2;
  58. META_TYPE_PERMS = 0x3;
  59. META_TYPE_ACLS = 0x4;
  60. META_TYPE_XATTRS = 0x5;
  61. }
  62. message CreateEventProto {
  63. required INodeType type = 1;
  64. required string path = 2;
  65. required int64 ctime = 3;
  66. required string ownerName = 4;
  67. required string groupName = 5;
  68. required FsPermissionProto perms = 6;
  69. optional int32 replication = 7;
  70. optional string symlinkTarget = 8;
  71. optional bool overwrite = 9;
  72. optional int64 defaultBlockSize = 10 [default=0];
  73. }
  74. message CloseEventProto {
  75. required string path = 1;
  76. required int64 fileSize = 2;
  77. required int64 timestamp = 3;
  78. }
  79. message TruncateEventProto {
  80. required string path = 1;
  81. required int64 fileSize = 2;
  82. required int64 timestamp = 3;
  83. }
  84. message AppendEventProto {
  85. required string path = 1;
  86. optional bool newBlock = 2 [default = false];
  87. }
  88. message RenameEventProto {
  89. required string srcPath = 1;
  90. required string destPath = 2;
  91. required int64 timestamp = 3;
  92. }
  93. message MetadataUpdateEventProto {
  94. required string path = 1;
  95. required MetadataUpdateType type = 2;
  96. optional int64 mtime = 3;
  97. optional int64 atime = 4;
  98. optional int32 replication = 5;
  99. optional string ownerName = 6;
  100. optional string groupName = 7;
  101. optional FsPermissionProto perms = 8;
  102. repeated AclEntryProto acls = 9;
  103. repeated XAttrProto xAttrs = 10;
  104. optional bool xAttrsRemoved = 11;
  105. }
  106. message UnlinkEventProto {
  107. required string path = 1;
  108. required int64 timestamp = 2;
  109. }
  110. message EventsListProto {
  111. repeated EventProto events = 1; // deprecated
  112. required int64 firstTxid = 2;
  113. required int64 lastTxid = 3;
  114. required int64 syncTxid = 4;
  115. repeated EventBatchProto batch = 5;
  116. }