message FeedMetadata { enum ProcessingInstruction { // Do not use. PROCESS_UNKNOWN = 0; // This Feed message is one shard of a complete feed. Anything previously // supplied by this partner will be deleted; the contents of this feed // represent the entire state of the world. PROCESS_AS_COMPLETE = 1; // Do not use. This value is deprecated. // Feed message is one shard of an incremental feed. // Existing entities will be left untouched except as modified in this feed. PROCESS_AS_INCREMENTAL = 2; } // Instructs us how to process the feed: either as a shard of a complete feed, // or as a shard of an incremental update. (required) ProcessingInstruction processing_instruction = 1; // The current shard and total number of shards for this feed. // // Shard number is assumed to be zero-based. // // There does not need to be any relationship to the file name. // // Shards do not need to be transferred in order, and they may not be // processed in order. (both required) int32 shard_number = 2; int32 total_shards = 3; // An identifier that must be consistent across all shards in a feed. // This value must be globally unique across each feed type. // // This value ensures that complete feeds spanning multiple shards are // processed together correctly. // // Clients only need to set this value when the processing_instruction is set // to PROCESS_AS_COMPLETE and the feed spans multiple shards (defined by // total_shards). // // Feeds that span multiple shards must set this nonce to the same value. // (required if total shards > 1) uint64 nonce = 5; // The timestamp at which this feed shard was generated. // // In Unix time format (seconds since the epoch). (required) int64 generation_timestamp = 4; }
Feed 元数据(旧版)
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eThe \u003ccode\u003enonce\u003c/code\u003e field must have a unique value across all feed uploads, often achieved by using timestamps to guarantee uniqueness.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003enonce\u003c/code\u003e value must be the same across all shards in a feed to ensure that complete feeds spanning multiple shards are processed together correctly.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eprocessing_instruction\u003c/code\u003e field indicates whether the feed is a shard of a complete feed or an incremental update, and dictates how the feed should be processed.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eshard_number\u003c/code\u003e and \u003ccode\u003etotal_shards\u003c/code\u003e specify the current shard's number and the total number of shards in the feed, respectively, which are required fields for all shards.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egeneration_timestamp\u003c/code\u003e must be set to indicate when the current feed shard was generated, in Unix time format.\u003c/p\u003e\n"]]],["The `nonce` field requires a unique value across all feed uploads, often generated using timestamps. It must be identical across all shards of a complete feed to ensure proper processing. The `processing_instruction` determines if a feed is complete or incremental. Feeds are divided into numbered `shards`, and the `total_shards` count is provided. The `generation_timestamp` records when a shard was created.\n"],null,["# Feed metadata (legacy)\n\n**Warning:** `nonce` - make sure that this field has a unique value across feed uploads. A common practice is to generate it using timestamps to guarantee its uniqueness. This value must be the same across all shards in a feed; it ensures that complete feeds spanning multiple shards are processed together correctly. \n\n```protobuf\nmessage FeedMetadata {\n enum ProcessingInstruction {\n // Do not use.\n PROCESS_UNKNOWN = 0;\n\n // This Feed message is one shard of a complete feed. Anything previously\n // supplied by this partner will be deleted; the contents of this feed\n // represent the entire state of the world.\n PROCESS_AS_COMPLETE = 1;\n\n // Do not use. This value is deprecated.\n // Feed message is one shard of an incremental feed.\n // Existing entities will be left untouched except as modified in this feed.\n PROCESS_AS_INCREMENTAL = 2;\n }\n\n // Instructs us how to process the feed: either as a shard of a complete feed,\n // or as a shard of an incremental update. (required)\n ProcessingInstruction processing_instruction = 1;\n\n // The current shard and total number of shards for this feed.\n //\n // Shard number is assumed to be zero-based.\n //\n // There does not need to be any relationship to the file name.\n //\n // Shards do not need to be transferred in order, and they may not be\n // processed in order. (both required)\n int32 shard_number = 2;\n int32 total_shards = 3;\n\n // An identifier that must be consistent across all shards in a feed.\n // This value must be globally unique across each feed type.\n //\n // This value ensures that complete feeds spanning multiple shards are\n // processed together correctly.\n //\n // Clients only need to set this value when the processing_instruction is set\n // to PROCESS_AS_COMPLETE and the feed spans multiple shards (defined by\n // total_shards).\n //\n // Feeds that span multiple shards must set this nonce to the same value.\n // (required if total shards \u003e 1)\n uint64 nonce = 5;\n\n // The timestamp at which this feed shard was generated.\n //\n // In Unix time format (seconds since the epoch). (required)\n int64 generation_timestamp = 4;\n}\n```"]]